Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have a gridview and of the beginning of every row, there is a checkbox. Now I like to get to know after a button click, which checkboxes are checked. But after the pageLoad, the GridView is rebind and the information about the status of the checkbox lost. Do you have some tips, how I can get these information about the checkbox?

What I have tried:

I tried to store the data in a hiddenfield in the gridview, but it's reseted to.
Posted
Updated 4-Oct-18 4:11am
Comments
Herman<T>.Instance 4-Oct-18 3:55am    
Before rebinding you can iterate the GridViewRows of the GridView and check for each checkbox by using the GridViewRow.FindControl() methods.
F-ES Sitecore 4-Oct-18 4:19am    
Only bind your gridview if it isn't a postback, so in your page_load event;

if (!Page.IsPostBack)
{
// code to bind gridview here
}
Member 13981467 4-Oct-18 4:37am    
The problem is I have to open a popup window between the to steps and need a postback to populate the information for the popup window
ZurdoDev 4-Oct-18 8:00am    
Any reason you cannot store it in the database?

1 solution

Store the value in question in a session var
 
Share this answer
 
Comments
Member 13981467 4-Oct-18 21:58pm    
But I have to store it for every row of the gridview. I tired to store the whole griedview in a session var, but when I get the session variable, my checked status is everywhere false.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900