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

Custom toolbar for Gridview

1 Answer 186 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sriparthu
Top achievements
Rank 1
sriparthu asked on 21 Jul 2015, 07:08 AM
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.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Jul 2015, 01:09 PM
Hello ,

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
Tags
GridView
Asked by
sriparthu
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or