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

Image location in grid header

2 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
prayag ganoje
Top achievements
Rank 1
prayag ganoje asked on 11 May 2011, 11:23 PM
Hello,

 I have a grid. In which one of the column header I have added image in ItemDataBound event.

I observed that the image is added next to text.

Is it possible to change the location of image within column header ?

Also I wish to have more control on the space and alignment of the image ? 

2 Answers, 1 is accepted

Sort by
0
prayag ganoje
Top achievements
Rank 1
answered on 11 May 2011, 11:24 PM
Protected Sub rg_Edit_Report_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)
       If TypeOf e.Item Is GridHeaderItem Then
           Dim header As GridHeaderItem = DirectCast(e.Item, GridHeaderItem)
           header.Height = Unit.Pixel(8)
           Dim img As Image = New Image()
           img.ID = "Image1"
           img.ImageUrl = "~/Images/hp_logo.gif"
           img.CssClass = "HPLogo"
           header("CASE").Controls.Add(img)
       End If
   End Sub

Using above handler the image was added to it.
0
Shinu
Top achievements
Rank 2
answered on 12 May 2011, 05:28 AM
Hello Prayag,

Try the following CSS to change the position of the header image.
CSS:
.HPLogo
       {
           float:right;
       }

Thanks,
Shinu.
Tags
Grid
Asked by
prayag ganoje
Top achievements
Rank 1
Answers by
prayag ganoje
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or