Apologies if this answer exists elsewhere, my search didn't return anything.
Here's my situation. I have a form containing some buttons and a WinGrid. On button press by the user, server side updates are performed using data from the grid. The update communication is performed in a background thread so that the user can access other parts of the application. The downside is this leaves the wingrid enabled where the user could make changes while the update is in progress.
The simplest option is to set the .Enabled property on the wingrid during processing, and re-enable after it's complete. However, project management has deemed the graying out of the grid "ugly" (even though it's been stressed to them that this is consistent windows behavior) and not an acceptable answer.
I've attempted to go through all the appearance objects in the grid and set their disabled colors to the same value as the non-disabled colors (ie .ForeColorDisabled = ForeColor) at design time, in the hopes that when setting .Enabled = false, I'd get the behavior I'm looking for without any visual change. However this doesn't appear to be doing anything, I'm still seeing the grayed-out component.
My questions are:
1) Is the above approach feasible and maybe I'm just missing something?
2) Is there perhaps another way to get the behavior I'm looking for? (I should note that what I'm looking for is not solved by just setting the grid to ReadOnly, I still need to mimic a truely disabled component (ie clicking column header doesn't resort).
Thanks!
Those would definitely prevent any kind of data update in the grid, but they wouldn't prevent other kinds of grid interaction like
- resorting of data by a column
- grouping of data by column (the group-by box is visible durint this process)
- right-click context menus on certain grid components
probably more that I'm missing.
How about this:
Grid.DisplayLayout.Override.AllowAddNew = AllowAddNew.NoGrid.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.FalseGrid.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False