在指定了datasource后用bind()方法。
解决方案 »
- 各位大侠,没事的进来看看.. 无法显示 XML 页。
- 如何用读取注释或者CDATA
- 想开发一款工具类软件 类似wpf的工作界面 如何做到像wpf一样 工作区既可以修改xaml也可以修改界面中的控件,保证他们同步
- JavaScript脚本问题
- 提示:“跨執行緒作業無效: 存取控制項 'StopThis' 時所使用的執行緒與建立控制項的執行緒不同。”如何解决能够存取此控件?
- 怎么样通过句柄发送消息
- 高手们请问一下是不是用sn.exe强名称必须安装.net啊,光框架是不能用啊
- =======问了一周了,还是没人会??????很简单的=====================
- 泛型的高级应用,求解
- WinForm中的DataGrid列宽问题
- 如何把一个XmlNodeList 生成一个xml文件
- 高分求助:如何把access表中某个字段的值取出并赋给一个变量?
DataGrid1.DataBind();//关键这一句。
2. Attach one method called "GenerateClientScript" to the OnItemDataBound of the datagrid.
eg.
<asp:datagrid id="dgPendingOpty" runat="server" CellPadding="4" CssClass="BaseGrid" AutoGenerateColumns="False" OnItemDataBound="GenerateClientScript"> 3. The code for GenerateClientScript: protected void GenerateClientScript(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
ListItemType itemType = e.Item.ItemType;
if ((itemType == ListItemType.Pager) ||
(itemType == ListItemType.Header) ||
(itemType == ListItemType.Footer))
{
return;
} LinkButton button = (LinkButton)e.Item.Cells[0].Controls[0];
e.Item.Attributes["onclick"] = Page.GetPostBackClientHyperlink(button, "");
TableRow r=(TableRow)e.Item;
r.ToolTip="Click to select the row";
TableCell c=(TableCell) e.Item.Cells[1];
c.ToolTip="Click to get details";
//e.Item.Attributes.Add("OnMouseOver", "this.style.cursor='hand';this.className='altRow';");
//e.Item.Attributes.Add("OnMouseOut", "this.className='linkRow';");
}
"
http://expert.csdn.net/Expert/topic/1649/1649091.xml?temp=.7822992