We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Values being lost in Cell

I''ve created a drop down combo box model and renderer for a custom combo box that we''re using. For some reason, it appears to have trouble saving the value. I have a checkbox that works in the same way that doesn''t have this problem and I can''t figure it out. I handle the SelectedIndexChanged event in the renderer as follows: private void EditComboBoxSelectedIndexChanged(object sender, System.EventArgs e) { // We need to ignore the messages we get while drawing is taking place. if (inDraw_) { return; } if (base.NotifyCurrentCellChanging()) { MozartGrid grid = this.Grid as MozartGrid; GridStyleInfo style = grid[grid.CurrentCell.RowIndex, grid.CurrentCell.ColIndex]; style.CellValue = editComboBox_.SelectedValue; base.NotifyCurrentCellChanged(); } } I also tried simply setting ControlValue = editComboBox_.SelectedValue, but I wasn''t entirely sure which was the best way to go. Either way produces the same result. After changing the selection in the combo box, when the OnDraw comes around, the CellValue is set to an empty string, not the value that that was placed into the style in the SelectedIndexChanged event. I have no other place in my code that "should" be modifying the value, though I''m certainly open to that possibility. I was just hoping maybe the above code might be the culprit and you guys may see where I''m screwing up. Thanks.

1 Reply

AD Administrator Syncfusion Team October 13, 2004 01:15 PM UTC

I solved the problem. It looks like I wasn''t handling ApplyFormattedText() properly.

Loader.
Live Chat Icon For mobile
Up arrow icon