Hi,
We have found the following behavior with Web Grid, and want to confirm if the same is a bug.
Created an Unbound column of CheckBox Type, and placed a 'Test Postback' on the page (outside the WebGrid).
Check one or more Check Boxes
Click 'Test Postback'
It works fine for the first postback.
User sees Check Boxes selected still.
Click 'Test Postback' again
This empties unchecks all Check Boxes in the Column.
Can somebody tell me if this behavior is by design or is a bug?
Also, is there any solution as we need to keep the CheckBox selection as is across all postbacks (Except converting the unbound column to a bound column and preserving its state in source data object).
Regards,
MPVBRao.
Ok, I will try to persist the state.
Also could you please explain the below.
Why is the grid showing wrong checkbox state after first postback?, as the same state is not accessible though code in the next postback.
mpvbrao said:Also could you please explain the below. Why is the grid showing wrong checkbox state after first postback?, as the same state is not accessible though code in the next postback
Why is the grid showing wrong checkbox state after first postback?, as the same state is not accessible though code in the next postback
By persisting the state of the checkboxes, restoring them in either InitializeDataSource or InitializeLayout, you'll ensure that the checkboxes remain checked even after subsequent postbacks.
If you instead chose to not use InitializeDataSource, and so long as ViewState is enabled for the grid, the state of the checkboxes would be retrieved from ViewState. So long as you don't DataBind the grid again, the states will persist across multiple postbacks.
Vince McDonald"]There's no event processed this time, since the user didn't change any of the states of the checkboxes.
But how does it know that there are no changes at this time, as the previous stateof checkboxes is not maintained anywhere.
Whatever the case, user should see the same which the developer could access in the postback, but in this case end user is shown false state than what is actually available to the developer, am I right?.
Hello,
I just want to refer to a similar thread I've seen recently and that can provide some help/clues:
http://forums.infragistics.com/forums/p/13065/48331.aspx
I was also able to reproduce that behaviour, but at this point I am not sure if it is by design or a bug - e.g. if the developer should be responsible for keeping the state of unbound checkbox columns. You may want to check out if the client-side approach works better for you. Alternatively you can move to unbound mode or manually take care of the state of the column (e.g. put a list of boolean values in the Session / ViewState / Cache of the application and the restore after postback).
Or, you can contact our Developer Support directly via this link - this way the question will most probably be referred to development for a more complete answer.
http://www.infragistics.com/Support/default.aspx
Sorry for the inconvenience.
Hi Rumen,
I have already gone through that discussion.
Still there is an unanswered question posted by rickloyd
Thats why I raised a new question/thread.