Hi !
We have a req'ment to display import file names in Col 1 of a Grid (WinGrid, UltraGrid, ??).
Col 2 of that grid is to contain, repeated in every cell of that column, a button labeled "Load".
I have so far been able to accomplish this by setting the Style property to "Button", but at
runtime the button appears/disappears with focus in that row, we'd like the buttons labelled
"Load" to be static, always visible.
How best to accomplish Buttons in every cell of a column ? UltraButton ? or ??
I have had more success with checkboxes and selecting UltraCheckBox1 for the EditorControl
property, but this doesn't appear to be the solution for Command Buttons. How is
this best accomplished for Command Buttons in the cells of a grid ?
Thank you,
XPXJ
There is a ButtonDisplayStyle on the column that will let you control this:
this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].ButtonDisplayStyle = ButtonDisplayStyle.Always;
-Matt
That does it. Great. Thank you.
Now . . . how is Caption/Text of the Button set . . .
and what event is fired when the Button is clicked ?
The text of a cell button is picked up from the string representation of the value of the cell. You could initialize the text of each button using the InitializeRow event, such as:
private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e){ e.Row.Cells[1].Value = "Button " + e.Row.Index.ToString();}
As for determining when a cell button is clicked, use the grid's ClickCellButton event.