The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

ES with ASPxGrid for Master-Detail

Last post 12-17-2007, 7:04 PM by paschoal1. 3 replies.
Sort Posts: Previous Next
  •  12-10-2007, 5:34 PM 7096

    ES with ASPxGrid for Master-Detail

    Are there any examples of using ES with DevExpress ASPxGrid to create a master-detail grid? Also, is the esDataSource the best method?
  •  12-17-2007, 4:01 PM 7239 in reply to 7096

    Re: ES with ASPxGrid for Master-Detail

    I think the DevX grid has issues really, I took the sample that was sent to me but it was bound to another version of DevX. So I copied the code basically out of the aspx and code behind and it works, however, they do not seem to play well with DataSourceControls in design mode.

    Here is the code, it does show data, but I hand coded it:

     

    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
    
    <%@ Register Assembly="DevExpress.Web.ASPxGridView.v7.2, Version=7.2.4.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
        Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
    <%@ Register Assembly="DevExpress.Web.ASPxEditors.v7.2, Version=7.2.4.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
        Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
        
    <%@ Register Assembly="EntitySpaces.Web" Namespace="EntitySpaces.Web" TagPrefix="cc1" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="EsDataSource1" KeyFieldName="EmployeeID">
                <Columns>
                    <dxwgv:GridViewDataTextColumn FieldName="EmployeeID" ReadOnly="True" VisibleIndex="0">
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="LastName" VisibleIndex="1">
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="FirstName" VisibleIndex="2">
                    </dxwgv:GridViewDataTextColumn>
                </Columns>
            </dxwgv:ASPxGridView>          
            <br />
            <cc1:esDataSource ID="EsDataSource1" runat="server" OnesSelect="EsDataSource1_esSelect" />
        
        </div>
        </form>
    </body>
    </html>
    

     

     

    Code:
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    using BusinessObjects;
    
    public partial class Default2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    
        protected void EsDataSource1_esSelect(object sender, EntitySpaces.Web.esDataSourceSelectEventArgs e)
        {
            EmployeesCollection coll = new EmployeesCollection();
            coll.LoadAll();
    
            // Assign the esDataSourcSelectEvenArgs Collection property
            e.Collection = coll;
        }
    }
    
     
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  12-17-2007, 4:27 PM 7240 in reply to 7239

    Re: ES with ASPxGrid for Master-Detail

    Thanks. I will give it a try.

    Also, version 7.3.5 was released this week.

     

     

  •  12-17-2007, 7:04 PM 7243 in reply to 7240

    Re: ES with ASPxGrid for Master-Detail

    Maybe the errors could be this:

    Uninstaling one version and instaling another version of DevExpress could be the problem.

    Things to take care:

    1) Look at the toolbar of the Visual Studio and See if the AspGridView is the same version that you installed. (Sometimes two different versions of aspgridview exists in toolbar). If there are any incorrect version in toolbar delete it.

    2) WebConfig needs to have the Add assembly of the correct DevExpress version and the PublicToken must be correct.

View as RSS news feed in XML