Where can I find help with RadGrid

4 posts, 0 answers
  1. Perry
    Perry avatar
    62 posts
    Member since:
    Jul 2015

    Posted 30 Oct 2015 Link to this post

    I am trying to figure out how to use a RadGrid in a C# ASP.net 4.5 project that uses data entity framework version 6.  I can not seem to find good reliable up to date documentation on how to bind the entity framework to the Gridview.  I have started here http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-binding/understanding-data-binding/telerik-radgrid-data-binding-basics but can not find and information on using the data entity.  I found some documentation and videos that show dropping a data entity control from the toolbox and setting the properties of the control via the smart tag, but that functionality is not available in the 4.5 framework.

     

    Can some please provide some good resources that can assist me in transitioning from an ASP.net Gridview to the Telerik RadGridview?

     

    Thanks

  2. Perry
    Perry avatar
    62 posts
    Member since:
    Jul 2015

    Posted 30 Oct 2015 in reply to Perry Link to this post

    Sorry I forgot to show the code I have tried  here is what I am using

    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadGrid1">
    <UpdatedControls>
    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
    </UpdatedControls>
    </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="EntityDataSource1"
    GridLines="None" AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
    AllowSorting="true" Width="750px" OnItemCreated="RadGrid1_ItemCreated">
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView DataSourceID="EntityDataSourceProjectss" AutoGenerateColumns="False"
    DataKeyNames="LinkAnalysisId" CommandItemDisplay="Top">
    <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
    </telerik:GridEditCommandColumn>
    <telerik:GridBoundColumn DataField="LinkAnalysisId" HeaderText="LinkAnalysisId" SortExpression="LinkAnalysisId"
    UniqueName="LinkAnalysisId" Visible="false" MaxLength="5">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName"
    UniqueName="ContactName">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="LinkAnalysisName" HeaderText="LinkAnalysisName" SortExpression="LinkAnalysisName"
    UniqueName="LinkAnalysisName">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="LinkAnalysisDescription" HeaderText="LinkAnalysisDescription" SortExpression="LinkAnalysisDescription"
    UniqueName="LinkAnalysisDescription">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="DateCreated" HeaderText="DateCreated" SortExpression="DateCreated"
    UniqueName="DateCreated">
    </telerik:GridBoundColumn>
    </Columns>
    <EditFormSettings>
    <EditColumn ButtonType="ImageButton" />
    </EditFormSettings>
    </MasterTableView>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=CADWEntities"
    DefaultContainerName="CADWEntities" EntitySetName="LinkAnalysis" OrderBy="it.[DateCreated]"
    EntityTypeFilter="LinkAnalysis" EnableUpdate="True" EnableDelete="True" EnableInsert="True">
    </asp:EntityDataSource>
    </form>

    when I try to run this I get this error message:

    Compiler Error Message: CS1061: 'ASP.telerikgv_aspx' does not contain a definition for 'RadGrid1_ItemCreated' and no extension method 'RadGrid1_ItemCreated' accepting a first argument of type 'ASP.telerikgv_aspx' could be found (are you missing a using directive or an assembly reference?)

     

    Thanks

    Perry

  3. Perry
    Perry avatar
    62 posts
    Member since:
    Jul 2015

    Posted 30 Oct 2015 in reply to Perry Link to this post

    I figured out the problem I had to remove the 'RadGrid1_ItemCreated' from the ASPX.  The Gridview is now working properly.  Next I have to figure out how to filter the data with a where clause.
  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2357 posts

    Posted 04 Nov 2015 Link to this post

    Hello Perry,

    If you would like more information on using RadGrid with EntityDataSource you would find the following article interesting.


    Moreover, check out the following online example that illustrates how you can use sorting and filtering when the RadGrid is bound to an EntityDataSource.



    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top