We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridDataBound: Selection issue.

Hello. I have DataBoundGrid control on the form. There are some records with related records. I can select some records both from parent and related. But when I go to some parent record and expand it, selection jump to currently expanding record. I want the selection not missing. Is it possible ? Thanks.

4 Replies

AD Administrator Syncfusion Team July 6, 2004 11:59 AM UTC

I do not see this problem in this sample. I can select parent rows and child rows, and then expand another node without the selections changing. What are you doing differently? ExpandSample_6372.zip

AD Administrator Syncfusion Team July 7, 2004 12:42 AM UTC

The difference is in ListBoxSelectionMode property. I need the behavior like MultiSelected mode. in this mode, selections dissapeared when I press collapse button :(

AD Administrator Syncfusion Team July 7, 2004 12:50 AM UTC

By the way, does selection work same way in virtual mode of grid ?

AD Administrator Syncfusion Team July 7, 2004 05:53 AM UTC

If you want your selections of child rows to persist across collapsing and expanding parent rows, then you will have to do this yourself. You can handle the RowsCollapsing event, and there, save the selected child rows in some way (Maybe a hashtable where teh key is the primary id value of the parent row and the value is a array of positions in the child table of the selected rows.) Then can handle the RowsExpanded event and check the hashtable for the parent primary id, and reselect the positions stored in the hashtable. It would take a little code to do, but I think it is doable. The slections behave essentailly the same in a GridControl as in a GridDataBoundGrid. A virtual grid is a GridControl.

Live Chat Icon For mobile
Up arrow icon