Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
230
Multiple lines for data row display and section breaks
posted

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.

Parents
No Data
Reply
  • 2783
    posted

    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://ko.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.

     

Children