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

Telerik.Reporting.Processing.CheckBox

1 Answer 221 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Leran Liu
Top achievements
Rank 1
Leran Liu asked on 26 Feb 2009, 05:38 AM
Hi, I am running into this problem:

if i use the Telerik.Reporting.checkbox, i can set the value to true or false, then the checkbox will show its value.  however, i am running a loop through the XML to find checkbox value.  however, the checkbox is not shown being checked. 

here is my code:  what really tricks me is in the ele is Telerik.Reporting.Processing.CheckBox please let me know where i did wrong. 

 Telerik.Reporting.Processing.DetailSection processingDetail = (Telerik.Reporting.Processing.DetailSection)sender;
 foreach (Telerik.Reporting.Processing.ReportItem item in processingDetail.Items)
 {
     if (item is Telerik.Reporting.Processing.Panel)
     {
         Telerik.Reporting.Processing.Panel pan = (Telerik.Reporting.Processing.Panel)item;
         foreach (Telerik.Reporting.Processing.ProcessingElement ele in pan.ChildElements)
         {
             if (ele is Telerik.Reporting.Processing.TextBox)
             {
                 if (ele.Name == node.Attributes["Flag"].Value.ToString().Replace("$#", "").Replace("#$", ""))
                 {
                     Telerik.Reporting.Processing.TextBox txt = (Telerik.Reporting.Processing.TextBox)ele;
                     txt.Value = node.InnerText;
                 }
             }
             if (ele is Telerik.Reporting.Processing.CheckBox)
             {
                 if (ele.Name == node.Attributes["Flag"].Value.ToString().Replace("$#", "").Replace("#$", ""))
                 {
                     Telerik.Reporting.Processing.CheckBox chk = (Telerik.Reporting.Processing.CheckBox)ele;
                     if (node.InnerText == "X")
                     {
                         chk.Value = System.Windows.Forms.CheckState.Checked;
                     }
                     else
                     {
                         chk.Value = System.Windows.Forms.CheckState.Unchecked;
                     }
                 }
             }
         }
     }

 }

Many Thanks

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 26 Feb 2009, 01:09 PM
Hi Leran Liu,

As you can verify from the TrueValue and FalseValue properties of a checkbox item - it expects true/false by default. So you would have to either set true/false for it or change the TrueValue/FalseValue to:

checkBox1.TrueValue = System.Windows.Forms.CheckState.Checked;
checkBox1.FalseValue = System.Windows.Forms.CheckState.Unchecked;

Best wishes,
Steve
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
Leran Liu
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or