hi,
i am developing an nested RadGrid . in my first column i have place an button . so that once user clicks on that button i need to call the RowDetailsVisibilityChanged event
so that i can get the row unquie keyID there based on that i will be retrieving further records from the DB.
the below code shows how i used to do in microsoft silverlight 4. the same concept i need to archive in telerik control
i tried chaging RowDetailsVisibilityMode ="Collapsed", VisibleWhenSelected, Visible in xaml but still i am not able to able the
RowDetailsVisibilityChanged event
here i am using for four RadGrid placed inside each other. this is the concept i am using to achive.
<telerik:RadGridView.RowDetailsTemplate>
<DataTemplate>
// here i am placing my second datagrid.
</DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>
</DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>
private void ExpandLevel1_Click(object sender, RoutedEventArgs e)
{
try
{
Button btnExpandCollapse = sender as Button;
Image imgScore = (Image)btnExpandCollapse.FindName("img1");
// the original source is what was clicked. For example
// a button.
DependencyObject dep = (DependencyObject)e.OriginalSource;
// iteratively traverse the visual tree upwards looking for
// the clicked row.
while ((dep != null) && !(dep is DataGridRow))
{
dep = VisualTreeHelper.GetParent(dep);
}
// if we found the clicked row
if (dep != null && dep is DataGridRow)
{
// get the row
DataGridRow row = (DataGridRow)dep;
// change the details visibility
if (row.DetailsVisibility == Visibility.Visible)
{
imgScore.Source = new BitmapImage(new Uri("/Images/la1.png", UriKind.Relative));
row.DetailsVisibility = Visibility.Collapsed;
}
else
{
imgScore.Source = new BitmapImage(new Uri("/Images/a2.png", UriKind.Relative));
row.DetailsVisibility = Visibility.Visible;
}
}
}
catch (Exception ex)
{
throw ex;
}
}
now. once user clicks the button i need to call the RowDetailsVisibilityChanged event which is not happening and
also perform expand/ collpase operation clicking on the button
any help how to achive this would be greatly appreciated.
thanks
kumar
i am developing an nested RadGrid . in my first column i have place an button . so that once user clicks on that button i need to call the RowDetailsVisibilityChanged event
so that i can get the row unquie keyID there based on that i will be retrieving further records from the DB.
the below code shows how i used to do in microsoft silverlight 4. the same concept i need to archive in telerik control
i tried chaging RowDetailsVisibilityMode ="Collapsed", VisibleWhenSelected, Visible in xaml but still i am not able to able the
RowDetailsVisibilityChanged event
here i am using for four RadGrid placed inside each other. this is the concept i am using to achive.
<telerik:RadGridView.RowDetailsTemplate>
<DataTemplate>
// here i am placing my second datagrid.
</DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>
</DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>
private void ExpandLevel1_Click(object sender, RoutedEventArgs e)
{
try
{
Button btnExpandCollapse = sender as Button;
Image imgScore = (Image)btnExpandCollapse.FindName("img1");
// the original source is what was clicked. For example
// a button.
DependencyObject dep = (DependencyObject)e.OriginalSource;
// iteratively traverse the visual tree upwards looking for
// the clicked row.
while ((dep != null) && !(dep is DataGridRow))
{
dep = VisualTreeHelper.GetParent(dep);
}
// if we found the clicked row
if (dep != null && dep is DataGridRow)
{
// get the row
DataGridRow row = (DataGridRow)dep;
// change the details visibility
if (row.DetailsVisibility == Visibility.Visible)
{
imgScore.Source = new BitmapImage(new Uri("/Images/la1.png", UriKind.Relative));
row.DetailsVisibility = Visibility.Collapsed;
}
else
{
imgScore.Source = new BitmapImage(new Uri("/Images/a2.png", UriKind.Relative));
row.DetailsVisibility = Visibility.Visible;
}
}
}
catch (Exception ex)
{
throw ex;
}
}
now. once user clicks the button i need to call the RowDetailsVisibilityChanged event which is not happening and
also perform expand/ collpase operation clicking on the button
any help how to achive this would be greatly appreciated.
thanks
kumar