[英]How to remove grouping at runtime of DevExpress GridControl in WPF from code behind?
I have a GridControl which is binded by List using Entity. 我有一个GridControl,它由List使用Entity绑定。 I am applying Grouping to Grid at runtime.
我正在运行时将Grouping应用于Grid。 I want to Remove/change grouping column at runtime from code behind is it possible in wpf?
我想在运行时从代码中删除/更改分组列是否可以在wpf中?
<dxg:GridControl Name="grdInfill" Height="700" VerticalAlignment="Top" >
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="GlassType" AllowEditing="False" />
<dxg:GridColumn FieldName="GlassDescription" GroupValueTemplate="{StaticResource descriptionHeader}">
<!--GroupValueTemplate="{StaticResource descriptionHeader}"-->
<!--Header="GlassDescription" DisplayMemberBinding="{Binding Path=RowData.Row.GlassDescription, Mode=TwoWay}"-->
</dxg:GridColumn>
<dxg:GridColumn FieldName="GlassType" AllowEditing="False" />
<dxg:GridColumn Name="qty" Header="Quantity" AllowEditing="False" DisplayMemberBinding="{Binding Path=RowData.Row.Quantity, Mode=TwoWay}" /> <!--FieldName="Quantity"-->
<dxg:GridColumn FieldName="Width" AllowEditing="False" Header="Length"/>
<dxg:GridColumn FieldName="Height" AllowEditing="False"/>
<dxg:GridColumn FieldName="Elevation" AllowEditing="False"/>
<dxg:GridColumn FieldName="Mark" AllowEditing="False"/>
<dxg:GridColumn FieldName="GlassTag" AllowEditing="False"/>
<dxg:GridColumn FieldName="WallLocation" AllowEditing="False"/>
<dxg:GridColumn FieldName="SquareFoot" AllowEditing="False"/>
<dxg:GridColumn FieldName="Weight" AllowEditing="False"/>
<dxg:GridColumn FieldName="UnitCost" AllowEditing="False"/>
<dxg:GridColumn FieldName="TotalCost" AllowEditing="False"/>
<dxg:GridColumn FieldName="FuelSurcharge" AllowEditing="False"/>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView ShowTotalSummary="True" AutoWidth="True" DetailHeaderContent="True" ShowIndicator="False" ShowGroupPanel="False"><!--GroupRowTemplate="{StaticResource descriptionHeader}"-->
</dxg:TableView>
</dxg:GridControl.View>
</dxg:GridControl>
protected void GetAllInfills()
{
List<Infill> infillList = new List<Infill>();
infillList=BLL.GetAllInfills();
if (infillList != null)
{
grdInfill.ItemsSource = infillList;
grdInfill.GroupBy(grdInfill.Columns["GlassType"], ColumnSortOrder.Ascending);
grdInfill.GroupBy(grdInfill.Columns["GlassDescription"], ColumnSortOrder.Ascending);
grdInfill.AutoExpandAllGroups = true;
}
}
Now Clicking on Button i want to remove or change the grouping in WPF from code behind? 现在点击按钮我想删除或更改WPF中的代码从后面的代码?
To ungroup data by the values of a single column, do one of the following: 要按单列的值取消组合数据,请执行以下操作之一:
To ungroup the grid, use the GridControl.ClearGrouping method. 要取消组合网格,请使用GridControl.ClearGrouping方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.