RadSplitButtonElement Question

2 posts, 0 answers
  1. Kenneth Jackson
    Kenneth Jackson avatar
    60 posts
    Member since:
    Dec 2007

    Posted 12 Mar 2009 Link to this post

    Here is a sample of a quick test project I made to represent the issue I am having ...

        public Form1()

          RadSplitButtonElement btnAttachFileDocument;
          btnAttachFileDocument = new RadSplitButtonElement();
          btnAttachFileDocument.Text = "Attach File";
          btnAttachFileDocument.Click += new EventHandler(btnAttachFileDocument_Click);
          btnAttachFileDocument.DropDownOpened += new EventHandler(btnAttachFileDocument_DropDownOpened);
          RadLabelElement oMenuItem;

          oMenuItem = new RadLabelElement();
          oMenuItem.Text = "Cover Sheet";
          oMenuItem.Click += new EventHandler(oMenuItem_Click);

          oMenuItem = new RadLabelElement();
          oMenuItem.Text = "Master Waybill Doc";



        void oMenuItem_Click(object sender, EventArgs e)
          this.Text = "Cover Sheet Clicked";

        void btnAttachFileDocument_DropDownOpened(object sender, EventArgs e)
          this.Text = "DropDown";

        void btnAttachFileDocument_Click(object sender, EventArgs e)
          this.Text = "Clicked";

    I have 2 issues .


    Firstly I cannot get a seperate event when clicking the dropdown arrow of the button or when clicking the button itself.

    I want to generate a default click event if the user clicks the button but if he opens the drop down I want to wait for him

    to select the appropriate item from the list. At the moment I always get the click event when the dropdown opens. How

    do I prevent this ?


    Secondly , with the splitbutton control I can mouseover the dropdown arrow and button seperately and it highlights them
    seperately . WIth the splitbuttonelement that I add to the ribbonbar however it always highlights it all as one control always
    and I can only ever see the Image regardless of the textimage relation I setup . My text is always invisible ...


  2. Victor
    Victor avatar
    1349 posts

    Posted 13 Mar 2009 Link to this post

    Hi Kenneth Jackson,

    Thank you for writing.

    You can distinguish the events of the split button by subscribing to the Click events of the ActionButton and ArrowButton. For instance:

    this.radSplitButton1.DropDownButtonElement.ArrowButton.Click += new EventHandler(ArrowButton_Click);  
    this.radSplitButton1.DropDownButtonElement.ActionButton.Click += new EventHandler(ActionButton_Click); 

    As to your other question, the split button highlights as a whole because there is a glitch with the theme for the RadRibbonBar. This is only a visual issue, split button functions in exactly the same way.
    Please write back if you need further assistance.

    Best wishes,
    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top