How to make row clickable DataGrid?
ASP.NET
3
Posts
3
Posters
0
Views
1
Watching
-
Hi, You want to execute any server code on click of the row in datagrid? If you want to use javascript then you can write follwing code in ItemDataBound event of Datagrid. if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItem.AlternatingItem) { e.Item.Attributes.Add("onclick", "urjavascriptfunction"); } I hope this will help you.
Thanks and Regards, Chetan Ranpariya
-
if (dgvEmployee.CurrentRow.Index == -1) // Is there any row selected now? return; // Retrieve the first column from the selected row. int Id = Convert.ToInt32(dgvEmployee.CurrentRow.Cells[0].Value.ToString()); This gives the particular value in the row of cell 0 ...If it help carry on
came out of hardwork