Hello all, I'm writing my very first Telerik report. I am trying to hook up one of the parameters to a "Business Object" datasource.
My datasource is defined as:
My report parameter is defined as (from the report codebehind):
When i run the report in the browser, in the area where the report would normally render, it tells me: "The expression contains object 'Fields.Value' that is not defined in the current context." I have tried using Value, Fields.Value, Item.Value, ... and just can't figure out what to put for the DisplayMember and ValueMember to get them to pull the Text and Value properties of the ListItem objects respectively. I even tried leaving them blank, but then it tells me: "Parameter 'DeviceId' has defined AvailableValues, but no ValueMember is specified. Use 'Item' if binding to Array."
Can someone tell me what to put for the DisplayMember and ValueMember properties???
Thanks in advance!
My datasource is defined as:
Namespace DataObjects |
Public Class DropDowns |
Public Shared ReadOnly Property Intervals() As List(Of ListItem) |
Get |
Dim lic = New ListItemCollection() |
lic.Add(New ListItem("Raw", "0")) |
lic.Add(New ListItem("15 Minutes", "0.25")) |
lic.Add(New ListItem("30 Minutes", "0.5")) |
lic.Add(New ListItem("1 Hour", "1")) |
lic.Add(New ListItem("6 Hours", "6")) |
lic.Add(New ListItem("12 Hours", "12")) |
lic.Add(New ListItem("1 Day", "24")) |
Return (From li As ListItem In lic Select li).ToList |
End Get |
End Property |
End Class |
End Namespace |
My report parameter is defined as (from the report codebehind):
reportParameter1.Name = "DeviceId" |
reportParameter1.Type = Telerik.Reporting.ReportParameterType.[Integer] |
reportParameter1.UI.AllowBlank = False |
reportParameter1.UI.AvailableValues.DataMember = "Intervals" |
reportParameter1.UI.AvailableValues.DataSource = GetType(DataObjects.DropDowns) |
reportParameter1.UI.AvailableValues.DisplayMember = "Fields.Text" |
reportParameter1.UI.AvailableValues.ValueMember = "Fields.Value" |
reportParameter1.UI.Visible = True |
Me.ReportParameters.Add(reportParameter1) |
When i run the report in the browser, in the area where the report would normally render, it tells me: "The expression contains object 'Fields.Value' that is not defined in the current context." I have tried using Value, Fields.Value, Item.Value, ... and just can't figure out what to put for the DisplayMember and ValueMember to get them to pull the Text and Value properties of the ListItem objects respectively. I even tried leaving them blank, but then it tells me: "Parameter 'DeviceId' has defined AvailableValues, but no ValueMember is specified. Use 'Item' if binding to Array."
Can someone tell me what to put for the DisplayMember and ValueMember properties???
Thanks in advance!