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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Traversing through child table in GDBC

Thread ID:

Created:

Updated:

Platform:

Replies:

16782 Jul 23,2004 12:47 PM UTC Jul 23,2004 08:23 PM UTC Windows Forms 5
loading
Tags: GridControl
Umangi
Asked On July 23, 2004 12:47 PM UTC

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

Administrator [Syncfusion]
Replied On 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.

Umangi
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

Umangi
Replied On 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?

Administrator [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;