c1gridview 层级结构,层级出不来,需要后台绑定,请给个可参考的demo,谢谢
本帖最后由 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 WHERE (字段类型 = 'date')"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:produce1 %>" SelectCommand="SELECT, FROM .. where =?">
<SelectParameters>
<asp:SessionParameter Name="table_name" SessionField="table_name" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
string sql_gridview1 = "SELECT[表名],[表类型],[业务类型],[数据中心序号],[表说明],,[缺少日期天数]FROM .. 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);
您好,我看您绑定是的单张表,您可以先看下demo的数据格式和您的区别,我这边也帮您验证下。 主表和分表,是两张表 主表和分表,是两张表 代码见附件
zhuyinyin_66 发表于 2018-3-29 09:37
代码见附件
收到,我尽快验证给您回复。 您好,我用代码在后台也实现了,请参照,您的应该是关系没给清楚, 附件已传,请李工帮忙看看
收到,验证之后给您回复 您好,请参考
页:
[1]