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

[Solved] Inheriting RadGrid

4 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ana
Top achievements
Rank 1
Ana asked on 17 Apr 2009, 11:56 AM
Hi, I'm trying to createmy custom grid control that inherits RadGrid. I want after binding my grid (with or without autogenerated columns) to add always three columns (for editing, selecting and deleting records) as last three grid's columns. What would be the bast way to do that? What RadGrid's event would be best to override? Thanks, Ana

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Apr 2009, 10:47 AM
Hello Ana,

I suggest you review those two links which explains what you should know when inheriting Telerik RadGrid :
http://www.telerik.com/help/aspnet-ajax/grdinheritance.html
http://www.telerik.com/help/aspnet-ajax/grdinheritgridcolumns.html

To achieve your goal I will suggest you override the OnInit event. Here is a code snippet showing how to achieve this:
    public class InheritedGrid : RadGrid 
    { 
        protected override void OnInit(EventArgs e) 
        { 
            this.ClientSettings.Selecting.AllowRowSelect = true
            this.Columns.Add(new GridEditCommandColumn()); 
            this.Columns.Add(new GridClientDeleteColumn()); 
            this.Columns.Add(new GridClientSelectColumn()); 
            base.OnInit(e); 
        } 
    } 

Kind regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ana
Top achievements
Rank 1
answered on 27 Apr 2009, 12:13 PM
Thanks for your reply! Still, these columns are first three columns, and I want them to be on the end. How to achieve that?
Ana
0
Georgi Krustev
Telerik team
answered on 28 Apr 2009, 08:36 AM
Hello Ana,

Thank you for getting back to us.

In my attempt to implement the required functionality I have created a test project. The three columns in it are rendered in the end of the grid. Please examine it and let me know if I can assist you additionally.

Greetings,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Doug Beard
Top achievements
Rank 1
answered on 02 Nov 2009, 03:07 PM
I WISH THIS FORUM HAD A DELETE BUTTON.
Post removed because I'm dim.
Tags
Grid
Asked by
Ana
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Ana
Top achievements
Rank 1
Doug Beard
Top achievements
Rank 1
Share this question
or