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>
Hello Donna,
I believe Tacho has already answered your question here:
http://es.infragistics.com/community/forums/t/104446.aspx
Hi Stefan, can you please help on my problem?
I have 2 xamdatagrid and both have unboundfields with checkboxes. The result that I want is when I checked the row in datagrid 1, the selected row will be added into datagrid 2. Then the checkbox of that row in datagrid 1 is disabled. Inversely, when checkbox in datagrid 2 is checked, the checked row will be removed from the list and checkbox of this selection in datagrid 1 will be enabled.
Please provide me with sample. Thanks so much.
Hello David,
Thank you for your post. I have been looking into and I created a sample project for you with the functionality you want. Basically I added a filter to the second XamDataGrid, so it will show only the Records which are ticked. Also I made the Updating external, so when a button is clicked the changes will be saved.
Hope this helps you.