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
1540
DropDownList on ClickCell
posted

Hello.

I have a UltraGrid with 3 columns. When I click on the third column (I am using ClickCell event) the cell became a DropDownList.

Here's my problem... When I click in the cell, it always execute the my code (behind) and never shows my list.

How can I solve my problem?

Code:

private void PropertiesUltraGrid_ClickCell(object sender, ClickCellEventArgs e)
{

(...)

case ("Boolean"):
ValueList vList = new ValueList();
vList.ValueListItems.Add("sim", "Sim");
vList.ValueListItems.Add("nao", "Não");
e.Cell.ValueList = vList;
e.Cell.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
break;

}

Thank you.

Best regards,

Maria

Parents
No Data
Reply
  • 71886
    Suggested Answer
    Offline posted

    Hello Maria,

    I do not know why you are doing this in the mentioned event, but the problem here for me is clearly the firing of the event more than once(everytime you try to open this ValueList in the cell). Please use a condition which guarantees you that the event would fire only once, like the following one:

    if (e.Cell.ValueList == null)
                {
                    Console.WriteLine("FIRED");
                    ValueList vList = new ValueList();
                    vList.ValueListItems.Add("sim", "Sim");
                    vList.ValueListItems.Add("nao", "Nao");
                    e.Cell.ValueList = vList;
                    e.Cell.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
                }
    

    Please do not hesitate to contact me if you need any additional assistance.

Children