Combobox in Ultragrid

This post has 4 Replies | 3 Followers

cirej
Points 95
Replied On: Tue, Feb 12 2008 2:10 AM

How can i add collection of values in my combobox ultragrid.

And is it possible to add a radio button in my ultragrid?

Please help. Thanks.

  • Post Points: 20
Mike Saltzman
Points 440,560
Infragistics Employee
Replied On: Tue, Feb 12 2008 10:39 AM

This KB article should help with the dropdown list:

 HOWTO:What is the best way to place a DropDown list in a grid cell?

To place radio buttons in a cell, you can set the column's EditorControl property to an UltraOptionSet control. But this will place multiple options into a single cell, which probably isn't what you want. If you mean you want a radio button that only allows one grid row to be "selected" at a time, then the grid doesn't have this functionality build it. So what you could so is use an UltraOptionSet with one option, then manually de-select the last row when the user selects a new one.  

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 44
Toji Mathew
Points 225
Replied On: Wed, Oct 2 2013 6:06 PM

In the specified link i see a portion like this:

DropDownStyle
By default, when a ValueList is attached to a grid column, the user may choose an item from the list or may type into the cell. The grid will attempt to find the closest matching item on the list and fill in the cell (AutoComplete). If no match is found, the user may enter text that does not exist on the list. To prevent this, set the DropDownStyle property of the grid column to DropDownList. This will prevent the user from typing into the cell, although the keyboard will still function for searching through the list.


How to set the dropdownstyle propety of the grid column to dropdownlist? I didn't see an option like this on the grid column.

I wanted to disable typing in the dropdown in the ultragrid.


Thank you,

  • Post Points: 20
Mike Saltzman
Points 440,560
Infragistics Employee
Replied On: Thu, Oct 3 2013 9:32 AM


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

            band.Columns["My ValueList Column"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
        }

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 20
Toji Mathew
Points 225
Replied On: Thu, Oct 3 2013 10:57 AM

This worked. Thank you.

  • Post Points: 5
Page 1 of 1 (5 items) | RSS