Hi team,
I am using your webdatagrid in one of my applications.I have enabled the viewstate for this grid. ( viewstatemode=enabled,enableddataviewstate=true,enableajaxviewstate=true)
Now i want to reset/delete the viewstate of this grid at click of a certain button. For doing this i bind the data to the grid again at the click event of that button...(this.RolesDataGrid.DataSource = LogicSEMaster.GetAllRoleDetails(); this.RolesDataGrid.DataBind();)
However, my viewstate is still persisted.Can you please guide me as how do i reset the viewstate of the grid.
Please note i dont want to turn the viewstate OFF .I just want to get rid of the data which is there in the viewstate.
HI yadusaxena,
When you rebind the grid to its data source, the data objects are reset and it will save the new data. I'm not sure what you want to clear out of view state. It mostly saves properties of the grid or its behaviors. You could possibly call ClearDataSource() before reassigning the grid source if you're actually changing it; that function will clear some other internal variables.
regards,David Young
Does it clear the state for any Unbound data fields like checkbox? I want to remove selection in an error scenario