radDropDownListElement, What is getting fired.

2 posts, 0 answers
  1. Stephan
    Stephan avatar
    33 posts
    Member since:
    Jun 2012

    Posted 02 Aug 2012 Link to this post



    I am using a ribbonbar and under my view tab I have a Theme Section with a radDropDownListElement.  I loaded it with all the Themes I want to allow, but when I run the application the following occurs.
    the default value is blank, I would like it to show my current setting.
    When I click on the dropdown all the themes I entered are visable.
    When I select one the value changes visually on the screen to what is selected.
    I have put breaks in the code below, but the application never stops.



    private void radDropDownListElement1_SelectedValueChanged(object sender, EventArgs e)






        ThemeResolutionService.ApplicationThemeName = radDropDownListElement1.Name;





    private void radDropDownListElement1_Click(object sender, EventArgs e)





        ThemeResolutionService.ApplicationThemeName = radDropDownListElement1.Name;



    So the long and the short is how do I capture what is selected to get the theme to change for the user.


  2. Stefan
    Stefan avatar
    2891 posts

    Posted 07 Aug 2012 Link to this post

    Hello Stephan,

    Thank you for writing.

    Here is a small example that provides the desired functionality (assuming that you have the themes already loaded):
    public partial class Form1 : Form
        public Form1()
            radDropDownListElement1.SelectedIndex = radDropDownListElement1.FindString("ControlDefault");
            radDropDownListElement1.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(radDropDownListElement1_SelectedIndexChanged);
        void radDropDownListElement1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
            ThemeResolutionService.ApplicationThemeName = radDropDownListElement1.SelectedText;

    Let me know if you need further assistance with this case.

    Kind regards,
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. DevCraft banner
Back to Top