Height="335px"
style="font-size: medium; margin-right: 0px;" Width="805px"
AllowPaging="True"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<%--
<%#Eval("EMP_NAME") %>
HeaderText="Form_No" />
HeaderText="Name" DataField="EMP_NAME" />
HeaderText="Employee Code" DataField="employee_code" />
HeaderText="PF NO" DataField="PF_NO" />
DataField="dol" />
DataField="F_NAME" />
DataField="DOB" />
DataField="SEX" />
DataField="rol" />
backend:
protected void generate_Click(object sender, EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chk")).Checked;
if (isChecked)
{
string cvalues;
cvalues = GridView1.SelectedRow.Cells[1].Text;
if (cvalues != null)
{
Response.Redirect("covering_expn.aspx?name=" + cvalues);
}
}
how can i pass the selected rows in the gridview to another page using query string. I want the code for passing multiple rows together and accessing it on the other page.
Hi,
IF you want to pass multiple rows then you cannot use qiery string to pass value from one page to another .
I would suggest you
Create manual datatable and create column to that table (required column) then andd all those rows you need to pass to another page to that datatable.
assign that created table to session variable and get it to next page.
Hope this will help you out
If you are redirecting to "covering_expn.aspx" page by passing name in query string then you can add some delimiter separated string of names in query string and you can use it on different page.
hi,
you can try dharmesh's post .
protected void generate_Click(object sender, EventArgs e)
{
string cvalues=string.Empty;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chk")).Checked;
if (isChecked)
{
cvalues += GridView1.SelectedRow.Cells[1].Text+"|";
}
}
if (string.IsNullOrEmpty(cvalues))
{
Response.Redirect("covering_expn.aspx?name=" + cvalues);
}
}
in your new page separate the value and get the data bind to new gridveiw
Hope this helps
i just need help for seperating the form_no and accessing each seperately in the new page.
If i select more than 1 row than shouldnt it be seperated before assigning it to a variable?
沒有留言:
張貼留言