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

[Solved] RadGridView IsExpandableRecord

1 Answer 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Luca Mazzi
Top achievements
Rank 2
Luca Mazzi asked on 20 Oct 2009, 03:02 PM
Hi all,
I'm using RadGridView Q2 version and I need to catch the moment when a user click on a "plus" simbol on a row that has the flag

IsExpandableRecord set to true.
Does anybody know which is the event ?
If there is an event, is it fired also if the "GridViewTableDefinition" of the row is empty ?
Where can I find an example about this ?

Thanks in advance for your suggestions.

Regards

 

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 22 Oct 2009, 11:03 AM
Hi Luca Mazzi,

There is no such event but you can find the toggle button of each row and subcribe to its Clicked, Unchecked, or Checked event. If you would like to be notified when an  expanded row it being closed you should subscribe to the Unchecked event. Here some sample code:

// required namespace: Telerik.Windows.Controls;
public Window1()
{
    InitializeComponent();
  
    this.playersGrid.RowLoaded += new System.EventHandler<RowLoadedEventArgs>(playersGrid_RowLoaded);
}
  
void playersGrid_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
{
    GridViewExpandableRow row = e.Row as GridViewExpandableRow;
  
    if(row == null)
        return;
  
   var expandButton = row.ChildrenOfType<ToggleButton>().FirstOrDefault();
  
   if (expandButton != null)
       expandButton.Unchecked += new RoutedEventHandler(expandButton_Unchecked);
}
  
void expandButton_Unchecked(object sender, RoutedEventArgs e)
{
    var parentRow = ((FrameworkElement)sender).ParentOfType<GridViewExpandableRow>();
}



Best wishes,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Luca Mazzi
Top achievements
Rank 2
Answers by
Milan
Telerik team
Share this question
or