I have created a User Control that extends the DEVExpress ASPxGridView. My goal is to have this control be a template (style settings, shared properties) for all the times I would but the GridView somewhere, but instead of having to add the properties and Styles, I could use it as a template. All other properties, events, etc would be inherited from the base class
Here is my ascx.cs code
namespace CORE.Web.UserControls
{
public partial class ucGridView : DevExpress.Web.ASPxGridView.ASPxGridView
{
}
}
and the ascx code
<dx:ASPxGridView ID="gcGridView" runat="server" AutoGenerateColumns="False" Styles-AlternatingRow-Enabled="True">
<Settings HorizontalScrollBarMode="auto" VerticalScrollBarMode="auto" VerticalScrollableHeight="500" />
<SettingsPager PageSize="20">
<PageSizeItemSettings Visible="true" ShowAllItem="true" />
</SettingsPager>
<SettingsBehavior AllowFocusedRow="true" />
<Styles>
<Header VerticalAlign="Top" Wrap="True"></Header>
<AlternatingRow Enabled="True"></AlternatingRow>
</Styles>
and where it is put in the aspx page
<uc1:ucGridView runat="server" ID="ucGridView" DataSourceID="masterStatsObjectDataSource" />
There are other issues, like columns and whatever that know I will deal with, but I am hitting a roadblock just getting it to work at runtime
I get this error message
'CORE.Web.UserControls.ucGridView' is not allowed here because it does not extend class 'System.Web.UI.UserControl'.
Line 1 of the aspx page is
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucGridView.ascx.cs" Inherits="CORE.Web.UserControls.ucGridView" %>
I am not sure where to go from here, as this should be easy. Any help would be greatly appreciated.
Thanks