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
Tiled BackgroundImage of CellButton
posted

 Hi,

i am using a UltraGridColumn with ColumnType.Button for displaying an edit button within my UltraWebGrid. I want to use a 32*32 pixel image as Backgound of the button. The image should be displayed only once in the middle of the button. I don't won't a tiled Background image displayed on my button. How can i achieve this? Is there any hidden property or something else that would help me?

Here is the code with that i got a tiled background image:

 

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

col.CellStyle.VerticalAlign = VerticalAlign.Middle;

col.CellStyle.HorizontalAlign = HorizontalAlign.Center;

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

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

UltraWebGrid1.Columns.Add(col);

  • 45
    posted

    fixed by applying custom css rules to the cell style (not to the cellbutton style!)

     

    col.CellStyle.CustomRules = "Background-repeat:no-repeat; background-position:center;";