hi,
in nested data grid for the second gridview i have an button where i am performing expand/collpase
for the datagrid 1 the below event works fine
private void btn1_Click(object sender, RoutedEventArgs e)
{
try
{
Button btnExpandCollapse = sender as Button;
Image imgScore = (Image)btnExpandCollapse.FindName("imgLevel1");
DependencyObject dep = (DependencyObject)e.OriginalSource;
while ((dep != null) && !(dep is GridViewRow ))
{
dep = VisualTreeHelper.GetParent(dep);
}
// if we found the clicked row
if (dep != null && dep is GridViewRow)
{
// get the row
GridViewRow row = (GridViewRow)dep;
if (row.DetailsVisibility == Visibility.Visible)
{
imgScore.Source = new BitmapImage(new Uri("/Images/left_side.png", UriKind.Relative));
row.DetailsVisibility = Visibility.Collapsed;
}
else
{
imgScore.Source = new BitmapImage(new Uri("/Images/down_side.png", UriKind.Relative));
row.DetailsVisibility = Visibility.Visible;
}
}
}
catch (Exception ex)
{
throw ex;
}
}
for the second datagrid i have an same function as above with different name i am getting exception at this line.
if (row.DetailsVisibility == Visibility.Visible)
{
row.DetailsVisibility = Visibility.Collapsed;
}
else
{
row.DetailsVisibility = Visibility.Visible;
// getting exception at this line.
Failed to create a 'System.Windows.Style' from the text 'None'.
}
any solution on this would be greatly appreciated.
thanks
kumar