SplitContainer Click Event

2 posts, 0 answers
  1. Daniel
    Daniel avatar
    2 posts
    Member since:
    Jun 2010

    Posted 09 Feb 2015 Link to this post

    Good afternoon.

    I'm trying to programatically click the splitter button of an splitcontainer, but i can't.

    I tried with performclick, but it does'nt works.

    Thanks for help.
  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 12 Feb 2015 Link to this post

    Hi Daniel,

    Thank you for writing.

    Firing a Click event on a navigation button of a SplitterElement involves calling a complex logic considering the collapsing and the expanding of panels, their direction and state.

    On a more general level I understand that you need to programmatically collapse or expand a SplitPanel. You can easily achieve this task by setting the value of the Collpased property of the SplitPanel. Please see my code snippet below:
    private void radButton1_Click(object sender, EventArgs e)
    {
        if (this.radSplitContainer1.SplitPanels.First().Collapsed)
        {
            this.radSplitContainer1.SplitPanels.First().Collapsed = false;
        }
        else
        {
            this.radSplitContainer1.SplitPanels.First().Collapsed = true;
        }
    }

    I am also sending you a gif file showing the result on my end.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top