Skinning CommandField

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

I'm using Themes with asp.net 2.0 and i have a command field(in a gridview)
like this:

<asp:CommandField ButtonType=Image ShowDeleteButton= true
DeleteImageUrl="~/App_Themes/Theme1/Images/button-delete.gif"/>

My current Theme is "Theme1" but how about if i change the theme to any
other?. I have to change "deleteimageurl" too. How can i avoid this?.

JJ
 
I've tried using:

DeleteImageUrl='<%# "~/App_Themes/" + this.Page.Theme + "/images/" +
"button-delete.gif" %>'

But it won't allow me to do this with this type of control.

There must be some way of skinning this part of the Gridview..?

??
 
Didn't find any soluion to this, so I ended up changing the button control's
parameters (e.g. imageURL) in the 'onRowCreated' event, in the code behind
file.

JJ
 
Back
Top