5 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 14 Mar 2013, 05:06 AM
Hi,
Try the following code.
C#:
Thanks,
Princy
Try the following code.
C#:
void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e){ if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; ImageButton edit = (ImageButton)item["EditColumn"].Controls[0]; edit.ImageUrl = "~/Images/img.gif"; }}Thanks,
Princy
0
Algo
Top achievements
Rank 1
answered on 14 Mar 2013, 03:07 PM
Hello Princy,
This isn't quite what i'm looking for, but maybe I wasn't being precise enough.
I have a grid, and i'm implementing a contextual menu on the grid's rows to be able to access the primary grid actions (edit, insert, delete) from there.
In the provided screenshot, the button in the grid is based on the theme and comes from the GridEditCommandColumn.
I need to be able to retrieve that image in order to use it in my contextual menu, so it matches with the GridEditCommandColumn's image, no matter what theme I am in.
Thanks!
This isn't quite what i'm looking for, but maybe I wasn't being precise enough.
I have a grid, and i'm implementing a contextual menu on the grid's rows to be able to access the primary grid actions (edit, insert, delete) from there.
In the provided screenshot, the button in the grid is based on the theme and comes from the GridEditCommandColumn.
I need to be able to retrieve that image in order to use it in my contextual menu, so it matches with the GridEditCommandColumn's image, no matter what theme I am in.
Thanks!
0
Princy
Top achievements
Rank 2
answered on 15 Mar 2013, 06:34 AM
Hi,
GridEditCommandColumn's image rendered is a SpriteImage. SpriteButtons are rendered as <input type="button" /> elements, but they have predefined CSS classes, which can be used to change their look and feel to resemble ImageButtons. Check the following help documentation which explains more about this.
CSS sprites
Thanks,
Princy
GridEditCommandColumn's image rendered is a SpriteImage. SpriteButtons are rendered as <input type="button" /> elements, but they have predefined CSS classes, which can be used to change their look and feel to resemble ImageButtons. Check the following help documentation which explains more about this.
CSS sprites
Thanks,
Princy
0
Algo
Top achievements
Rank 1
answered on 17 Mar 2013, 02:42 PM
Hello Princy,
I understand that sprite images are used throughout Telerik controls.
My problem here, is I have no idea where the image from this grid's column is taken from.
I need to be able to use the same image outside of a grid.
Can you give me an example/solution for this ?
Thanks!
I understand that sprite images are used throughout Telerik controls.
My problem here, is I have no idea where the image from this grid's column is taken from.
<telerik:GridEditCommandColumn ButtonType="ImageButton"/>I need to be able to use the same image outside of a grid.
Can you give me an example/solution for this ?
Thanks!
0
Algo
Top achievements
Rank 1
answered on 20 Mar 2013, 03:55 PM
If anyone is interested in the solution to this issue:
Retrieve the button's ImageUrl (Edit button in this example) :
Retrieve the button's ImageUrl (Edit button in this example) :
Telerik.Web.SkinRegistrar.GetWebResourceUrl(Page, typeof(RadGrid), String.Format("Telerik.Web.UI.Skins.{0}.Grid.Edit.gif", GetTheme()))