I want to change Appearance.ImageBackground in grid.ClickCell eventhandler.
For example,
grid.ClickCell += new ClickCellEventHandler(Grid_ClickCell);
private void Grid_ClickCell(object sender, ClickCellEventArgs e) {
// e.Cell.Appearance.ImageBackground is already set image1.
e.Cell.Appearance.ImageBackground = image2;
}
But this code does not work! What's wrong with me?
Hello,
Based on the description of your scenario it seems to me that you want to apply specific appearance to a current edit cell. If so you could use ultraGrid1.DisplayLayout.Override.EditCellAppearance, instead of ClickCell. Also you should know that if the cell apples its default EditorWithText editor, it will puts a input TextBox over the cell which could covers your background image. In order to prevent this you could apply Style of the column to be FormattedTextEditor. You could use code like the following in InitializeLayout event of the grid:
e.Layout.Bands[0].Columns[0].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.FormattedTextEditor;
Please let me know if you have any further questions.