Home Forums WinForms controls Xceed Grid for WinForms Rebind WinComboBox for current row only

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16321 |

    Hi,
    I added a few DataRows to Grid and in two Cells of each row I inserted WinComboBoxes.
    Value of the second WinComboBox I get from DataSet by value of first ComboBox within Event SelectedValueChanged.
    All works fine and correctly, but by this Event are changed values of ComboBoxes in all DataRows.
    I want that will be change only ComboBoxe’s values of current row only.
    Thanks,

    Imported from legacy forums. Posted by Igor (had 2252 views)

    User (Old forums)
    Member
    Post count: 23064

    You need to set a different WinComboBox for each cell of this column.  You can do this at the AddingDataRow event, instead of setting it on the column at form load.

    e.g.:

    private void Form1_Load( object sender, EventArgs e )

    {

        gridControl1.AddingDataRow +=

    new AddingDataRowEventHandler( gridControl1_AddingDataRow );

    }

    private void gridControl1_AddingDataRow( object sender, AddingDataRowEventArgs e )

    {

        //This sets a different editor to each cell, instead of using the same one for every cell when you set it on the column 

        e.DataRow.Cells[ “ComboColumn” ].CellEditorManager = new ComboBoxEditor();

    }

    Imported from legacy forums. Posted by André (had 300 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Andre!
    Thank you for advance.
    This issue salved my problem and now for each DataRow I can set and change WinComboBox values differently.
    Thank you very much.

    Imported from legacy forums. Posted by Igor (had 1091 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.