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

Property values being overridden

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Delicious!
Top achievements
Rank 1
Delicious! asked on 10 Mar 2009, 09:56 PM
I'm trying to create a wrapped version of the RadGrid where I have properties provide my default values for certain properties.  This is to reduce need to adjust the properties on each and every page that utilizes the control. 

The issue I'm running into is that the values for AutoGenerateColumns, AllowSorting, and AllowPaging do not take effect when the control is rendered.  In other words, even though I have AutoGenerateColumns set to false, all columns are rendered. 

At what point in the Control LifeCycle can I specify values and not have them overridden?

public class RadGrid : Telerik.Web.UI.RadGrid 
    { 
        protected override void OnPreRender(EventArgs e) 
        { 
            base.OnPreRender(e); 
 
                AutoGenerateColumns = false
                AllowSorting = true
                AllowPaging = true
                EnableEmbeddedSkins = false
                Skin = "Cymetrix"
        }         
    } 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 11 Mar 2009, 03:48 PM
Hello Ohrange,

All properties, except the ones related to skinning, have to be set earlier, in Init. For more information, please refer to:

http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html

Greetings,
Dimo
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.
Tags
Grid
Asked by
Delicious!
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or