4 Answers, 1 is accepted
0

Gimmik
Top achievements
Rank 1
answered on 01 Jun 2011, 09:08 PM
Hi Rastin,
Which RadControls are you using? Do you just need to know how to set a button image dynamically.
-Gimmik
Which RadControls are you using? Do you just need to know how to set a button image dynamically.
-Gimmik
0

rastin
Top achievements
Rank 1
answered on 02 Jun 2011, 06:18 AM
Hi Gimmik
i used RadListView
thankful.
i used RadListView
thankful.
0
Accepted

Gimmik
Top achievements
Rank 1
answered on 03 Jun 2011, 04:07 PM
Hi Rastin,
I've been looking into the issue. This should be possible to do. I think the key is going to be wiring-up the PreRender event for the RadImageButton to set the ImageURL. You'll have to access the cell in whichever RadControl you are using that contains the file name for the image. I made an example using a RadGrid. The file name is in column 0, and that file name is used to create the URL for the RadImageButton which is in column 1 of the same row.
I hope this is clear - let me know if you have questions.
-Gimmik
I've been looking into the issue. This should be possible to do. I think the key is going to be wiring-up the PreRender event for the RadImageButton to set the ImageURL. You'll have to access the cell in whichever RadControl you are using that contains the file name for the image. I made an example using a RadGrid. The file name is in column 0, and that file name is used to create the URL for the RadImageButton which is in column 1 of the same row.
I hope this is clear - let me know if you have questions.
-Gimmik
protected
void
RadButton1_OnPreRender(
object
sender, EventArgs e)
{
RadButton btn = (sender
as
RadButton);
GridDataItem dataItem = btn.Parent.Parent
as
GridDataItem;
String filename = dataItem[
"filename"
].Text;
String fullPath =
"~/Image/"
+ filename;
btn.Image.ImageUrl = fullPath;
}
0

rastin
Top achievements
Rank 1
answered on 03 Jun 2011, 04:49 PM
very thankful Gimmik for your help.
thankful.
thankful.