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
430
Column with Radio Button in UltraCombo
posted

Hi,

i am at the stage where in my UltraCombobox i want to have a column which is of style Radio Button.

The UltraCombobox's datasource is filled with the dataset and the combo is displaying some columns.Now i have added an extra column programtically and set its visible position to 0(first Column).Main thing is that i am using the combobox as dropdown list.

As Infragistics directly don't support Style which helps us to make column to appear as Radio button i had to add Ultraoptionset in my form and then i assigned Ultraoptionset to my Combobox's EditorControl Property.

 

Me.cboJobRates.DisplayLayout.Bands(0).Columns("Selected").Header.VisiblePosition = 0

Me.cboJobRates.DisplayLayout.Bands(0).Columns("Selected").EditorControl = Me.UltraOptionSet1

This way the column name selected will be of radio button style but problem is when i click on any cell of that column it is not setting the radio button of that cell to "Selected" state. it does select the row but the radio button remain unselected.

 

I tried some options but its not working....If it was in Ultragrid then i can use CellSelected Event and from there i am able to set it on but here not working...

Any Idea?????

 

Regards,

Carlton

  • 469350
    Suggested Answer
    Offline posted

    Hi Carlton,

    The OptionSet in the grid cell will get it's selected item from the value of the cell. So my guess is that you probably didn't set the DataType on the unbound column (which means it will default to string) and you also probably didn't set the DataValue on the Items in the OptionSet.

    In any case, this probably still won't work, the OptionSet will exist in each cell - not the Combo as a whole. So selecting the radio button in a cell would have no effect on any other cells in the other rows.

    I'm not really sure I see what you are trying to do here. It sounds like you just want to indicate the "selected" row in the Combo in another way, in addition to the highlighting of that row on the list.

    If that's the case, there's really no easy way to do this.

    What I would do is set the column's DataType to boolean and make sure the one item in the OptionSet has a DataValue of true. So now the OptionSet will display checked or unchecked depending on the value of the cell: true or false respectively.

    Then you will have to code it to change the value of the unbound cell in based on the current value or SelectedRow of the combo. The obvious way would be to loop through all the rows and set the value of each unbound cell. But you might just want to keep track of the last one which was true so you can uncheck it more efficiently without looping.