I used 30 checkboxes in a table, 5 rows and 6 columns. 5 checkboxes are in each row.
I need to satisfy two conditions within this table.
The first condition is when three Checkboxes are selected continuously it should display ("You can't select continuous hours").
Next condition is, it shouldn't select more than three checkbox in each row.
How can I accomplish this?
Related
I want to design a grid view or table that gets data from database then i want leave first row blank. when user click in the cells of first row and type in, it shows every data that matches.
You can use textBoxes to query your requested data in gridView and use onTextBoxChanged to update the gridView. Instead of increasing the code you also can do it using Table let's say you have 5 columns on the gridView you make table with 5 columns and 2 rows, the first row you put 1 textBox in each cell, in the second column you use colspan property and set it to 5. Then use the event onTextBoxChanged call the SQL command and query the data on textBox then update the gridView.
I have selected few rows from data grid (say the selected count becomes 5)and then refreshed the page, the count of selected rows still remains the same.
I have a devexpress grid view in my asp.net web application.Now I can group and select all rows grid wise from header part. I need to select the rows under a group separately without selecting the whole grid rows. Can any one help me on this.
I think this is what you are looking for:
How to implement select/unselect for all rows in a group row
https://www.devexpress.com/Support/Center/Example/Details/E1760
On right side you can run example in browser.
Refer this: ASPxGridView - How to implement select/unselect for all rows in a group row
A similar issue was discussed in the ASPxGridView - How to select multiple rows with a mouse click without pressing the 'Ctrl' key thread. I hope that you find this information helpful.
More references:
ASPxGridView - How to implement select/unselect for all rows in a group row using multiple grouping
How to select data rows and group rows in multiple grouping.
ASPxGridView - AllowSelectByRowClick MultiSelect without holding Ctrl key.
ASPxGridView - Unable to select multiple rows by row click when AllowSelectByRowClick="True"
I have a matrix report in SSRS 2005, and the rows have certain sections. Imagine along the left a series of
1 $100
2 $400
3 $150
4 $650
5 $500
6 $400
7 $900
And I want some rows to be able to be hidden. For example, row 7 are totals of row 5 and 6, so I'd want to +/- next to row 7 that will show/hide rows 5 and 6. (Note that I don't calculate these totals, they were done by an accountant and it is important that I use the values in the database and don't calculate the totals myself.)
Now I have this "parent/child" relationship in the database, and I could add that as a group on the row
4 1 $100
4 2 $400
4 3 $150
- 4 4 $650
7 5 $500
7 6 $400
- 7 7 $900
And then I could add the toggle to that first column, BUT I don't want the values to be subtotaled when they are rolled up. I simply want rows 5/6 to disappear and only show row 7. Kind of new to SSRS so any suggestions would be great.
So with one group toggled:
+ 4 4 $650
7 5 $500
7 6 $400
- 7 7 $900
Other gorup toggled:
+ 4 4 $650
+ 7 7 $900
Etc.
4 1 $100
4 2 $400
4 3 $150
- 4 4 $650
+ 7 7 $900
How can I accomplish this such that I am not recalculating the parent rows(rows 4 and 7 in this example)?
If there is a free web control that can accomplish this in ASP.NET I'd be glad to hear about it as well. I have a sinking feeling that I'm going to have to write some AJAX myself to accomplish this. I kind of wondered if there was some hack to embed some javascript into the report that could accomplish this.
Effectively you have two problems:
Report subtotals that come from the database, not calculated
Dynamically hide and expose detail rows
You can do this with a standard table report, as follows:
Report database subtotals
You can do this in plain SQL (D is the Detail table and G is the Group table):
SELECT D.ParentId, D.ChildId,
D.Description as DetailDescription, D.Amount AS DetailAmount,
G.GroupDescription, G.GroupAmount
FROM MyTable D INNER JOIN
(SELECT ChildId AS GroupId, Max(Description) as GroupDescription, MAX(Amount) AS GroupAmount
FROM MyTable
GROUP BY ChildId
WHERE ChildId IN (SELECT DISTINCT ParentId FROM MyTable)) G ON GroupId = D.ParentId
WHERE D.ChildId NOT IN (SELECT DISTINCT ParentId FROM MyTable)
So what we are doing is getting all the rows which aren't subtotals (that is, the rows where the ChildId is not a ParentId) and in the nested select we are also putting the subtotal on every detail line. Now, in the Group on the table, we can simply report the GroupTotal field from our dataset rather than an actual subtotal.
Dynamically hide and expose rows
Create a group in your table. Here is where you report the GroupTotal just as a field, not as a total (although you could MAX or MIN it if you wanted to).
Right-click the detail group and click Edit. On the Visibility tab, check the Visibility can be toggled by another report item checkbox and select the textbox name of the first textbox of the group above. Set the Initial Visibility to either Visible or Hidden as required.
Off the top of my head and untested but you should get the idea.
Edit to explain layout better (Note: SQL above also edited to show descriptions)
I'm working with a table here, not a matrix.
Layout would look like as follows (first column shows what group you are on):
Table Header Parent Id Child Id Description Amount
Group1 Header =Fields!ParentId.Value =Last(Fields!GroupDescription.Value) =Max(Fields!GroupAmount.Value)
Details Group =Fields!ParentId.Value =Fields!ChildId.Value =Fields!DetailDescription.Value =Fields!DetailAmount.Value
Group1 is set to Group on ParentId, only the header is displayed (no footer) and the ParentId Textbox on that group is called ParentIdGroup. Details Group has "Visibility can be toggled by another item" checked and "Report item" is set to ParentIdGroup.
I have mocked up this report now and it works as you describe - what looks like subtotals are actually database fields and the description shows on the group row.
I was able to accomplish this by setting the expression for the data field value to Last, since in my case the subtotals are always the last row of the series of rows. Whenever the rows are expanded, then Last displays the value for each row, since each row is it's own group. And then whenever I collapse using the PatenLineNumber toggle, then the Last shows the value of that parent row, since it appears as the last row in the group.
So my matrix report is something like this:
Amount
ParentLineNumber ChildLineNumber =Last(Fields!Amount.Value)
I am still having a seperate issue, but that is a seperate question.
I am using Devexpress XtraGrid Control, Here I can count the number of rows in footer of grid. but for this I need to set count property of SummeryItem in grid for at least one column. I dont want to do like this.
I want count number of rows in xtraGrid without referring any one column in grid. I just want to show number of rows count. when user will filter that rows, at that time count also need to be changed.
Is there any option to show this number in Group header panel?
I'd use BaseView.RowCount to get the row count and draw it within CustomDrawGroupPanel event.
You can use the customsummarycalculate event to count the number of rows currently shown in the filtered collection and display it in the summary area (generally, I put that text in the summary area of the ID field for the collection I'm using - as I never have a need to put anything else there).
I don't know if this is an update but:
int i = view.SelectedRowsCount;