4 Answers, 1 is accepted
0
Accepted

Princy
Top achievements
Rank 2
answered on 20 Jan 2009, 04:56 AM
Hello Matt,
You can access the button for the GridButtonColumn in the code behind, add a CssClass to it and specify the background url in the class accordingly.
cs:
style.css:
For information on Sprite Buttons, you can refer to this link.
Thanks
Princy.
You can access the button for the GridButtonColumn in the code behind, add a CssClass to it and specify the background url in the class accordingly.
cs:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem) |
{ |
((ImageButton)dataItem["ButtonColumn"].Controls[0]).CssClass = "Button"; |
} |
} |
style.css:
<style type="text/css"> |
.Button |
{ |
background-image:url('image'); |
} |
</style> |
For information on Sprite Buttons, you can refer to this link.
Thanks
Princy.
0

MD
Top achievements
Rank 1
answered on 21 Jan 2009, 03:13 PM
Thanks for the response Princy.
I was wondering though is there a way of handling this declaratively? When I try to assign the CssClass for the ItemStyle ('rgDel' or 'rgEdit' for instance) of a GridButtonColumn declaratively and set the ButtonType to ImageButton or PushButton it never appears correctly. It will either show a regular button with the image hidden behind it or in the case of the imagebutton it will show two images stacked and slightly off one another.
Thanks
I was wondering though is there a way of handling this declaratively? When I try to assign the CssClass for the ItemStyle ('rgDel' or 'rgEdit' for instance) of a GridButtonColumn declaratively and set the ButtonType to ImageButton or PushButton it never appears correctly. It will either show a regular button with the image hidden behind it or in the case of the imagebutton it will show two images stacked and slightly off one another.
Thanks
0

MD
Top achievements
Rank 1
answered on 26 Jan 2009, 09:23 PM
Does anybody know if this is possible?
Thanks
Thanks
0
Hello Matt,
ItemStyle properties are applied to the table cell, while you need to set a CssClass to something inside the cell. For the time being this is not supported declaratively, however, we will implement it for our next release - a ButtonCssClass property for the GridButtonColumn.
In the meantime, you can implement Princy's suggestion.
Kind regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
ItemStyle properties are applied to the table cell, while you need to set a CssClass to something inside the cell. For the time being this is not supported declaratively, however, we will implement it for our next release - a ButtonCssClass property for the GridButtonColumn.
In the meantime, you can implement Princy's suggestion.
Kind regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.