We have an ultrawingrid that is on an ultratab. The UWG is located on the second tab. The grid is loaded in the from load event.
The UWG's first column has a checkbox header. We have a call which enables a save button in the AfterHeaderCheckStateChanged event.
When we change the tab to the second tab the AfterHeaderCheckStateChanged event is being fired.
1. Is there a better place to locate our save button call then in the AfterHeaderCheckStateChanged function?
2. What event on the grid fires the AfterHeaderCheckStateChanged event after changing tabs?
Thanks!
Justin
Hello Justin.
I removed the "firsttime" boolean variable from the code. It is not needed. The sample that I have attached to my last reply to this thread is the one I am referring to. It doesn't have a "firsttime" boolean variable anywhere.
Were you able to download and test that sample?Sincerely,
CharlieSenior Developer Support EngineerMCTS
Hi Charlie,
You have added the same work around we did to our code. You added the "firsttime" boolean which gets set after the first time the afterheadercheckedchange event is fired. If you remove this boolean you will see that the event fires twice and we have the same problem.
Thanks.
I have attached a modified version of the sample that we submitted for the development issue. I changed the "Selected" column to be of type boolean instead of integer and added some Debug.WriteLine statements into the code to show what is going on.
It will not fire the AfterHeaderCheckStateChanged event a second time when Tab2 is activated the second time. Switching tabs doesn't cause this event to fire again when no values have changed in the grid.
Please let me know if you have any questions.
Sincerely,
I've changed the data value to be returned to a true / false (this is a bound grid) instead of 1/0 and still the same issue. My column style is a checkbox. Is this correct? Am I missing something?
Hello Mark.
After looking at this sample, our developers have determined that this is not a bug.
This is actually an issue with the sample itself. The Header CheckBox is actually changing state twice, triggering two AfterHeaderCheckStateChanged events. The first state change is when the checkBox is clicked. The second occurs when the checkbox goes back to the Indeterminate state due to the synchronization triggered by visibility change from tab-selection.
The synchronization cannot assume the cell values in a column of datatype Int can be converted to a true/false value, so it is setting the CheckState of the Header CheckBox to "Indeterminate".
This can all be resolved in the sample by changing the DataType of the "Selected" column to 'bool', and assigning values of true/false instead of 1/0.
Charlie
Senior Developer Support Engineer
MCTS