Can anyone please look into the code below and let me know how to enable multiple checkboxes checked and include those rows in grd.selected.rows to loop through the selected rows.
private void grdPayVis_InitializeLayout(object sender,InitializeLayoutEventArgs e) {var gridBand = grdPayVis.DisplayLayout.Bands[0];
if(!gridBand.Columns.Exists("Select")) gridBand.Columns.Add("Select", "Select"); gridBand.Columns["Select"].Header.VisiblePosition = 0; gridBand.Columns["Select"].Hidden = false; gridBand.Columns["Select"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox; gridBand.Columns["Select"].AutoSizeMode = ColumnAutoSizeMode.AllRowsInBand; gridBand.Columns["Select"].CellClickAction = CellClickAction.Edit; }
Hi,
I'm not sure I understand exactly what you are asking.
Checking a checkbox in a cell and selecting a row in the grid are two totally unrelated operations. There's really no way to link then together reliably so that the checked rows are always selected.
If you just want to find all of the checked rows, then you could loop through the grid and examine the Text property of the Checkbox column.
List<UltraGridRow> checkedRows = new List<UltraGridRow>(); foreach (UltraGridRow row in this.ultraGrid1.Rows.GetAllNonGroupByRows()) { // Using Text here because Value reads from the underlying data source and will // be incorrect if a checkbox cell is still in edit mode. bool isChecked = bool.Parse(row.Cells["Select"].Text); if (isChecked) checkedRows.Add(row); }
Hello Mike, I figured out and fixed it an event in my grid is causing this issue...now I am able to check multiple checkboxes..
Hello Mike, Thank you for the reply, but why is that I am unable to check multiple checkboxes at a time, check box on my grid behaves like a radio button..Can you think of anything to fix this behaviour