This is a migrated thread and some comments may be shown as answers.

[Solved] Colors on image-buttons in default skin

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 2
Iron
Iron
Iron
Morten asked on 18 Sep 2009, 05:29 PM
Hi,

I am using the default skin in a grid. The image-buttons in this skin are all in black/white. Is it possible to get them in color without using another skin?

Usually when I disable a button I change the image to black/white but all buttons are already black/white and I cant see if a button is disabled or not...

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Sep 2009, 10:32 AM
Hi Morton,

I guess you want to change the " Add New Record / Refresh " buttons when using Default skin. If so, one suggestion would be hiding these default imagebuttons and adding new custom imagebuttons with new images for showing the buttons are enabled.

C#:
 
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    if (e.Item is GridCommandItem) 
    { 
        // Hide the default buttons 
        GridCommandItem commanditem = (GridCommandItem)e.Item; 
        LinkButton lnkButton = (LinkButton)e.Item.FindControl("RebindGridButton"); 
        lnkButton.Visible = false
        lnkButton.Parent.Visible = false
        LinkButton btn2 = (LinkButton)commanditem.FindControl("InitInsertButton"); 
        btn2.Visible = false
        btn2.Parent.Visible = false;  
 
        // Create the imagebutton 
        ImageButton btn = new ImageButton(); 
        btn.ImageUrl = "../Images/MyImage.png"
        commanditem.Cells[0].Controls.Add(btn); 
    } 

-Shinu.
Tags
Grid
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Shinu
Top achievements
Rank 2
Share this question
or