Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
570
UltraWebGrid's child table
posted

I found a problem,UltraWebGrid's child table can't achieve by user-defined column. Why?  When I set AutoGenerateColumns is true, UltraWebGrid's child table can display.  Below is my C# code:

protected void uwgLight_DataBinding(object sender, EventArgs e)
    {
        DataSet ds = Class_LightShelf.GetAll(0);
        ds.Tables[0].TableName = "LightShelf";
        ds.Tables[1].TableName = "LightSeat";

        ds.Relations.Add("LightRelations", ds.Tables["LightShelf"].Columns["ID"], ds.Tables["LightSeat"].Columns["LSID"]);

        this.uwgLight.DataSource = ds;
    }

protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            this.uwtLight.DataBind();
        }
    }

Parents
No Data
Reply
  • 28464
    posted

    Hello,

    Most probably this is a page lifecycle issue. At the point where the grid needs information for the child band, this information is not available. My suggestion is moving the code the does that to the InitializeLayout event of the grid (instead of DataBinding). You can also try rebinding the grid in OnInit instead of Load and/or try using the InitializeDataSource event of the grid for that.

    Hope this helps.

Children