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
180
Different "display value"
posted

Is there a possibility to change the visible value of a cell without changing the real value? Something like

if cell.value.equals("F") then

cell.displayValue = "Female"

end if

Thanks for any support.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    In a simple case like your example where you have a finite list of options (M or F) and you want to show more user-friendly test, then easiest way to do this would be to use a ValueList.


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridBand band = layout.Bands[0];

                ValueList vl = layout.ValueLists.Add("MF ValueList");
                vl.ValueListItems.Add("M", "Male");
                vl.ValueListItems.Add("F", "Female");
                band.Columns["String 1"].ValueList = vl;
                band.Columns["String 1"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;

           }

    You could also use UltraDropdown or a BindableValueList is your list data comes from a data source and you want to bind it.

    The last line (setting the Style property) is optional, but I assume in a case of M/F you don't want the user to type in some other value.

Children