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

Geting event on selection in hierarcial Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

6856 Sep 2,2003 07:24 AM UTC Sep 4,2003 02:22 PM UTC Windows Forms 6
loading
Tags: GridControl
Asaf Segal
Asked On September 2, 2003 07:24 AM UTC

I created a grid with two heirarchy levels. I want to be notified of row selection. I could not find and event that is activated on selection of rows that are not in the root level. Is there any thing to do ? Asaf

Administrator [Syncfusion]
Replied On September 2, 2003 08:21 AM UTC

You can use the grid.RowEnter event which should be fired anytime the current row changes (whether it is to a different level of not). In it, you can use the e.RowIndex to get the GridBoundRecordState for the row. From the GridBoundRecordState, you can get its level (as well as other properties of interest). Dim rs As GridBoundRecordState = Me.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex) Dim level As Integer = rs.LevelIndex

Asaf Segal
Replied On September 4, 2003 12:43 AM UTC

In my test it worked only for the root level, did I do something wrong ?

Administrator [Syncfusion]
Replied On September 4, 2003 06:57 AM UTC

It seems to work in the attached sample. Now, the grid only knows data when the parent node is expanded. So, you cannot get information from the grid on any row that is not expanded. But the above code should worked for any row that you can see in the grid.

Administrator [Syncfusion]
Replied On September 4, 2003 06:58 AM UTC

Forgot to attached the sample.

Asaf Segal
Replied On September 4, 2003 09:32 AM UTC

Thanks for the sample, but it is not what I really need. The attached sample is not registered to grid.RowEnter. What I need is to get the row enter event when I click on a row the is not in the root level.

Administrator [Syncfusion]
Replied On September 4, 2003 02:22 PM UTC

In the sample, adding this rowenter event identified parent level and child levels for me.
private void gridDataBoundGrid1_RowEnter(object sender, GridRowEventArgs e)
{
	GridBoundRecordState rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex);
	if(rs.LevelIndex > 0)
		Console.WriteLine("child level");
	else
		Console.WriteLine("root level");
}

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

;