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

Type 'ASP.customradgrid_ascx' does not have a public property named 'MasterTableView'.

2 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simone
Top achievements
Rank 1
Simone asked on 02 May 2011, 10:33 PM
Trying to wrap the radgrid as a custom control in an ASCX control file but I'm not having much luck.
I was able to set the datasource, and get data, but I'm trying to customize the columns now, and it  doesn't recognize MasterTableView 

How do I do this?
Thanks,
Simone


<%@ Page Title="" Language="vb" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="test.aspx.vb" Inherits="SMTProMockup.test" %>
<%@ Register TagPrefix="mockup" TagName="CustomRadGrid" Src="CustomRadGrid.ascx" %>

...
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <mockup:CustomRadGrid id="grdPrograms" runat="server" >
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Bottom" AutoGenerateColumns="False" FilterExpression="Active = true">
            <Columns>
                <telerik:GridCheckBoxColumn DataField="Active" FilterControlAltText="Filter Active column"
                    HeaderText="Active" ItemStyle-Width="50" DefaultInsertValue="true" UniqueName="Active">
                    <ItemStyle Width="50px"></ItemStyle>
                </telerik:GridCheckBoxColumn>
                <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" FilterControlWidth="150"
                    HeaderText="Name" >
                </telerik:GridBoundColumn>
            </Columns>


    </MasterTableView>
</mockup:CustomRadGrid>
</asp:Content>

2 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 05 May 2011, 09:20 AM
Hi Simone,

When you put RadGrid in a usercontrol, you do not automatically get the public grid properties as properties of the usercontrol. If you want to expose RadGrid properties through the user control, you need to implement identical properties in the usercontrol code-behind.

Veli
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Edwin
Top achievements
Rank 1
answered on 30 Jun 2012, 05:46 PM
So how would you go about the FilterControlWinth property in this scenario, this is where I am stuck. Thanks
Tags
Grid
Asked by
Simone
Top achievements
Rank 1
Answers by
Veli
Telerik team
Edwin
Top achievements
Rank 1
Share this question
or