Click here to Skip to main content
15,887,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have GridView and i make Selection onclick that when i click on row it is selecting some info but this onclick is working on Edit Too So can you help How i disable it on Edit Form?
C#
if (e.Row.RowType == DataControlRowType.DataRow)
{
    e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(GridView1, "Select$" + e.Row.RowIndex);
    e.Row.ToolTip = "Click to select this row.";
}

C#
protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
 {
     foreach (GridViewRow row in GridView1.Rows)
     {
         if (row.RowIndex == GridView1.SelectedIndex) {
         TABLEzemota.Visible = true;

         sachvnebeli.Text = (row.FindControl("Label4") as Label).Text;
         checka.Checked = (row.FindControl("CheckBox1") as CheckBox).Checked;
         addState.Text = (row.FindControl("Label6") as Label).Text;
         AddSach.Text = (row.FindControl("Label9") as Label).Text;
         addnote.Text = (row.FindControl("Label17") as Label).Text;

         }
         else
         {
             row.BackColor = ColorTranslator.FromHtml("#FFFFFF");
             row.ToolTip = "Click to select this row.";
         }
     }


i use this one
Posted
Updated 16-Dec-15 22:52pm
v2

1 solution

Inside the RowEditing Event, blank out the click attribute or something like that. Try to do the reverse what you are doing inside the RowDataBound.
 
Share this answer
 

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