This is a migrated thread and some comments may be shown as answers.

Select third level ROW after binding Hierarchy grid

7 Answers 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 1
Ajay asked on 08 Mar 2010, 01:57 PM
Hi

I have a Hierarchy grid which have child gris upto third level Hierarchy.
I need to show the selected row in third level child grid, after binding the grid.
currently when i am trying to select the third or second child hierarchy grid , first row of the top most hierarchy gets selected.

Any one Please suggest the solution with sample code .

Thanks
Ajay

7 Answers, 1 is accepted

Sort by
0
Sonny Chouinard
Top achievements
Rank 1
answered on 08 Mar 2010, 10:32 PM
Here is an example. I hope this can help you

   Private Sub RadGridView1_MouseDown(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs) Handles RadGridView1.MouseDown 
        Dim strValue As String = "" 
 
        If Not IsNothing(RadGridView1.CurrentRow.ViewInfo.ParentRow) Then 
            strValue = "Parent row: " & RadGridView1.CurrentRow.ViewInfo.ParentRow.ViewInfo.CurrentIndex.ToString & Environment.NewLine 
        End If 
 
        strValue &= "Current row: " & RadGridView1.CurrentRow.ViewInfo.CurrentIndex.ToString 
        MessageBox.Show(strValue) 
End Sub 
 


0
Ajay
Top achievements
Rank 1
answered on 09 Mar 2010, 05:45 AM
Hi Jonathan

Thanks for the reply , But i am looking for selecting the third level grid's row through the code.
Currently when i am trying to show a row in third level in hierarchy as selected and highlighted,
first row of grid gets selected.

To demonstrate exact requirement i am attaching  a file.

Thanks
Ajay Yadav


0
Jack
Telerik team
answered on 09 Mar 2010, 08:42 AM
Hello Ajay,

In this case, you should expand the child view and set it as current view. After that, you can set any row from the child view as current. Please consider the code snippet below:

this.radGridView1.Rows[1].IsExpanded = true;
Application.DoEvents();
this.radGridView1.CurrentView = this.radGridView1.Rows[1].ChildRow.ChildViewInfo.GridViewElement;
this.radGridView1.Rows[1].ChildRow.ChildViewInfo.Rows[0].IsCurrent = true;

I hope this helps.

Greetings,

Jack
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ajay
Top achievements
Rank 1
answered on 09 Mar 2010, 10:08 AM
Hi Jack

Thanks for the reply. But when i am trying to assign the this.gvCustomer.CurrentView = gvCustomer.Rows[CurrentCustRow].ChildRow.ChildViewInfo.GridViewElement;

I am getting compilation error that  this.gvCustomer.CurrentView it is readonly property.
My telerik version is "2009.1.9.414".

Please suggest me any working work around .

Please see the attached image.

Thanks
Ajay Yadav
                              




0
Jack
Telerik team
answered on 09 Mar 2010, 10:30 AM
Hi Ajay,

Setting this property is available in our latest release - Q3 2009 SP1. I recommend that you try this version. It addresses a lot of issues and contains some interesting new features.

Kind regards,
Jack
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ajay
Top achievements
Rank 1
answered on 09 Mar 2010, 10:38 AM
Hi Jack

I can not upgrade to the latest version. Please provide me any work around which works for me on my version "2009.1.9.414".
I will be a great help .

Thanks
Ajay


0
Nikolay
Telerik team
answered on 09 Mar 2010, 03:14 PM
Hi Ajay,

Thank you for getting back to us.

Although we tried several approaches to work around the faulty behavior, we are sorry to inform you that there is no workaround available. Please accept our apologies for not being able to help you at this time.

Best wishes,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Ajay
Top achievements
Rank 1
Answers by
Sonny Chouinard
Top achievements
Rank 1
Ajay
Top achievements
Rank 1
Jack
Telerik team
Nikolay
Telerik team
Share this question
or