I have a dropdown bound to a datatable.
I would like to remove items in the drop down as I need the rows in the datatable at a later stage.
I have looked in the InitializeLayout event but not sure how to remove items in the drop down.
Help!
Hello,
Please let us know if you need any other assistance.
Hi,
This will work, and it's just fine if you only have a short list of rows.
But it's more efficient to use the InitializeRow event, instead of looping through the row. It's also better to use GetCellValue on the row, instead of row.Cells[x].Value.
If you only have a few rows, then you should just keep what you have, but if you are concerned about performance here, you might want to check out the WinGrid Performance Guide
foreach (var row in e.Layout.Rows) { if (row.Cells["colname"].Value.ToString() != "value") row.Hidden = true; }