Custom toolbar for Gridview

2 posts, 0 answers
  1. sriparthu
    sriparthu avatar
    3 posts
    Member since:
    Jul 2011

    Posted 21 Jul 2015 Link to this post

    Is there any sample available for building a custom toolbar on gridview to add / edit rows,insert, delete and print? Any pointers is much appreciated.
  2. Dess
    Admin
    Dess avatar
    1607 posts

    Posted 23 Jul 2015 Link to this post

    Hello Sriparthu,

    Thank you for writing.

    There is no appropriate sample that I can suggest for your case. One possible solution is to create a UserControl and place RadGridView and all the necessary toolbar elements in it. An alternative approach is to insert a  StackLayoutElement in the GridViewElement.GroupPanelElement. Here is a sample code snippet which result is illustrated on the attached screenshot:
    StackLayoutElement stack = new StackLayoutElement();
    RadButtonElement exportButton = new RadButtonElement();
    exportButton.Text = "Export";
    exportButton.Click += exportButton_Click;
    RadButtonElement saveButton = new RadButtonElement();
    saveButton.Text = "Save";
    stack.Orientation = Orientation.Horizontal;
    stack.StretchHorizontally = true;
    stack.Children.Add(exportButton);
    stack.Children.Add(saveButton);
    stack.Margin = new Padding(0, 20, 0, 0);
    this.radGridView1.GridViewElement.GroupPanelElement.Children.First().Children.Add(stack);

    Note that this is just a sample approach and it may not cover all possible cases. Feel free to modify it on a way which suits your requirement best.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top