I have dynamically created GridView in my .aspx from codebehind. I inserted a sql table in that GridView. Then I added one more button filed column. Here is the code:
ButtonField bf = new ButtonField();
bf.Text = "Details";
bf.ButtonType = ButtonType.Button;
DataTable table = new DataTable();
table.Load(reader);
GridView gv = new GridView();
gv.Columns.Add(bf);
gv.DataSource = table;
gv.DataBind();
Now I want to add a MouseClickEvent on this ButtonField, but there is no property Click or MouseClick. Is there any way to do this?
When it comes to gridviews that each row have an action (like edit button, or details), I personally like to do the following:
OnDetailsButtonClick). So this button is the one that will be making the submission.goToDetails(entityId)) so the javascript function will look like:from the code behind you can get the row/Entity ID from the hidden field: