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
20
Add UltraCombo to UltraGridCell when clicking a row
posted

I set up a small UltraGrid with 2 bounded and 2 unbounded columns. Whenever the user clicks on a row in den Grid, I want to create a UltraCombo in the cells of the unbounded columns for the selected row. The values of the UltraCombo are based on the value of the unbounded columns, which should be replace with the Combos. I found some samples setting up UltraCombos for all cells of a column, but I got no way to create the UltraCombo at runtime and place it into one single cell.

I tried to create the UltraCombos within the AfterSelectChange-Event and remove them within the BeforeSelectChange-Event.

Could you please give me a small example of adding a UltraCombo to one specific cell.

Thanks in advance!

Parents
No Data
Reply
  • 230
    posted

    Hi,

     

    Try something like this:

    Infragistics.Win.ValueList valueList = new Infragistics.Win.ValueList();

    valueList.ValueListItems.Add((char)'Y', "Yes");

    valueList.ValueListItems.Add((char)'N', "No");DefaultEditorOwnerSettings editorSettings = new DefaultEditorOwnerSettings();

    editorSettings.ValueList = valueList;

    Infragistics.Win.EditorWithCombo editor = new Infragistics.Win.EditorWithCombo(new DefaultEditorOwner(editorSettings));

    // this is optional  - editor.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;

    mainGrid.DisplayLayout.Bands[0].Columns["Visible"].Editor = editor;

     

    This will create editor with combo and embed it to appropriate column cells.

     Hope it helps.

    Cheers.

Children