WIthout setting anything I've got arrow for expandcollapsecolumn. I want to have minus/plus image for this column like in your live examples. I try to change
CollapseImageUrl
="/images/minus.gif" ExpandImageUrl="/images/plus.gif" pointing to images in my local,but Nothing happens.
4 Answers, 1 is accepted
0
Hi Peerapat,
I suggest that you add OnColumnCreated event for the grid and put the code snippet bellow for giving the expand/collapse image url at run time.
C#:
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I suggest that you add OnColumnCreated event for the grid and put the code snippet bellow for giving the expand/collapse image url at run time.
C#:
| if (e.Column is GridExpandColumn) |
| { |
| (e.Column as GridExpandColumn).ButtonType = GridExpandColumnType.ImageButton; |
| (e.Column as GridExpandColumn).ExpandImageUrl = "~/App_Themes/images/SinglePlus.gif"; |
| (e.Column as GridExpandColumn).CollapseImageUrl = "~/App_Themes/images/SingleMinus.gif"; |
| } |
I hope this helps.
Kind regards,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
peerapat
Top achievements
Rank 1
answered on 19 May 2009, 04:20 AM
Dear Pavlina,
This really works. I wonder why setting at design time doesn't. Anyway, thank you very much. One more question on this, how can I set mouse pointer to hand. Do I have to set CSS class?
Best regards,
This really works. I wonder why setting at design time doesn't. Anyway, thank you very much. One more question on this, how can I set mouse pointer to hand. Do I have to set CSS class?
Best regards,
0
Princy
Top achievements
Rank 2
answered on 19 May 2009, 04:45 AM
Hello Peerapat,
The cursor style should appear to be a pointer for the imagebutton in the ExpandColumn. I'm not sure as to why it does not work in your case but you could probably try out the following code to set the cursor style for the ExpandColumn images:
c#:
Thanks
Princy.
The cursor style should appear to be a pointer for the imagebutton in the ExpandColumn. I'm not sure as to why it does not work in your case but you could probably try out the following code to set the cursor style for the ExpandColumn images:
c#:
| protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| GridDataItem item = (GridDataItem)e.Item; |
| ImageButton imgbtn = (ImageButton)item["ExpandColumn"].Controls[0]; |
| imgbtn.Attributes.Add("onmouseover", "this.style.cursor = 'pointer';"); |
| } |
| } |
Thanks
Princy.
0
peerapat
Top achievements
Rank 1
answered on 19 May 2009, 05:12 AM
thank you very much for you quick resonse. Your code threw an error on line "ImageButton imgbtn = (ImageButton)item["ExpandColumn"].Controls[0]; "
Best regards,
Best regards,