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

SplitContainer Click Event

1 Answer 127 Views
SplitContainer
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 09 Feb 2015, 04:31 PM
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.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 12 Feb 2015, 01:24 PM
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.

 
Tags
SplitContainer
Asked by
Daniel
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or