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

Where can I find help with RadGrid

3 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Perry
Top achievements
Rank 1
Perry asked on 30 Oct 2015, 04:29 PM

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

3 Answers, 1 is accepted

Sort by
0
Perry
Top achievements
Rank 1
answered on 30 Oct 2015, 04:32 PM

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

0
Perry
Top achievements
Rank 1
answered on 30 Oct 2015, 06:57 PM
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.
0
Viktor Tachev
Telerik team
answered on 04 Nov 2015, 12:35 PM
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
Tags
Grid
Asked by
Perry
Top achievements
Rank 1
Answers by
Perry
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or