Exemplo n.º 1
0
        protected void gridListInvoice_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)
        {
            //initialize control
            BootstrapGridView grid             = (BootstrapGridView)sender;
            BootstrapTextBox  txtInvoiceNumber = (BootstrapTextBox)grid.FindDetailRowTemplateControl(e.VisibleIndex, "txtInvoiceNumber");
            BootstrapTextBox  txtApproveBy     = (BootstrapTextBox)grid.FindDetailRowTemplateControl(e.VisibleIndex, "txtApproveBy");
            BootstrapDateEdit dateInvoice      = (BootstrapDateEdit)grid.FindDetailRowTemplateControl(e.VisibleIndex, "dateInvoice");
            BootstrapMemo     txtNote          = (BootstrapMemo)grid.FindDetailRowTemplateControl(e.VisibleIndex, "txtNote");

            //bind control
            if (txtInvoiceNumber == null)
            {
                return;
            }

            txtInvoiceNumber.Text = grid.GetRowValues(e.VisibleIndex, "InvoiceNumber").ToString();
            txtApproveBy.Text     = grid.GetRowValues(e.VisibleIndex, "ApproveBy") != null?grid.GetRowValues(e.VisibleIndex, "ApproveBy").ToString() : string.Empty;

            txtNote.Text = grid.GetRowValues(e.VisibleIndex, "Note") != null?grid.GetRowValues(e.VisibleIndex, "Note").ToString() : string.Empty;

            DateTime InvoiceDate = Convert.ToDateTime(grid.GetRowValues(e.VisibleIndex, "InvoiceDate"));

            if (InvoiceDate != DateTime.Parse("1/1/1900"))
            {
                dateInvoice.Value = InvoiceDate;
            }
            else
            {
                dateInvoice.Value = null;
            }
        }