Hello.
I have an UltraGrid that loads from an Excel file.
What I would like to do is loop each row and column, the ones that are selected, so that I can get the value and "Header".
For example, for the image I would get the following:
For the first row.
SUB: 431/
P1: 88.2
P2: 96.9
P3: 0
P4: 6.24
P5: 6.86
P6: 209.65
P7: 230.7
P8: 253.8
P9: 97
P10: 0
P11: 88.2
P12: 96.9
P15: 74.97
P16: 76.03397052
For the second row, I will get the values from the SUB: 437/
Can someone please tell me how to achieve this?
Thanks
Hi William,
foreach (UltraGridRow row in this.ultraGrid1.Rows) { foreach (UltraGridCell cell in row.Cells) { Debug.WriteLine(cell.Value.ToString(), cell.Column.Key); } }
Great it worked, I just need to loop through each of the rows that are only selected, the checkbox is a boolean. I tried the following:
if (Convert.ToBoolean(grdPart.ActiveRow.Cells["Seleccionar"].Value) == true) { foreach (UltraGridRow row in this.grdPart.Rows) { foreach (UltraGridCell cell in row.Cells) { MessageBox.Show("" + cell.Value.ToString() +" | " + cell.Column.Key); } } }
But it's not working, am I missing something?