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

Databinding Issue

2 Answers 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 1
Andy Green asked on 08 Oct 2009, 10:37 AM
Hi
 
I have a report with the databinding at runtime.
 
This code displays a blank report even on hitting the report refresh icon.
 
Public Sub New()
InitializeComponent()
Dim fs As New CPSMDAL.JobPlan
Dim fsDT As DataTable = fs.JobPlanReport(JobPlan_ID)
Me.DataSource = fsDT
End Sub
 
However this still displays a blank report, but on hitting the refresh icon it does display the full report.

 

Public Sub New()
InitializeComponent()
End Sub

 

 


Private
Sub JobPlan_Frontsheet_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
Dim fs As New CPSMDAL.JobPlan
Dim fsDT As DataTable = fs.JobPlanReport(JobPlan_ID)
Me.DataSource = fsDT
End Sub

 

If I debug the code, the recordset has 15 members, why isn't it binding.

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 08 Oct 2009, 04:28 PM
Hi Andy,

As noted in the Adding a Data Source through NeedDataSource report event help article, you should use the processing report object when in the context of an event:

Private Sub JobPlan_Frontsheet_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
Dim fs As New CPSMDAL.JobPlan
Dim fsDT As DataTable = fs.JobPlanReport(JobPlan_ID)
(TryCast(sender, Telerik.Reporting.Processing.Report)).DataSource = fsDT
End Sub


Greetings,
Steve
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.
0
Andy Green
Top achievements
Rank 1
answered on 09 Oct 2009, 08:03 AM
Thnaks.

Sorry I missed that.

Andy
Tags
General Discussions
Asked by
Andy Green
Top achievements
Rank 1
Answers by
Steve
Telerik team
Andy Green
Top achievements
Rank 1
Share this question
or