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
630
DropDown Column in UltraWebGrid
posted

Hi

We are using Infragistics for ASP.Net (version 8.2) along with .Net(Framework 3.0).


We are using an Infragistics - Ultrawebgrid.
We are inserting a column of type drop-down at run-time in initialize layout event of the ultra web grid.
In addition ,We are also inserting another column of type CheckBox and another column of type custom. This custom type column is embedded to WebCombo.

The drop-down column is binded by adding value-list items to its value-list property.


The grid is binded to a datasource.

On first loading of the page, the grid is appearing as expected.
The drop-down column appears fine with the bounded drop-down values.

But when by some 'button-click' or 'Add New Row' triggers the post-back of the page ,the drop-down column does not contain drop-down list anymore whereas the selected value appears in the grid cell. All other columns including the CheckBox and Webcombo columns are appearing fine even after post-back.

We have a critical client requirement. Please get back as soon as possible.

Can you pls help us out on this issue ?

Parents
  • 49378
    Suggested Answer
    posted

    Hi grakgem,

    It has been a while since your post, however in case you still need assistance I would be glad to help.

    The scenario you have described may occur if you are configuring an UltraGridColumn object and afterwards adding it to the grid , by using for instance:

            UltraGridColumn test = new UltraGridColumn();
            test.Type = ColumnType.DropDownList;
            test.ValueList.ValueListItems.Add("item1", "item1");
            test.ValueList.ValueListItems.Add("item2", "item2");
            test.Header.Caption = "DropDown";

            UltraWebGrid1.Columns.Add(test);

    In order for your dropDown value list to persist through postbacks, you should first add a column to the grid, and then configure its valueListItems:

        protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
        {
            UltraWebGrid1.Columns.Add("DropDownCol");
            UltraWebGrid1.Columns.FromKey("DropDownCol").Type = Infragistics.WebUI.UltraWebGrid.ColumnType.DropDownList;
            UltraWebGrid1.Columns.FromKey("DropDownCol").ValueList.ValueListItems.Add("1", "1");
            UltraWebGrid1.Columns.FromKey("DropDownCol").ValueList.ValueListItems.Add("2", "2");
            UltraWebGrid1.Columns.FromKey("DropDownCol").ValueList.ValueListItems.Add("3", "3");
            UltraWebGrid1.Columns.FromKey("DropDownCol").Header.Caption = "DropDown";
        }

    Please contact me if you have any questions.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://es.infragistics.com/support

Reply Children
No Data