This project is read-only.

Updating cell value

Oct 7, 2010 at 10:16 PM

I have multiple cells in which I create a combobox dynamically whenever the user clicks on it and the value of the actual cell on the grid will only be updated when the user clicks somewhere else. Graphically it works perfectly, but I'm trying to implement saving the grid to a binary file and was wondering if there was a way that when I select the value from the combobox it will automatically refresh the grid.


SourceGrid.Cells.Editors.ComboBox combo = new SourceGrid.Cells.Editors.ComboBox(typeof(string));
combo.StandardValues = list;
combo.EditableMode = SourceGrid.EditableMode.Focus | SourceGrid.EditableMode.SingleClick | SourceGrid.EditableMode.AnyKey;
combo.Control.DropDownStyle = ComboBoxStyle.DropDownList;
combo.Control.SelectedValueChanged += new EventHandler(combo_Click);
cell = new SourceGrid.Cells.Cell(dt.Rows[row][column].ToString(), combo);
this.reportViewsGrid[row, column] = cell;

Thanks in advance.

Oct 11, 2010 at 11:48 AM
I did not understand completely what is the problem that you are facing, but the idea should be to attach an event to combobox, and then do whatever you want when an event is received. 
So far from your code example looks like you attached combo_Click event to a dropdown, looks good for me. It's just a matter what you are trying to do in that event