there are a number of little tweaks I would like to make to how a WinGrid looks, but I cannot figure out how to do them. Here is the screen shot of what I have so far:
Here is what I would like to change:
Band[0]
Band [1]
Your last question is a bit unclear. What exactly do you mean by "select"?
You can prevent the user from selecting a row in any band using something like this:
grid.DisplayLayout.Bands[0].Override.SelectTypeRow = None
But I don't think you are really talking about selection here, I think you probably mean something more, like you don't want the user to Activate the row, or maybe you don't want the row to be editable.
So what exactly do you want to happen when the user clicks on a row in Band 0?
Mike Saltzman"] Your last question is a bit unclear. What exactly do you mean by "select"?
Well, the control is a picker control. It is designed to allow the end user select something from Band[0], Band[1] is simply there to help them determine which Band[0] to pick.
Sam
Hi Sam,
scarleton said:Well, the control is a picker control. It is designed to allow the end user select something from Band[0], Band[1] is simply there to help them determine which Band[0] to pick.
Okay, it depends how you are doing your "selection". It sounds to me like you are only selecting a single row, which means you may be using the grid's ActiveRow rather than grid.Selected.Rows.
Controlling Selection is very easy, you just use the SelectTypeRow property on the Override. So you could set SelectTypeRow on Band 1 to None, and SelectTypeRow on Band 0 to SingleSelect.
The ActiveRow is more complex, because by default, the grid will synchronize the ActiveRow with the current row of the CurrencyManager.
So there are number of unknowns here. One thing you could do is use the Activation property on the row. You could handle the InitializeRow event, check the e.Row.Band.Index or maybe Key and disable the row if it's a row in Band 1. This would prevent the user from clicking on the row, selecting it, or editing it.
Another option you might consider is that when the user clicks on a child row, you just interpret that as selection of the parent row.