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

Traversing through child table in GDBC

Hi I am using griddataboundgrid with two hierarchial level.(QueryThread,Query) I want to search for a string in one column of child table and when I found it I want to highlight it. How can I do that? Umangi

5 Replies

AD Administrator Syncfusion Team July 23, 2004 12:57 PM UTC

The GridDataBoundGrid has no knowledge of child tables unless they are expanded. So, if you want to find something in the child table, you should iterate through the whole childtable directly (or use DataView.Find if you have things set up so that that will work). Once you find the item in the whole child table, then you can look up its parent, and then find that parent row in the parent grid. Once you have the parent row, you can expand it and then get the GridBoundRecordState (using grid.Binder.GetRecordStateAtRowIndex). This recordstate object will have a the specific child table for this parent so that you can then search this specific child table to find the child item you are looking for. Once you have the index of the child item in its specific table, you can add this to the row index of the parent to locate the grid row of the child item.


UM Umangi July 23, 2004 02:44 PM UTC

If I call expandall(), How can I get the table at hierarchy level 1. Umangi >The GridDataBoundGrid has no knowledge of child tables unless they are expanded. So, if you want to find something in the child table, you should iterate through the whole childtable directly (or use DataView.Find if you have things set up so that that will work). > >Once you find the item in the whole child table, then you can look up its parent, and then find that parent row in the parent grid. Once you have the parent row, you can expand it and then get the GridBoundRecordState (using grid.Binder.GetRecordStateAtRowIndex). This recordstate object will have a the specific child table for this parent so that you can then search this specific child table to find the child item you are looking for. Once you have the index of the child item in its specific table, you can add this to the row index of the parent to locate the grid row of the child item.


AD Administrator Syncfusion Team July 23, 2004 02:54 PM UTC

You do not have a reference to the parent table for your relation? You would not need the grid for that. If you want to iterate through the grid, you would have to get the GridBoundRecordState (using grid.Binder.GetBoundRecordStateAtRowIndex) for each row, and test the LevelIndex member to find out the hierarchy level of a particular row.


UM Umangi July 23, 2004 03:34 PM UTC

I have used DataViewManager class to bind to grid. From that I can not get child table back. As I have applied RowFilter on Parent table. Things r very complicated now. Will using GridGroupingControl make things easier for me?


AD Administrator Syncfusion Team July 23, 2004 08:23 PM UTC

Here is a little sample that finds a string in the child level of the current column. FindSample_8302.zip

Loader.
Up arrow icon