示例#1
0
 protected void EditableGridView_RowCancelingEdit(object sender,
                                                  GridViewCancelEditEventArgs e)
 {
     BindData();
     EditableGridView.EditIndex = -1;
     EditableGridView.DataBind();
 }
示例#2
0
        private void BindData()
        {
            var data = (DataTable)Session["DataObject"];

            EditableGridView.DataSource = data;
            EditableGridView.DataBind();
        }
示例#3
0
        private void BindData(int applicationId)
        {
            var dtc = FieldConfigurationUtility.GetFieldConfigurations(19000, -15001, string.Empty);

            var odt = FieldConfigurationUtility.GetFieldConfigurations(SystemEntityTypeId, AEFLMode, string.Empty);

            foreach (DataColumn col in odt.Columns)
            {
                var colexists = false;
                foreach (DataColumn dcol in dtc.Columns)
                {
                    if (dcol.ColumnName == col.ColumnName)
                    {
                        colexists = true;
                        continue;
                    }
                }
                if (!colexists)
                {
                    odt.Columns.Remove(col.ColumnName);
                }
            }
            foreach (DataColumn col in dtc.Columns)
            {
                //Declare the bound field and allocate memory for the bound field.
                var bfield = new TemplateField();

                ////Initalize the DataField value.
                //bfield.HeaderTemplate = new eSettingsTemplate(ListItemType.Header, col.ColumnName);

                ////Initialize the HeaderText field value.
                //bfield.ItemTemplate = new eSettingsTemplate(ListItemType.Item, col.ColumnName);

                //Add the newly created bound field to the GridView.
                EditableGridView.Columns.Add(bfield);
            }
            EditableGridView.DataSource = odt;
            EditableGridView.DataBind();
            ReadOnlyGridView.DataSource = odt;
            ReadOnlyGridView.DataBind();
            ReadOnlyRepeater.DataSource = odt;
            ReadOnlyRepeater.DataBind();
            EditableRepeater.DataSource = odt;
            EditableRepeater.DataBind();
            Repeater2.DataSource = odt;
            Repeater2.DataBind();
            Repeater1.DataSource = odt;
            Repeater1.DataBind();
            if (!SessionVariables.IsTesting)
            {
                //EditableGridView.Columns[0].Visible = false;
                //ReadOnlyGridView.Columns[0].Visible = false;
            }
        }
示例#4
0
 public void BindData(DataTable data)
 {
     if (Session["DataObject"] == null)
     {
         Session.Add("DataObject", data);
     }
     else
     {
         Session["DataObject"] = data;
     }
     EditableGridView.DataSource = data;
     EditableGridView.DataBind();
 }
示例#5
0
        public void SetUp(string[] columns, string tableName, DataTable data)
        {
            Data      = data;
            Columns   = columns;
            TableName = tableName;
            Columns   = columns;
            var ItemTmpField = new TemplateField();

            EditableGridView.EditIndex  = -1;
            EditableGridView.DataSource = data;
            EditableGridView.DataBind();
            if (Session["DataObject"] == null)
            {
                Session.Add("DataObject", data);
            }
            else
            {
                Session["DataObject"] = data;
            }
        }
示例#6
0
 protected void EditableGridView_RowEditing(object sender, GridViewEditEventArgs e)
 {
     BindData();
     EditableGridView.EditIndex = e.NewEditIndex;
     EditableGridView.DataBind();
 }