Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Buttons, RadioButton, CheckBox, etc > Difference between Radcheckbox and RadchechboxElement

Not answered Difference between Radcheckbox and RadchechboxElement

Feed from this thread
  • Divya avatar

    Posted on May 4, 2011 (permalink)

    Hi,
                 I have used Radcheckbox  i have RightToLeftChanged event ,but inside a ribbion bar group i have added RadCheckboxElement for that i dont have RightToLeftChanged event.Why is it so



    What is the difference can anyone explain me and how can i implement RightToLeftChanged event for RadCheckBoxElemnt.


    Thanks
    Divya

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on May 9, 2011 (permalink)

    Hi Divya,

    Thank you for your question.

    The difference between RadCheckBox and RadCheckBoxElement is that RadCheckBox inherits from RadControl and RadCheckBoxElement inherits from RadElement. RadControl itself inherits from the .NET framework class Control which provides the basic functionality for controls. RightToLeftChanged event is inherited from the Control class. RadElement represents visual element which is used to form the layout of any RadControl. For example: RadCheckBox is a RadControl and its main element is RadCheckBoxElement. This is how our Telerik Presentation Framework is designed. You can find more information about the TPF on this link.

    In your case, in order to be notified when the RightToLeft  property of the RadCheckBoxElement is changed, you should subscribe to the following event:
    checkBoxElement.RadPropertyChanged += new Telerik.WinControls.RadPropertyChangedEventHandler(checkBoxElement_RadPropertyChanged);
    void checkBoxElement_RadPropertyChanged(object sender, Telerik.WinControls.RadPropertyChangedEventArgs e)
    {
        if (e.Property == RadElement.RightToLeftProperty)
        {
           //your logic goes here
        }
    }

    I hope this helps. Feel free to ask if you have any additional questions.

    Greetings,
    Ivan Todorov
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.

    Reply

  • Divya avatar

    Posted on May 10, 2011 (permalink)

    Hi,
                I am getting error like checkboxelement_RadPropertyChanged does not exist .why is it so and like radcheckbox theme i want to write for radcheckboxelement how can i write


    For Radcheckbox i have written

    private

     

     

    void radCheckBox1_RightToLeftChanged(object sender, EventArgs e)

     

     

    {

     

     

     

    // ThemeResolutionService.LoadPackageResource("C:\\Documents and Settings\\Divya\\Desktop\\New Folder\\MyControlDefault.tssp");

     

     

     

    if (this.radCheckBox1.RightToLeft == System.Windows.Forms.RightToLeft.Yes)

     

     

    {

     

     

     

    this.radCheckBox1.ThemeName = "CheckBoxTheme";  //this is theme i hav created

     

     

    }

     

     

     

    else

     

    {

     

     

    this.radCheckBox1.ThemeName = "ControlDefault";

     

     

    }

     

     

     

    }



    now in the same way how can i write for radcheckboxelemnt because for radcheckbox i am not able to find themename property so can u explain how to do it



    Thanks
    Divya

    Reply

  • Ivan Todorov Ivan Todorov admin's avatar

    Posted on May 10, 2011 (permalink)

    Hello Divya,

    Below is the whole code of my Form1.cs example:
    using System.Windows.Forms;
    using Telerik.WinControls;
     
    namespace Samples
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                this.radCheckBoxElement1.RadPropertyChanged += new Telerik.WinControls.RadPropertyChangedEventHandler(radCheckBoxElement1_RadPropertyChanged);
            }
     
            void radCheckBoxElement1_RadPropertyChanged(object sender, Telerik.WinControls.RadPropertyChangedEventArgs e)
            {
                if (e.Property == RadElement.RightToLeftProperty)
                {
                    if (this.radCheckBoxElement1.RightToLeft)
                    {
                        ((RadControl)this.radCheckBoxElement1.ElementTree.Control).ThemeName = "MyControlDefault";
                    }
                    else
                    {
                        ((RadControl)this.radCheckBoxElement1.ElementTree.Control).ThemeName = "ControlDefault";
                    }
                }
            }
        }
    }

    Here you can see how to access the control that contains given element, as well as how to be notified when the RightToLeft property of RadElement has changed.

    I hope this helps. Feel free to ask if you have any further questions.

    Greetings,
    Ivan Todorov
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Buttons, RadioButton, CheckBox, etc > Difference between Radcheckbox and RadchechboxElement
Related resources for "Difference between Radcheckbox and RadchechboxElement"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]