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
480
UltraComboEditor in UltraWinGrid with ValueList
posted

Hi all,

I'm using an UltraComboEditor as an editor in an UltraWinGrid to make a translation "Internal ID"  <-> "User Key". The UltraComboEditor has a DataTabe as the DataSource:

ID           Key
100        1
101        2
102        3
...            ....
201        100

Entering data:
DisplayMember     ValueMember
1              ->              100
2              ->              101
100         ->               100      WRONG
201         ->               201     WRONG

What do I have to do the only Values in the key-list are accepted and correctly translated?
DisplayMember      ValueMember
1                 ->           100
2                 ->           101
100            ->            201
201            ->            Not accepted

Parents
No Data
Reply
  • 71886
    Offline posted

    Hello masch,

    A possible approach to achieve this might be by hooking to the 'BeforeCellUpdate' event and do something like the following:

    bool isItemInList = false;
            private void ultraGrid1_BeforeCellUpdate(object sender, Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventArgs e)
            {
                foreach(ValueListItem item in ultraComboEditor1.Items)
                {
                    if(item.DisplayText == e.Cell.Text)
                    {
                        isItemInList = true;
                        break;
                    }
                }

                if (!isItemInList)
                {
                    e.Cancel = true;
                }
            }

    Please feel free to let me know if I misunderstood you or if you have any other questions.

Children