how to add checked items in checkedlistbox to ultrawingrid programmatically and delete the row same on uncheck?
private void lstManagers_ItemSelectionChanged(object sender, ItemSelectionChangedEventArgs e) {
classData Service = new cAssetsData(); DataTable dt = Service.Method((int)e.SelectedItems[0].Tag); this.ultrawingrid1.DataSource = dt; for (int i = 0; i < checkedlistbox1.Items.Count; i++) { dt.Rows.Add(checkedlistbox1.Items[i]); }
}
private void checkedlistbox1_ItemSelectionChanged(object sender, ItemSelectionChangedEventArgs e){
classData Service = new cAssetsData();DataTable dt = Service.Method((int)e.SelectedItems[0].Tag);this.ultrawingrid1.DataSource = dt;for (int i = 0; i < checkedlistbox1.Items.Count; i++){dt.Rows.Add(checkedlistbox1.Items[i]);}
Hello Rohan,
You could use the ItemCheck event of the CheckedListBox in order to achieve the desired by you functionality. When the checked state of an item is changed that event fires and if the state is “Checked” you could add that item into the DataTable the same logic is also valid if the state becomes “Unchecked” you could remove the item from the DataTable. As the UltraGrid and the DataTable are connected each modification of the DataTable will be visualized into the UltraGrid.
I have implemented that suggestion in a simple sample and you could run and evaluate it. Please see attached zip.
Please do not hesitate to contact me if you have any additional questions.
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this matter?
Thank you for using Infragistics Components.
UltraListView gives your ability to use ItemCheckStateChnaged if you need to check when item state was changed or ItemCheckStateChnaging – before item check state was changed. More information about the events you will find on the following links:
http://help.infragistics.com/doc/WinForms/2014.2/CLR4.0/?page=Infragistics4.Win.UltraWinListView.v14.2~Infragistics.Win.UltraWinListView.UltraListView~ItemCheckStateChanged_EV.html
http://help.infragistics.com/doc/WinForms/2014.2/CLR4.0/?page=Infragistics4.Win.UltraWinListView.v14.2~Infragistics.Win.UltraWinListView.UltraListView~ItemCheckStateChanging_EV.html
I hope that this will helps you.
I can't find ItemCheck event in infragistics equivalent of checkedlistbox i.e (Infragistics.Win.UltraWinListView.UltraListViewStyle.List;),,Which event is equivalent to the ItemCheck event in infragistics ?
Thank you so much for your help.Really,appreciate that.