Click here to Skip to main content
15,918,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all,
I am using a grid view with check box. there is a paging concept in that gridview. now i want checkbox value from all page of gridview on a button click. right now i m getting only one page's check box value. please help..

The requirement is to add members in group from grid view. If there are more members so paging will be enable and if i select 2 member from 1st page and 3 member from 2nd page and press Save button so 5 member should be added. right now only current page members are added.



thanks in advance
Posted
Updated 19-May-16 18:29pm
v2

1 solution

private void getvalue()
{
string Chk_id = string.Empty;

StringCollection sc = new StringCollection();

for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("Check_select");
string txt = cb.Text;
if (cb != null)
{

if (cb.Checked==true)
{

Chk_id = GridView1.Rows[i].Cells[7].Text;

sc.Add(Chk_id);
setConnectionString();// your DB connection.

}

}
Bind();


}
 
Share this answer
 
Comments
betu.009 6-Apr-12 5:32am    
i didnt try this but i updated my question..please help for that

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