如何使行可点击的数据网格是从后面的代码中添加的 [英] how to make Row clickable of a datagrid which is added from code behind
本文介绍了如何使行可点击的数据网格是从后面的代码中添加的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!
我从后面的代码中添加了一个数据网格,并将其与数据表绑定
我的代码在这里
hi!
I added a datagrid from code behind and binded it with datatable
my code goes here
System.Web.UI.WebControls.DataGrid DataGrid1 = new System.Web.UI.WebControls.DataGrid();
DataGrid1.ID = "abcd";
DataTable dt = new DataTable();
dt = partyPub.select_guest();
DataGrid1.DataSource = dt;
DataGrid1.DataBind();
Form.Controls.Add(DataGrid1);
在行上单击我要浏览的此数据网格.
如何使行可单击后面的代码添加的datagrid.
请帮忙.
在此先感谢
On row click of a this datagrid I want to navigate page.
How to make rows clickable of the datagrid which is added from code behind.
Please Help.
Thanks in Advance
推荐答案
如果您可以在此处查看创建事件"部分- ^ ],它应该使您对需要做的事情有个清晰的认识.
If you can look at the "Create Events" section here - DataGrid Template Columns creation in Runtime (using C#) and DataBinding[^], it should give you a fair idea of what you need to do.
这篇关于如何使行可点击的数据网格是从后面的代码中添加的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文