我在CheckBox
中有一个Column
未绑定的GridControl
。现在,它希望在Selected/Checked
中获取Row
Grid
WPF
控件,并将这些行插入另一个表格中。
XAML
<dxg:GridControl Name="grdInfill" Height="700" VerticalAlignment="Center">
<dxg:GridControl.Columns>
<dxg:GridColumn AllowEditing="True" FieldName="Dummy">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<CheckBox Name="chkSelect" HorizontalAlignment="Center" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataContext.RowData.Row.GlassType}" Checked="CheckEdit_Checked" Unchecked="CheckEdit_Unchecked" />
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
<dxg:GridColumn FieldName="GlassType" AllowEditing="False">
</dxg:GridColumn>
<dxg:GridControl.View>
<dxg:TableView Name="grdInfillInner" ShowTotalSummary="True" AutoWidth="True" DetailHeaderContent="True" ShowIndicator="False" ShowGroupPanel="False" CellValueChanging="grdInfillInner_CellValueChanging"><!--GroupRowTemplate="{StaticResource descriptionHeader}"-->
</dxg:TableView>
</dxg:GridControl.View>
</dxg:GridControl>
Code
protected void GetAllInfills()
{
List<Infill> infillList = new List<Infill>();
infillList=BLL.GetAllInfills();
if (infillList != null)
{
grdInfill.ItemsSource = infillList;
grdInfill.GroupBy(grdInfill.Columns["Glass.GlassType"], ColumnSortOrder.Ascending);
grdInfill.GroupBy(grdInfill.Columns["Glass.Glass_Description"], ColumnSortOrder.Ascending);
grdInfill.AutoExpandAllGroups = true;
}
}
如何在按钮上获取Seleted Row值!