Dear all,
Currently, I have set the ultragridcell to be URL and with text to be "X" meaning Delete line with event below.
protected void dataGrid_AfterCellActivate(object sender, EventArgs e) { Infragistics.Win.UltraWinGrid.UltraGridCell activeCell = this.dataGrid.ActiveCell; int colindex = activeCell.Column.Index; long lineNum = Convert.ToInt64(this.dataGrid.Rows[activeCell.Row.Index].Cells["ItemID"].Value.ToString()); if(colindex==0) { if (evtItemDelete != null) evtItemDelete(this, new StoreServer.VO.EventArguments.EvtArgsItemList(lineNum)); }
Now I need to change the ultragridcell to be Image and can trigger the action when click on it. How to do??
Hi,
I'm not sure I am exactly clear on what you want.
If you want to make a cell display an image, there are a couple of ways to do it. One way would be to set the Style on the Cell to Image. This would make the cell display the Value of that cell an an Image. So this would only work if the DataType of the column is one that contains images, such as System.Drawing.Image or System.Drawing.Bitmap.
Another option would be to use the Appearance of the cell to provide an Image or ImageBackground. You would probably also want to set the Activation property on the cell so it doesn't go into edit mode.
To trap when the user clicks on the cell is easy, just use the ClickCell event of the grid.
I am using windows form 2010-3 versions.
And I only want some ultragridcell to be image with action, not all cells in the columns.
I have taken a look some link about attaching ultratexteditor to the cell.EditorControl. But I don't find "EditorControl" attribute. Is it a solution? Do you know why??