Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
850
Handle CheckBox header
posted

Hello everyone,

I have some problems with the ultragrid,
I'm gonna try to explain what I'm doing and where I'm getting problems.

My ultragrid has a datatable with this structure

Status | CodeMachine | Section | UnitProduction

Status column  is a checkbox type column
and I have configured checkbox header in it.
I'm grouping my rows based on the  "Section" column.

Everything it's ok right here,

If I checked or unchecked the checkbox header,
the rows that are involved in the change also change their state,

And what I want to acomplish is that I need to know How many rows in true status I Have?
To accomplish this, I use AfterHeaderCheckStateChanged event and a method to
loop through all the rows in the grid
and count my rows in true state (State Column),
but I'm getting a strange behavior, for example, in the image 1
I have all the rows in true state, if I uncheck the header checkbox of the status column within groupbyrow called
"Setion: A (4 items)", AfterHeaderCheckStateChanged event is fired and it calls the LoopThroughGrid() method,
the rows within "Setion: A (4 items)" should have the false status,
because I'm unchecking the checkbox header but in the loop I'm getting these rows with still true status.
similarly, if I check the checkbox header again , now that rows have a false state, 
when they should have a state of true because I'm checking the checkbox header.

Why is happening?
How can I solve this?

Maybe using AfterHeaderCheckStateChanged is the problem,if so, wich ultragrid's event
is the most suitable to acomplish this?

I hope to explain myself better much in the images.

by the way, I'm sending to you my code

CheckBoxHeader.rar