zoukankan      html  css  js  c++  java
  • ASPxGridView1用法2

    父控件中一定要邦定主键,KeyFieldName="sheet_no";

    接下来就是后台邦定代码了,如何邦定我父控件,前面都说过了,接下来,我们看如何邦定子控件,因为子控件在后台调不出来,所以,我再加一个SqlDataSource控件,用它来邦定子控件,这个邦定要动态的去,在展开行事件中写

      private void NewMethod(int i)
        {
    //得到主键值
            object var = this.grid.GetRowValues(i, new string[] { "sheet_no" });
            this.SqlDataSource1.DataSourceMode = SqlDataSourceMode.DataReader;
            this.SqlDataSource1.ConnectionString = "Server=.;DataBase=hjh02;uid=sa;pwd=1";
            this.SqlDataSource1.SelectCommand = string.Format("select * from lsps_bhqd where sheet_no='{0}'", var.ToString());
            this.SqlDataSource1.DataBind();
        }
    //展开行事件

        protected void grid_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)
        {
            NewMethod(e.VisibleIndex);
        }

  • 相关阅读:
    与DSP通信时,RD&WR信号
    4.2.1 Vector bit-select and part-select addressing
    数据校验
    数据结构 (树,图)
    ASOP编译说明
    os
    20180203-增与查
    yum安装MariaDB
    20180202之engine,URL,base,session
    列表
  • 原文地址:https://www.cnblogs.com/xiaofengfeng/p/2682600.html
Copyright © 2011-2022 走看看