Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
78
How to dynamically set SkinId of UltraWebGrid within a WebPanel?
posted

I have an UltraWebGrid nested within an Infragistics WebPanel on a page and would like to dynamically set the UltraWebGrid's SkinId based on an IsReadOnly property.

On the page's Page_PreInit event I have the following:

protected void Page_PreInit(object sender, EventArgs e)
{
        if(IsReadOnly) ultraWebGrid.SkinID = "GridReadOnly";
}

When the code runs, the ultraWebGrid object returns a null object exception when it is nested within the WebPanel.  If I place the ultraWebGrid object outside the WebPanel the SkinId is set to "GridReadOnly" as desired.

How do I dynamically set the SkinId of an ultra web grid when it is nested within an InfragIstics web panel?