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

display image next to group by column name

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
eslam
Top achievements
Rank 1
eslam asked on 11 Jul 2011, 12:36 PM
i want to know how to display image next to group by column name

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Jul 2011, 01:11 PM
Hello Eslam,

Try the following code snippet in ItemCreated event to add images to group header.

C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
  {
     if (e.Item is GridGroupHeaderItem)
         {
             GridGroupHeaderItem groupHeader= (GridGroupHeaderItem)e.Item;
             Image img = new Image();
             img.ID = "image1";
             img.ImageUrl = "images/edit.jpg";
             groupHeader.Cells[0].Controls.Add(img);
         }
   }

Thanks,
Princy.
Tags
Grid
Asked by
eslam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or