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

[Solved] Pdf with AlternatingItemStyle

2 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 22 Dec 2009, 09:34 AM
hi

How do i export to PDF with AlternatingItemStyle background Color?

here is my code and i m stuck here. Thanks

 

If TypeOf e.Item Is GridDataItem Then

 

 

Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)

 

 

For Each cell As TableCell In item.Cells

 

cell.Style(

"text-align") = "left"

 

cell.Style(

"font-size") = "10pt"

 

item.BackColor = RadGrid1.MasterTableView.AlternatingItemStyle.BackColor

 

Next

 

 

End If

 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Dec 2009, 09:50 AM
Hi,

Try checking for the ItemType for the items in the grid and then set the back color as shown below:

vb:
If e.Item.ItemType = GridItemType.AlternatingItem Then
    e.Item.BackColor = System.Drawing.Color.Red
End If


Hope this helps..
Princy.
0
Accepted
Daniel
Telerik team
answered on 22 Dec 2009, 10:08 AM
Hello Lui,

Please examine the following links:
Export to PDF demo
PDF export help topic

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Daniel
Telerik team
Share this question
or