This is a migrated thread and some comments may be shown as answers.

[Solved] How to display both image and text in the edit column on RADGrid

1 Answer 266 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Flea#
Top achievements
Rank 1
Flea# asked on 29 Apr 2009, 02:43 PM
Hello,

I was wondering if it was possible to display both an image button and text within my edit column on the Ajax rad grid? For example I have the following edit column in my grid:

                <Columns> 
                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"   
                    EditImageUrl="~/Images/icons/Edit-small.gif"
                </Columns> 


It displays my icon nicely, but I would like to have it also display the word 'Edit' off to the right of the image; so that it would be [Image] Edit
 I can't seem to get it to have both ways; is this possible?

Thanks,
Flea

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Apr 2009, 04:00 AM
Hi Flea,

Try adding the ImageButton to the Edit column in the code behind and see whether it helps.

CS:
 
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        {  
         GridDataItem item=(GridDataItem)e.Item; 
         ImageButton imgBtn = new ImageButton(); 
         imgBtn.ID = "Image1"
         imgBtn.ImageUrl = "~/Images/Edit.gif"
         item["EditCommandColumn"].Controls.Add(imgBtn); 
        } 
    } 


Thanks
Shinu
Tags
Grid
Asked by
Flea#
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or