I try to create a custom command ultrawingrid column that includes some ultrabuttons such as "edit button", "delete button", "show detail button"....
I want to add this column to grid at runtime.
I need your urgent help!
Thanks. It worked
As I said above, you would set the Value of the cell in the InitializeRow event. Something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridColumn delColumn = e.Layout.Bands[0].Columns.Add("Del"); delColumn.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button; delColumn.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always; } private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells.Exists("Del")) { e.Row.Cells["Del"].Value = "Del"; } }
thanks for your replay.
My mean is, in this column(DeletingColumn), we need button for handle edit/delete event,so our code like above wrote.
this way can add a column with buttons,but I cann't add text on the button.like the image below.Did have any way to do this? if possible, give me some sample code.thanks.
What kind of button style are you referring to? I don't know what you mean by style.
Regarding the text, you can set the Value of the cell, just as you would for any other cell. The InitializeRow event is a good place to do this.
DeletingColumn.CellButtonDisplay = CellButtonDisplay.Always;
DeletingColumn.Width = 45;
uwdList.Bands[0].Columns.Add(DeletingColumn);
//////
Here can change button style only, How can I add text on the button?
please give some sample code.thanks