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

How to use a Checkbox in a report

1 Answer 525 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 28 Jan 2015, 12:05 PM
For a textbox I use

Private Sub nvcQuestion_ItemDataBound(sender As Object, e As EventArgs) Handles nvcQuestion.ItemDataBound
Dim txt As Telerik.Reporting.Processing.TextBox = DirectCast(sender, Telerik.Reporting.Processing.TextBox)
Dim dataObject As Telerik.Reporting.Processing.IDataObject = DirectCast(txt.DataObject, Telerik.Reporting.Processing.IDataObject)
If DirectCast(dataObject("nvcqQuestion"), String) <> "" Then
   txt.Value = dataObject("nvcqQuestion").ToString()
End If
End Sub

For a Checkbox I tried something like the following

Private Sub bitTitle_ItemDataBound(sender As Object, e As EventArgs) Handles bitTitle.ItemDataBound
Dim txt As Telerik.Reporting.Processing.CheckBox = DirectCast(sender, Telerik.Reporting.Processing.CheckBox)
Dim dataObject As Telerik.Reporting.Processing.IDataObject = DirectCast(txt.DataObject, Telerik.Reporting.Processing.IDataObject)
If DirectCast(dataObject("bitTitle"), CheckBox) = True Or False Then
   txt.Checked = dataObject("bitTitle") ????????
End If
End Sub

Can anyone point out the problem and what the correct syntax is?
Thanks,
John

1 Answer, 1 is accepted

Sort by
0
Hinata
Top achievements
Rank 1
answered on 30 Jan 2015, 12:49 PM
Hi John,

The correct way is to get rid of those events and use the report designer to create the checkbox.
You can find more information on these forums why to avoid events and the rest is in the help:
Report Designers
Checkbox
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Hinata
Top achievements
Rank 1
Share this question
or