e.DetailsElement in silverlight
is there any way i can write this code in a function() right now what is happening in function is
it tells e.Row.DetailsVisibility e.DetailsElement.ActualHeight it is not able to find this it is telling is there any way i can get this e.DetailsElement.ActualHeightif (e.Row.DetailsVisibility == Visibility.Visible)
{
Dispatcher.BeginInvoke(() =>
{
DataGrid datagrid = sender as DataGrid;
if (datagrid != null)
{
datagrid.Tag = e.DetailsElement.ActualHeight;
datagrid.Height = datagrid.ActualHeight + e.DetailsElement.ActualHeight;
}
}
);
}
else
{
DataGrid datagrid = sender as DataGrid;
if(datagrid.Tag!=null)
datagrid.Height = datagrid.ActualHeight - System.Convert.ToDoubl开发者_StackOverflow社区e(datagrid.Tag);
}
}
Having in mind that you explanation is not very clear, what's the problem to put that code in a function as follows:
public void yourFunction(object sender, theTypeOfArguments e )
{
if (e.Row.DetailsVisibility == Visibility.Visible)
{
Dispatcher.BeginInvoke(() =>
{
DataGrid datagrid = sender as DataGrid;
if (datagrid != null)
{
datagrid.Tag = e.DetailsElement.ActualHeight;
datagrid.Height = datagrid.ActualHeight + e.DetailsElement.ActualHeight;
}
}
);
}
else
{
DataGrid datagrid = sender as DataGrid;
if(datagrid.Tag!=null)
datagrid.Height = datagrid.ActualHeight - System.Convert.ToDouble(datagrid.Tag);
}
}
If that's not your question please give more clarifications.
精彩评论