The EntitySpaces Community

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

Example of DevExpress ASPxGrid

Last post 12-17-2007, 3:21 PM by econner. 10 replies.
Sort Posts: Previous Next
  •  12-11-2007, 12:01 PM 7119

    Example of DevExpress ASPxGrid

    Does anyone have an example of using the DevExpress ASPxGrid with the EntitySpaces esDataSource? I have a sample with the ASP.NET Gridview working with esDataSource but when I try to use the DevExpress version, the control is returning empty. Both the ASP.NET and DevExpress versions are tied to the same esDataSource. Below is the source code for both grids.

    [Edit] This is using the latest ES version as well as DevExpress v. 7.3.4 [/Edit]

    Code:
    <body>
        <form id="form1" runat="server">
        <div>
            <cc1:esDataSource ID="EsDataSource1" runat="server"
                LowLevelBind="True" OnesSelect="EsDataSource1_esSelect" AutoPaging="True" AutoSorting="True" />
        
        </div>
        
            <asp:GridView ID="GridView1" runat="server"  AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="RFQItemID" DataSourceID="EsDataSource1" ForeColor="#333333" GridLines="None">
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <Columns>
                    <asp:BoundField DataField="RFQItemID" HeaderText="RFQItemID" InsertVisible="False"
                        ReadOnly="True" SortExpression="RFQItemID" />
                    <asp:BoundField DataField="Sku" HeaderText="Sku" SortExpression="Sku" />
                </Columns>
                <RowStyle BackColor="#EFF3FB" />
                <EditRowStyle BackColor="#2461BF" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
    
            <br />
    
            <dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False"
                DataSourceID="EsDataSource1" KeyFieldName="RFQItemID">
                <Columns>
                    <dxwgv:GridViewDataTextColumn FieldName="RFQItemID" VisibleIndex="0">
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="Sku" VisibleIndex="1">
                    </dxwgv:GridViewDataTextColumn>
                </Columns>
            </dxwgv:ASPxGridView>
            
        </form>
    </body>
     

     

  •  12-11-2007, 9:02 PM 7126 in reply to 7119

    Re: Example of DevExpress ASPxGrid

    I created (or rather tried) a DevX AspXGrid and had the same problem:

     

    Code:
    <dxwg:ASPxGrid ID="ASPxGrid1" runat="server" DataSourceID="EsDataSource1" TabIndex="0" AutoGenerateColumns="False" DataKeyField="EmployeeID">
    <FooterStyle FixedHeight="True" FixedWidth="True" />
    <StatusBars>
    <dxwg:StatusBar Height="20px" StatusBarType="Regular">
    <BarItems>
    <dxwdc:BarStatusSection StatusSectionType="Status">
    </dxwdc:BarStatusSection>
    <dxwdc:BarStatusSection StatusSectionType="VisibleInterval">
    </dxwdc:BarStatusSection>
    <dxwdc:BarStatusSection StatusSectionType="TotalVisible">
    </dxwdc:BarStatusSection>
    <dxwdc:BarStatusSection StatusSectionType="TotalRows">
    </dxwdc:BarStatusSection>
    </BarItems>
    </dxwg:StatusBar>
    </StatusBars>
    <GroupItemStyle FixedWidth="True" Wrap="False">
    </GroupItemStyle>
    <HeaderStyle FixedHeight="True" FixedWidth="True" Wrap="False" />
    <SearchBtnStyle FixedWidth="True">
    </SearchBtnStyle>
    <ItemStyle FixedWidth="True" Wrap="False" />
    <Columns>
    <dxwg:BoundColumn DataField="EmployeeID" HeaderText="EmployeeID" VisibleIndex="0">
    </dxwg:BoundColumn>
    <dxwg:BoundColumn DataField="LastName" HeaderText="LastName" VisibleIndex="1">
    </dxwg:BoundColumn>
    <dxwg:BoundColumn DataField="FirstName" HeaderText="FirstName" VisibleIndex="2">
    </dxwg:BoundColumn>
    <dxwg:BoundColumn DataField="Title" HeaderText="Title" VisibleIndex="3">
    </dxwg:BoundColumn>
    <dxwg:BoundColumn DataField="BirthDate" HeaderText="BirthDate" VisibleIndex="4">
    </dxwg:BoundColumn>
    <dxwg:BoundColumn DataField="City" HeaderText="City" VisibleIndex="5">
    </dxwg:BoundColumn>
    </Columns>
    </dxwg:ASPxGrid>

     

    Strange as we bind so well with their Windows.Forms stuff, it must be something we are not setting on the control in designer mode? Do their forums have any samples of binding to DataSourceControls? 

    Thier controls seem to have a memory problem for sure, it pulls the columns from our esDataSource design time, then you toggle to source from design and come back and they are gone. Perhaps they don't play well with DataSourceControls, there really aren't that many in existence because they're such a nightmare to create.
     


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  12-12-2007, 9:30 PM 7144 in reply to 7126

    Re: Example of DevExpress ASPxGrid

    They have an example of using the AcessDataSource for a master-detail table (http://www.devexpress.com/Products/NET/WebForms/ASPxGridView/tutorials/Lesson4/ASPxGridViewLesson-4.html).

    However, I was able to get the master-detail working without using esDataSource and instead binding directly. 

    Thanks for testing.

     

     

  •  12-13-2007, 4:01 AM 7149 in reply to 7144

    Example of DevExpress ASPxGrid

    It works for me: here is the complete example. But I don't use the LowLevelBind="True" in esDataSource

    .aspx

    Code:
    1    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="teste3.aspx.cs" Inherits="Relatorios_teste3" %>
    2    
    3    <%@ Register Assembly="DevExpress.Web.ASPxEditors.v7.3, Version=7.3.3.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
    4        Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
    5    
    6    <%@ Register Assembly="DevExpress.Web.ASPxGridView.v7.3, Version=7.3.3.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
    7        Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
    8    
    9    <%@ Register Assembly="EntitySpaces.Web" Namespace="EntitySpaces.Web" TagPrefix="cc1" %>
    10   
    11   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    12   
    13   <html xmlns="http://www.w3.org/1999/xhtml" >
    14   <head runat="server">
    15       <title>Untitled Page</title>
    16   </head>
    17   <body>
    18       <form id="form1" runat="server">
    19           <cc1:esDataSource ID="EsDSCliente" runat="server" OnesSelect="EsDSCliente_esSelect" />
    20           <dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="EsDSCliente" KeyFieldName="IdCliente">
    21               <Columns>
    22                   <dxwgv:GridViewDataTextColumn FieldName="IdCliente" ReadOnly="True" VisibleIndex="0">
    23                   </dxwgv:GridViewDataTextColumn>
    24                   <dxwgv:GridViewDataTextColumn FieldName="Nome" VisibleIndex="1">
    25                   </dxwgv:GridViewDataTextColumn>
    26                   <dxwgv:GridViewDataTextColumn FieldName="Apelido" VisibleIndex="2">
    27                   </dxwgv:GridViewDataTextColumn>
    28               </Columns>
    29           </dxwgv:ASPxGridView>
    30       </form>
    31   </body>
    32   </html>
    

    .cs#

    Code:
    1    public partial class Relatorios_teste3 : System.Web.UI.Page
    2    {
    3        protected void Page_Load(object sender, EventArgs e)
    4        {
    5    
    6        }
    7        protected void EsDSCliente_esSelect(object sender, EntitySpaces.Web.esDataSourceSelectEventArgs e) {
    8            ClienteCollection coll = new ClienteCollection();
    9    
    10           coll.Query.OrderBy(coll.Query.IdCliente.Descending);
    11   
    12           coll.LoadAll();
    13   
    14           // Assign the esDataSourcSelectEvenArgs Collection property
    15           e.Collection = coll;
    16       }
    17   }
     
     
  •  12-13-2007, 6:02 AM 7151 in reply to 7149

    Re: Example of DevExpress ASPxGrid

    I tried again and followed your example. It still didnt work for me.

    However, I am running a newer version of DevExpress (7.3.4) and it is the trial version. The trial version shouldn't prevent it from working since it is working fine if I manually bind to the grid. 

    Mike, what version did you test with?

     

  •  12-13-2007, 6:16 AM 7154 in reply to 7151

    Re: Example of DevExpress ASPxGrid

    well, my version of devExpress is Version=7.3.3.0
  •  12-13-2007, 6:16 AM 7155 in reply to 7154

    Re: Example of DevExpress ASPxGrid

    I downloaded their trial about a month ago, I will post the version tonight

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  12-13-2007, 5:42 PM 7169 in reply to 7155

    Re: Example of DevExpress ASPxGrid

    I am using "Developer Express.NET v7.2"

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  12-13-2007, 5:53 PM 7170 in reply to 7169

    Re: Example of DevExpress ASPxGrid

    Paschoal, can you create an app sometime against a single table that works and send the app to support@entityspaces.net. I cannot get it to work no matter what?

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  12-14-2007, 5:12 AM 7176 in reply to 7170

    Re: Example of DevExpress ASPxGrid

    Sure. on the way.

    I send now

  •  12-17-2007, 3:21 PM 7236 in reply to 7176

    Re: Example of DevExpress ASPxGrid

    Mike, was Paschoal able to provide you an example of using ASPxGridView with esDataSource?

    I have created my master-detail grid by manually binding the data but I would also like to compare it with using the esDataSource if possible.

    Thanks 

     

     

View as RSS news feed in XML