เมื่อเราใช้ Master Grid แล้วมี Detail Grid ซ้อนอยู่ในส่วนของ Master Grid เวลาจะเรียกใช้จะต้องทำภายใต้ OnInit

 protected void ASPxGridView2_Init(object sender, EventArgs e)
    {

        GridViewDataTextColumn colTotal = new GridViewDataTextColumn();
        colTotal.Caption = "คงเหลือ";
        colTotal.FieldName = "Total2";
        colTotal.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
        colTotal.VisibleIndex = ASPxGridView1.VisibleColumns.Count;
        colTotal.PropertiesTextEdit.DisplayFormatString = "n0";
        //colTotal.PropertiesTextEdit.Width = 100;
        colTotal.Width = 100;
        colTotal.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

        ASPxGridView detail = sender as ASPxGridView;
        detail.Columns.Add(colTotal);
        //detail.Columns.Add(colTotal);
    }

 

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.