Hi,
I have spent few hours trying to find a solution to retrieve the current data (DataRowView) from the ItemDataBinding event. This event is bound to a Table control that sits in the subreport. When I step into the code during debug process, I noticed that the DataObject and RawData returns null value. Does anyone know how to access the DataRowView object in this event?
What I done is to dynamically assign a predefined SqlDataSource in the constructor and hook the ItemDataBinding event to the Table. The code looks like below:
public SubReport(string connectionString, string Id){
SqlDataSource1.Parameters[0].Value = Id;
SqlDataSource1.ConnectionString = connectionString;
TableReport.DataSource = SqlDataSource1;
TableReport.ItemDataBinding += new EventHandler(TableReport_ItemDataBinding);
}
Does anyone have idea how can I work around this issue?
Thanks in advance
Kyle
I have spent few hours trying to find a solution to retrieve the current data (DataRowView) from the ItemDataBinding event. This event is bound to a Table control that sits in the subreport. When I step into the code during debug process, I noticed that the DataObject and RawData returns null value. Does anyone know how to access the DataRowView object in this event?
What I done is to dynamically assign a predefined SqlDataSource in the constructor and hook the ItemDataBinding event to the Table. The code looks like below:
public SubReport(string connectionString, string Id){
SqlDataSource1.Parameters[0].Value = Id;
SqlDataSource1.ConnectionString = connectionString;
TableReport.DataSource = SqlDataSource1;
TableReport.ItemDataBinding += new EventHandler(TableReport_ItemDataBinding);
}
private
void TableReport_ItemDataBinding(object sender, EventArgs e)
{
Telerik.Reporting.Processing.
ReportItemBase item = (Telerik.Reporting.Processing.ReportItemBase)sender;
string daysAnalysis = item.DataObject["intDaysAnalysis"].ToString(); ----> This line throws exception where item.DataObject is null
}
Does anyone have idea how can I work around this issue?
Thanks in advance
Kyle