Is the following possible using either the WebGrid or HierarchicalWebGrid? I am currently using the WebGrid to convert a aged application.
I have two questions, refer to the attached imaged (heavily redacted) for the questions.
A in attached image - Is it possible to have sections (or perhaps groups) of rows split by a data element in the associated data set, but not displayed directly on the grid itself? Ideally controlled programmatically. (In the image, the All Searches drop down will list individual names or All Searches ... where All Searches displays the names separated by lines. (This one isn't as critical if its not possible. I may be able to convince the users to give up on the "All Searches" option if its not possible.)
B in the attached image - and more important for the rewrite - is it possible, on a record by record basis, to display additional information in the data set "spanning" the record, since it will normally be lengthy text? Highlighting is more optional as long as there is a good way to display the data. Notice that none of the other rows have this additional data, just the one to which there is data to display.
C (perhaps should be a separate topic/post, but related) - What displays in the grid is driven by the radio button selection and Reports Found drop down selection at the top of the image. This works perfectly when editing is not allowed. This also works perfectly when editing is allowed (last 3 columns), and the user moves between pages (when available) of the current selection the data saves correctly.
However, if a user edits a record, and then either changes the section (radio button change) or search (Reports Found change) which would be common practice for the user, a "MissingRecordException: Requested record cannot be found by key" error occurs. I'm fairly certain the reason is the grid is being rebound to use the newly selected values ... before the actual update of the changed record occurs. The data bind is necessary to get the grid to change on selection. I don't see a way to "force" the update of the data.
Hi Brian,
Here are the answers:
A: You can achieve this option by using the WHDG and its GroupBy Feature. You can see a sample here: http://es.infragistics.com/products/aspnet/sample/hierarchical-data-grid/groupby-from-code-behind
B: There is no way to get this by default. What you can do is use WHDG can have the child level band have just one column with that long text (give it special css so the row is gray, ect). You can set the ShowHeader property to false for that Band so you don't get a column header for that column and always have that level expanded so that special row will always be visible.
C: What you need to do here if when the radio button/dorpdown changes value, store what you want the new datasource to be in a variable and do not rebind the grid. Handle the RowUpdated server even for the grid, in this even check on your variable and if it is set then give the grid the new datasource. This will allow the grid to process the update before the datasource changes.
Thanks,
Olga
ASP.NET Principal Software Engineer
Infragistics, Inc.
This gives me direction. I cannot try it immediately. It looks like I will have to redo the grid to use the hierarichal version, then try what is described in A.
I'm not sure if B can only display for those rows which have data .. we don't want empty row bands if there is no data to display, so some lines may have data, but most wont.
I'm still trying to wrap my head around C. Perhaps someone here with more ASP knowledge can assist me.
Thanks for the feedback. Now to find time to try to implement.