第三方控件netadvantage UltraWebGrid如何生成带加号多级表数据也就是带子表
1.看代碼不解釋:
???? ? ds.Relations.Add("fk", ds.Tables[0].Columns["Id"], ds.Tables[1].Columns["ParentCardId"], false);
?? 將父表和子表放到dataset中通過設置外鍵關聯,這樣就會自動綁定上。由于某些原因表不允許自動生成列,這是子表就要手動在后臺設置:
? band[1]就是指的子表;
? ?protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
?? ?if (this.UltraWebGrid1.Bands[1] != null)
??????? {
??????????? this.UltraWebGrid1.Bands[1].Columns.Add("PerName", " 姓名");
??????????? this.UltraWebGrid1.Bands[1].Columns.FromKey("PerName").HeaderText = "姓名";
??????????? this.UltraWebGrid1.Bands[1].Columns.FromKey("PerName").BaseColumnName = "PerName";
???????? }
}
轉載于:https://www.cnblogs.com/guozefeng/p/3218118.html
總結
以上是生活随笔為你收集整理的第三方控件netadvantage UltraWebGrid如何生成带加号多级表数据也就是带子表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jieba 分词
- 下一篇: [转]Windows 7 产品密钥是否安