Home Forums WinForms controls Xceed Grid for WinForms GridComboBox change to impact other rows?

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

    Hello all,
    Im running up against the following and Im somewhat stuck;
    I have a grid with some bound data. The grid has both edit and add-new row functionality enabled. To the bound data, I’m adding an unbound dropdown.

    Any changes in the dropdown have to change a string in another cell. So if the dropdown gets changed to “test1”, I need cell3.value to become “test1” as well.

    I’ve created a SelectedIndexChanged handler on my GridComboBox, but how do I then reference other cells in the same row to change them? Unlike AddingDataRow, I cant use use the eventargs to do e.DataRow.Cells[3].value=3…

    Is there a way to do this?

    Imported from legacy forums. Posted by japhar81 (had 1862 views)

    User (Old forums)
    Member
    Post count: 23064

    Instead of catching the SelectedIndexChanged event on the GridComboBox, you should catch the ValueChanged event on the cells of that column. Like this:<pre>grid.DataRowTemplate.Cells[“myColumn”].ValueChanged += new EventHandler(myCellValueChanged);
    private void myCellValueChanged(object sender, EventArgs e) {
    Cell cell = sender as Cell;
    CellRow row = cell.ParentRow;
    row.Cells[3].Value = …;
    }</pre>

    Imported from legacy forums. Posted by Tommy (had 2884 views)

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