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

image in radgridview row

3 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
andi
Top achievements
Rank 1
andi asked on 29 Jan 2008, 01:44 PM
hi!

i want to have an image displayed in the grids rows. there should be different images displayed depending on the columns value. haw can i handle this?

thanks, andreas

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 29 Jan 2008, 03:11 PM
Hello Andreas,

You can do this by using the CellFormatting event. In order to set an image to a specific position use the Image and ImagePosition properties of the GridCellElement accordingly. Consider the code snippet below:

AddHandler Me.RadGridView1.CellFormatting, AddressOf RadGridView1_CellFormatting 
Private Sub RadGridView1_CellFormatting(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) 
    e.CellElement.Image = myImage 
    e.CellElement.ImagePosition = ImagePositions.Center 
End Sub 
 

Don't hesitate to contact us if you have other questions.

Regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
andi
Top achievements
Rank 1
answered on 29 Jan 2008, 03:21 PM
thank you for the code. but i want just a certain cell to display an image. how can i do this?


thanks, andreas
0
andi
Top achievements
Rank 1
answered on 29 Jan 2008, 03:28 PM
ok, i solved the problem. i can do this by using the columnIndex property!
Tags
GridView
Asked by
andi
Top achievements
Rank 1
Answers by
Jack
Telerik team
andi
Top achievements
Rank 1
Share this question
or