本帖最后由 zhuyinyin_66 于 2018-3-28 17:34 编辑
想实现如官网示例功能,但需后台绑定数据,
- <wijmo:C1GridView ID="C1GridView1" runat="server"></wijmo:C1GridView>
- <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:produce1 %>" SelectCommand="SELECT 表名, 表类型, 业务类型, 数据中心序号, 表说明, T日, 缺少日期天数 FROM [table] WHERE (字段类型 = 'date')"></asp:SqlDataSource>
- <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:produce1 %>" SelectCommand="SELECT [table_name],[date] FROM [produce1].[dbo].[table_name_date] where [table_name]=?">
- <SelectParameters>
- <asp:SessionParameter Name="table_name" SessionField="table_name" Type="String" />
- </SelectParameters>
- </asp:SqlDataSource>
- string sql_gridview1 = " SELECT [表名],[表类型],[业务类型],[数据中心序号],[表说明],[T日],[缺少日期天数] FROM [produce1].[dbo].[table] where 字段类型='date'";
- DataTable dt_gridview1 = db.GetDataSet(sql_gridview1,"g1");
- this.C1GridView1.DataSourceID = "SqlDataSource1";
- C1GridView1.DataKeyNames = new string[] { "表名" };
- C1.Web.Wijmo.Controls.C1GridView.C1DetailGridView biaoming = new C1.Web.Wijmo.Controls.C1GridView.C1DetailGridView();
- biaoming.DataSourceID = "SqlDataSource2";
- biaoming.DataKeyNames = new string[] { "table_name" };
- this.C1GridView1.Detail.Add(biaoming);
- C1.Web.Wijmo.Controls.C1GridView.MasterDetailRelation relation = new C1.Web.Wijmo.Controls.C1GridView.MasterDetailRelation();
- relation.DetailDataKeyName = "table_name";
- relation.MasterDataKeyName = "table_name";
- biaoming.Relation.Add(relation);
复制代码
|