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
440
Assign Null to DropDownList Column
posted

How can a user remove the value from a drop down list column after he/she selected an entry in the drop down list.

We tried to assign an empty string to the UltraGridColumn.ValueList.Prompt property. However, the empty string entry can not even be found inside the dropdown list. If we assign anything other than empty string, it does show up as first entry in the dropdown list, but it will not stay selected after the focus exit the cell. The dropdown list will go back to the previous selected value.

 

Parents
No Data
Reply
  • 28464
    posted

    Hello,

    I am tying to reproduce the problem locally, but unfortunately am not able to - it works great for me. Here is the code I am using - a column of type DropDownList and I am initializing its ValueList in the grid InitializeLayout event:

      <igtbl:UltraGridColumn BaseColumnName="CompanyName" IsBound="True"
                            Key="CompanyName" Type="DropDownList">
                            <Header Caption="CompanyName">
                                <RowLayoutColumnInfo OriginX="1" />
                            </Header>
                            <Footer>
                                <RowLayoutColumnInfo OriginX="1" />
                            </Footer>
                        </igtbl:UltraGridColumn>  

        protected void UltraWebGrid1_InitializeLayout(object sender, LayoutEventArgs e)
        {
            UltraGridColumn c = UltraWebGrid1.Columns.FromKey("CompanyName");
            c.ValueList.ValueListItems.Add("", "");
            c.ValueList.ValueListItems.Add("1", "1");
            c.ValueList.ValueListItems.Add("2", "2");
            c.ValueList.ValueListItems.Add("3", "3");
        }

    You can seein the screenshot that I am able to get the empty string display fine and on selection, it is correctly intesrted in the cell. What am I missing?

Children