Add a header to RadGridView with Add, Edit, Delete buttons

2 posts, 0 answers
  1. Pavel
    Pavel avatar
    32 posts
    Member since:
    Sep 2016

    Posted 17 Nov 2016 Link to this post

    I would like to add an Add, Edit and Delete buttons to the RadGridView, similar to what is seen in this ASP.NET Ajax control

    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/commanditem/defaultcs.aspx

    Is this possible in WinForms without too much hassle? I am not a fan of the current appearance of just having RadButtons above.
  2. Dimitar
    Admin
    Dimitar avatar
    2949 posts

    Posted 18 Nov 2016 Link to this post

    Hi Pavel,

    The easiest way would be to add the buttons to the group panel:
    private void RadButton1_Click(object sender, EventArgs e)
    {
        radGridView1.GridViewElement.GroupPanelElement.Text = "";
        StackLayoutPanel panel = new StackLayoutPanel();
        panel.Orientation = Orientation.Horizontal;
        panel.StretchHorizontally = true;
     
        for (int i = 0; i < 10; i++)
        {
            RadButtonElement button = new RadButtonElement();
            button.Text = "test";
            panel.Children.Add(button);
        }
        radGridView1.GridViewElement.GroupPanelElement.Children.Add(panel);
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
Back to Top