Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DevExpress Datasource and ASP .Net MVC

Posted on 2011-02-24
1
Medium Priority
?
1,825 Views
Last Modified: 2012-05-11
How to integrate DevExpress into the MVC code below since I don't have a datasource but a model instead?

<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dxrp" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxMenu" TagPrefix="dxm" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxSiteMapControl" TagPrefix="dxsm" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxNavBar" TagPrefix="dxnb" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dxtc" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxClasses" tagprefix="dxw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxHeadline" TagPrefix="dxhl" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>

<%@ Page Title="" Language="C#" MasterPageFile="Demo.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcApplication1.Models.Project>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phContent" runat="server">

       <dxwgv:ASPxGridView ID="grid" DataSourceID???? ClientInstanceName="grid" runat="server" KeyFieldName="SupplierID" Width="100%">
            <%-- BeginRegion Grid Columns --%>
            <Columns>
                <dxwgv:GridViewDataColumn FieldName="ContactName" VisibleIndex="1">
                </dxwgv:GridViewDataColumn>
                <dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="2">
                </dxwgv:GridViewDataColumn>
                <dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="2">
                </dxwgv:GridViewDataColumn>
                <dxwgv:GridViewDataColumn FieldName="Region" Visible="false">
                </dxwgv:GridViewDataColumn>
                <dxwgv:GridViewDataColumn FieldName="Country" VisibleIndex="3">
                </dxwgv:GridViewDataColumn>
            </Columns>
         </dxwgv:ASPxGridView>
    <h2>Index</h2>

    <table>
        <tr>
            <th></th>
            <th>
                ProjectID
            </th>
            <th>
                ProjectNumber
            </th>
            <th>
                ProjectTitle
            </th>
            <th>
                StartDate
            </th>
            <th>
                EndDate
            </th>
            <th>
                MinLatitude
            </th>
            <th>
                MaxLatitude
            </th>
            <th>
                MinLongitude
            </th>
            <th>
                MaxLongitude
            </th>
            <th>
                MinAltitude
            </th>
            <th>
                MaxAltitude
            </th>
            <th>
                ObjectiveCode
            </th>
            <th>
                TracerID
            </th>
            <th>
                TracerInfo
            </th>
            <th>
                AnalyticalErrors
            </th>
            <th>
                ProjectReferences
            </th>
            <th>
                SummaryInfo
            </th>
            <th>
                TCProjectNumber
            </th>
            <th>
                DistributionRestricted
            </th>
            <th>
                CheckStatus
            </th>
            <th>
                Complete
            </th>
            <th>
                DateEntered
            </th>
            <th>
                DateChanged
            </th>
            <th>
                DateExported
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id=item.ProjectID }) %> |
                <%: Html.ActionLink("Details", "Details", new { id=item.ProjectID })%> |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.ProjectID })%>
            </td>
            <td>
                <%: item.ProjectID %>
            </td>
            <td>
                <%: item.ProjectNumber %>
            </td>
            <td>
                <%: item.ProjectTitle %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.StartDate) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.EndDate) %>
            </td>
            <td>
                <%: item.MinLatitude %>
            </td>
            <td>
                <%: item.MaxLatitude %>
            </td>
            <td>
                <%: item.MinLongitude %>
            </td>
            <td>
                <%: item.MaxLongitude %>
            </td>
            <td>
                <%: item.MinAltitude %>
            </td>
            <td>
                <%: item.MaxAltitude %>
            </td>
            <td>
                <%: item.ObjectiveCode %>
            </td>
            <td>
                <%: item.TracerID %>
            </td>
            <td>
                <%: item.TracerInfo %>
            </td>
            <td>
                <%: item.AnalyticalErrors %>
            </td>
            <td>
                <%: item.ProjectReferences %>
            </td>
            <td>
                <%: item.SummaryInfo %>
            </td>
            <td>
                <%: item.TCProjectNumber %>
            </td>
            <td>
                <%: item.DistributionRestricted %>
            </td>
            <td>
                <%: item.CheckStatus %>
            </td>
            <td>
                <%: item.Complete %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.DateEntered) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.DateChanged) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.DateExported) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

Open in new window

0
Comment
Question by:DistillingExperts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
Praveen Kumar earned 2000 total points
ID: 34977036
You shuold not use ASP.NET controls in MVC application.

check the following link:
http://somewebguy.wordpress.com/2009/08/07/webcontrols-in-mvc-part-2/
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question