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

Adding an Image to GroupField

2 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 20 Aug 2008, 03:50 PM
Hi, i'm new to the controls and am just wondering if it's possable to add an image to the GroupByField or a checkbox at least for a project i'm doing any help would be appricated

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Aug 2008, 05:00 AM
Hi David,

Try the following code snippet to add an image to the GroupHeader of Grid.

CS:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridGroupHeaderItem) 
        { 
            GridGroupHeaderItem header = (GridGroupHeaderItem)e.Item; 
            Image img = new Image(); 
            img.ID = "Image1"
            img.ImageUrl = "~/Image1.gif"
            header.DataCell.Controls.Add(img); 
        } 
        
  
    } 


Thanks
Shinu.
0
David
Top achievements
Rank 1
answered on 21 Aug 2008, 08:01 AM
thanks will give that a go will see if i can pick up the DataKey item aswell so i can store diffrent images for each case of group header
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
David
Top achievements
Rank 1
Share this question
or