我正在使用SyncFusion GridDataControl来显示一些数据。
网格中的行在一列上分组(比如列Group)。
当列Group具有特定值(即null或"")时,我不希望使用组,这样行将始终显示,并且不能折叠。
有没有人知道该怎么做?
到目前为止,我已经连接到了GridDataControl上的Loaded事件
private void OnGridLoaded(object sender, RoutedEventArgs e)
{
foreach ( Group group in AttributeGrid.Model.View.Groups)
{
if (@group.Key == null)
{
AttributeGrid.Model.Table.ExpandGroup(@group);
// Do something here to hide the group?
}
}
}发布于 2012-11-29 15:37:50
请在下面找到更新,
//Use the below code to Expand the particular group based on the key
void AssociatedObject_Loaded(object sender, RoutedEventArgs e)
{
foreach (Group group in this.AssociatedObject.Model.View.Groups)
{
if (group.Key.Equals(1))
this.AssociatedObject.Model.Table.ExpandGroup(group);
}
}对于运行时的折叠组,
//Use the below code to cancel the Grouping for particular group based on the keu
void Table_GroupCollapsing(object sender, GroupCollapsingEventArgs args)
{
if (args.Group.Key.Equals(1))
args.Cancel = true;
}https://stackoverflow.com/questions/13051473
复制相似问题