Hello everyone, i have multiple link buttons in gridview and have to write event for selected link button. All buttons are fire different query and output will be send on another page.
This is my HTML code:
AutoGenerateColumns="False" CssClass="Grid" ondatabound="GridView1_DataBound"
onrowcreated="GridView1_RowCreated" onrowdatabound="GridView1_RowDataBound"
onselectedindexchanged="GridView1_SelectedIndexChanged" Width="152px"
onrowcommand="GridView1_RowCommand">
C# Code:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "sd")
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[index];
if (row.Cells[1].Text != " ")
{
e.Row.Cells[1].Attributes.Add("onClick", "openWindow_Requests('" + division + "," + category + "," + month + "," + year + "')");
}
}
}
Thanks in advanced.
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manas MohapatraPosted Jan 24, 2017, 1:42 AM