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

How to identify whether current row is group header

2 Answers 399 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 12 Jul 2012, 03:34 AM
Hi all,

I use grouping in my grid view. What I want to achieve is when the user changes the current row by clicking or pressing up/down arrow the grid view will show the information about the current row using text boxes but if the current row is a group header the grid view won't perform any action.

Is there any way to identify that the current row is a group header so that I can achieve this scenario? 

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 13 Jul 2012, 02:38 PM
Hi David,

Yes, you can achieve your scenario. You should handle the CurrentRowChanged event and then check the type of the current row. If the type of the row is GridViewGroupRowInfo, you can skip your implementation that shows the information in the text boxes:

void radGridView1_CurrentRowChanged(object sender, Telerik.WinControls.UI.CurrentRowChangedEventArgs e)
{
    if (e.CurrentRow is GridViewGroupRowInfo)
    {
        return;
    }
 
    // your textbox implementation here
}

I hope this helps.

Kind regards,
Nikolay
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
David
Top achievements
Rank 1
answered on 16 Jul 2012, 09:08 AM
Great! It works..

Thanks for the solution =)
Tags
GridView
Asked by
David
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
David
Top achievements
Rank 1
Share this question
or