Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
how to set button cell caption during ADD new row
posted

Hi

I have a webgrid with a cell style button.

the cellbuttondisplay is set on ALWAYS and in the inizializerow event i use this code to set the button caption, but it does not work when the user add a NEW row.....

void WebGrid_InitializeRow(object sender, RowEventArgs e)

{

e.Row.Cells.FromKey("cmdPrint").Value = "Print";

 

}

Parents
  • 3732
    posted

    Hi,

    Have you set the column type to button? Here is a suggestion:

    protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)

    {

    e.Layout.Bands[0].Columns[1].Type = Infragistics.WebUI.UltraWebGrid.
    ColumnType.Button; //sets the column type to Button

    e.Layout.Bands[0].Columns[1].CellButtonStyle.BackColor = System.Drawing.Color.Red; //sets the back color of the cell

    e.Layout.Bands[0].Columns[1].CellButtonDisplay = Infragistics.WebUI.UltraWebGrid.CellButtonDisplay.Always;

    }

     

Reply Children