Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Get selected checkboxes rows in a xamDataGrid
posted

I am using .Net 3.5.

I have a xamDataGrid2 which is dynamically populated using a DataTable. The DataTable has a column called "Select" which is of bool type and value is 0 for all the rows.

The thing I want is when the user check on the checkboxes of some rows and click the "Add" button, the selected rows will be passed to another xamDataGrid1.

c# code

DataTable DT2 = new DataTable("item"); 

DT2.Columns.Add("Select", typeof(bool));

DT2.Columns.Add("ID", typeof(int)); 

DT2.Columns.Add("ItemCode", typeof(string)); 

this.xamDataGrid2.DataSource = DT2.DefaultView;


xaml code

<igDP:XamDataGrid x:Name="xamDataGrid2" Visibility="Hidden" BindToSampleData="False" Theme="Generic" BorderThickness="0,0,0,0" AutoFit="False" igThemes:ResourceWasher.IsExcludedFromWash="False" CellContainerGenerationMode="Recycle" Panel.ZIndex="0" ScrollingMode="Immediate" Margin="-2,160.84,13,115" >
<igDP:XamDataGrid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF858585" Offset="1" />
<GradientStop Color="#FFFFFFFF" Offset="0" />
</LinearGradientBrush>
</igDP:XamDataGrid.Background>
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings AllowRecordFiltering="True" SummaryDisplayArea="BottomFixed" SummaryUIType="MultiSelect" AllowSummaries="True" LabelTextAlignment="Left" />
</igDP:XamDataGrid.FieldSettings>

<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings HighlightAlternateRecords="True" AllowAddNew="False" AllowDelete="False" AddNewRecordLocation="OnTopFixed" AutoGenerateFields="True" AllowFieldMoving="WithinLogicalRow" AllowRecordFixing="Top" FixedFieldUIType="Default" HeaderPrefixAreaDisplayMode="FieldChooserButton" AllowClipboardOperations="Copy" CopyFieldLabelsToClipboard="True" />
</igDP:XamDataGrid.FieldLayoutSettings>

<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:Field Name="Select" Label="Select">
<igDP:Field.Settings>
<igDP:FieldSettings />
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="ItemID" Label="Item ID">
<igDP:Field.Settings>
<igDP:FieldSettings AllowEdit="False" />
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="ItemCode" Label="Item Code">
<igDP:Field.Settings>
<igDP:FieldSettings AllowEdit="False" />
</igDP:Field.Settings>
</igDP:Field>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>