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

Processing.DetailSection Problem

1 Answer 162 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alexis To Lai Mei
Top achievements
Rank 1
Alexis To Lai Mei asked on 19 Mar 2009, 09:40 AM

Hi

I just copy the code from another thread and convert it to vb.net. I want to get the "cateID" data in ItemDataBound event, however, it (sCurrentID) always receive null. Are there any mistake in my code
  
Private Sub detail_ItemDataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles detail.ItemDataBound

        Dim procDetail As Telerik.Reporting.Processing.DetailSection = CType(sender, Telerik.Reporting.Processing.DetailSection)
        Dim oRow As DataRowView = TryCast(procDetail.DataItem, DataRowView)

        Dim sCurrentID As String = TryCast(oRow("CateID"), String)
End Sub

Please help me, thx a lot.

Alexis

1 Answer, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 20 Mar 2009, 03:03 PM
Hi Alexis,

I do not notice anything wrong in the way you are using the processing item and its DataItem.

The only thing that bothers me is if the CateID column isn't of numeric type, integer for example. If that is the case your TryCast to string will always return null.

Also keep in mind that the DataItem property is obsolete, so consider using DataObject instead. For example item.DataObject("CateID") to get the value and then cast it to an appropriate type.

Write us if you need further assistance.

Greetings,
Milen
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Alexis To Lai Mei
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
Share this question
or