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
45
Backgound image of CellButton lost after Postback
posted

Hi,

i have a Problem with the UltraWebGrid component. In the PageLoad event handler i add an UltraGridColumn (cellbutton) with a background image dynamically to the grid. After the first Page Load event the button is displayed correct. But when a PostBack occurs the column looses it's BackgroungImage property as i can see via debugging. Only an empty is shown on the page as a consequence. Can anybody explain me what the reason of this strange behavior is?protected void Page_Load(object sender, EventArgs e)

{

   if (!IsPostBack)

  {

     UltraGridColumn col = new UltraGridColumn("icon", null, ColumnType.Button, null);

     col.CellStyle.BackgroundImage = "./App_Themes/Them1/Images/Edit.ico";

     col.CellStyle.BackColor = col.CellStyle.ForeColor = System.Drawing.Color.Transparent;

     col.CellButtonDisplay = CellButtonDisplay.Always;

     col.CellButtonStyle.BorderStyle = BorderStyle.None;

      col.CellButtonStyle.BorderWidth = Unit.Pixel(0);

      col.CellButtonDisplay = CellButtonDisplay.Always;

      col.CellStyle.TextOverflow = TextOverflow.Ellipsis;

      col.ChangeLinksColor = false;

      UltraWebGrid1.Columns.Add(col);

   }

}

 

Thanks, Christian

Parents Reply Children
No Data