Welcome Guest Search | Active Topics | Sign In | Register

Grid and Sorting in Callback mode Options
Seltris
Posted: Thursday, July 24, 2008 2:49:30 AM
Rank: Member
Groups: Member

Joined: 10/4/2007
Posts: 20
Hi,

i've a problem with sorting (only in callback mode), when i make sort on column header the grid disappear.

I've try to reproduce problem but i'm only have with the data in xml file that i've attach.
Try the following code:

ASPX SOURCE
Code: HTML/ASPX
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Administration_Default" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!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>Pagina senza titolo</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table border="0" cellpadding="0" cellspacing="5" style="width: 100%">
                <tr>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        <eo:grid id="GridUsers" runat="server" allowpaging="True" bordercolor="Gainsboro"
                            borderwidth="1px" columnheaderascimage="00050204" columnheaderdescimage="00050205"
                            columnheaderdividerimage="00050203" columnheaderheight="24" enablekeyboardnavigation="True"
                            font-bold="False" font-italic="False" font-names="Tahoma" font-overline="False"
                            font-size="8.75pt" font-strikeout="False" font-underline="False" gridlinecolor="240, 240, 240"
                            gridlines="Both" itemheight="19" keyfield="UserId" pagerlabeltemplate="&nbsp;"
                            borderstyle="Solid" loadinghtml="" runningmode="Callback" scrollbars="None">
                    <FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
                    <ItemStyles>
                        <eo:GridItemStyleSet>
                            <ItemStyle CssText="background-color:whitesmoke;" />
                            <AlternatingItemStyle CssText="background-color:white;" />
                            <ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" />
                            <SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" />
                            <FixedColumnCellStyle CssText="" />
                            <CellStyle CssText="padding-left:8px;padding-top:2px;" />
                        </eo:GridItemStyleSet>
                    </ItemStyles>
                    <ColumnTemplates>
                        <eo:TextBoxColumn>
                            <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
                        </eo:TextBoxColumn>
                        <eo:DateTimeColumn>
                            <DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter"
                                DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                TitleRightArrowImageUrl="DefaultSubMenuIcon">
                                <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
                                <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
                                <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
                                <TitleArrowStyle CssText="cursor:hand" />
                                <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
                                <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
                                <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
                                <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
                                <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                            </DatePicker>
                        </eo:DateTimeColumn>
                        <eo:MaskedEditColumn>
                            <MaskedEdit ControlSkinID="None" TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
                            </MaskedEdit>
                        </eo:MaskedEditColumn>
                    </ColumnTemplates>
                    <ColumnHeaderHoverStyle CssText="background-image:url('00050202');padding-left:8px;padding-top:4px;" />
                    <Columns>
                        <eo:StaticColumn DataField="UserId" HeaderText="ID" Name="" Width="60">
                        </eo:StaticColumn>
                        <eo:StaticColumn AllowSort="True" DataField="Username" HeaderText="User">
                        </eo:StaticColumn>
                        <eo:StaticColumn AllowSort="True" DataField="Description" HeaderText="Description"
                            Text="">
                        </eo:StaticColumn>
                        <eo:StaticColumn AllowResize="False" DataField="UserType" HeaderText="Type" Name=""
                            Width="45">
                            <CellStyle CssText="TEXT-ALIGN: center" />
                        </eo:StaticColumn>
                        <eo:StaticColumn HeaderText="Grants" Width="60">
                            <CellStyle CssText="TEXT-ALIGN: center" />
                        </eo:StaticColumn>
                        <eo:StaticColumn AllowSort="True" DataField="CenterDescription" HeaderText="Centro">
                        </eo:StaticColumn>
                        <eo:StaticColumn AllowResize="False" DataField="eMail" HeaderText="E-Mail" Width="50">
                            <CellStyle CssText="TEXT-ALIGN: center" />
                        </eo:StaticColumn>
                        <eo:StaticColumn AllowSort="True" HeaderText="Contacts">
                        </eo:StaticColumn>
                        <eo:StaticColumn AllowResize="False" DataField="" HeaderText="Status" Width="50">
                            <CellStyle CssText="TEXT-ALIGN: center" />
                        </eo:StaticColumn>
                        <eo:EditCommandColumn>
                        </eo:EditCommandColumn>
                        <eo:DeleteCommandColumn>
                        </eo:DeleteCommandColumn>
                    </Columns>
                    <ColumnHeaderStyle CssText="background-image:url('00050201');padding-left:8px;padding-top:4px;" />
                </eo:grid>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>


VB SOURCE
Code: Visual Basic.NET
Partial Class Administration_Default
    Inherits BasePage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Me.SetRecordCount()
            Me.LoadUsersList(Nothing)
        End If
    End Sub

    Private Sub SetRecordCount()
        Dim SQL As String = "SELECT COUNT(*) FROM VI_WEB_USERS"
        Me.GridUsers.RecordCount = Me.DB.QueryValue(SQL)
    End Sub

    Private Sub LoadUsersList(ByVal Column As EO.Web.GridColumn)
        Dim SortField As String = "USERNAME"
        Dim SortDirection As String = "ASC"

        If Not Column Is Nothing AndAlso Column.DataField <> String.Empty Then
            SortField = Column.DataField
            SortDirection = IIf(Column.SortOrder = EO.Web.SortOrder.Ascending, "ASC", "DESC")
        End If

        Dim Source As DataTable = New DataTable("Test")
        Source.ReadXmlSchema("Schema.xml")
        Source.ReadXml("Data.xml")

        Me.GridUsers.DataSource = Source
        Me.GridUsers.DataBind()
    End Sub

    Protected Sub GridUsers_ColumnSort(ByVal sender As Object, ByVal e As EO.Web.GridColumnEventArgs) Handles GridUsers.ColumnSort
        Me.LoadUsersList(e.Column)
    End Sub

End Class


TABLE XML SCHEMA (Schema.xml)
Code: XML

<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Test" msdata:UseCurrentLocale="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Test">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="UserId" type="xs:int" minOccurs="0" />
              <xs:element name="UserType" type="xs:string" minOccurs="0" />
              <xs:element name="UserTypeDescription" type="xs:string" minOccurs="0" />
              <xs:element name="IsVisible" type="xs:int" minOccurs="0" />
              <xs:element name="Username" type="xs:string" minOccurs="0" />
              <xs:element name="Password" type="xs:string" minOccurs="0" />
              <xs:element name="Description" type="xs:string" minOccurs="0" />
              <xs:element name="CenterId" type="xs:int" minOccurs="0" />
              <xs:element name="CenterDescription" type="xs:string" minOccurs="0" />
              <xs:element name="EntityId" type="xs:int" minOccurs="0" />
              <xs:element name="EntityDescription" type="xs:string" minOccurs="0" />
              <xs:element name="FillingCenterId" type="xs:int" minOccurs="0" />
              <xs:element name="FillingCenterDescription" type="xs:string" minOccurs="0" />
              <xs:element name="VehicleId" type="xs:int" minOccurs="0" />
              <xs:element name="VehicleDescription" type="xs:string" minOccurs="0" />
              <xs:element name="PhoneNumber" type="xs:string" minOccurs="0" />
              <xs:element name="MobileNumber" type="xs:string" minOccurs="0" />
              <xs:element name="eMail" type="xs:string" minOccurs="0" />
              <xs:element name="LanguageCode" type="xs:string" minOccurs="0" />
              <xs:element name="LanguageDescription" type="xs:string" minOccurs="0" />
              <xs:element name="ExpiryDate" type="xs:dateTime" minOccurs="0" />
              <xs:element name="LastPasswordChangeDate" type="xs:dateTime" minOccurs="0" />
              <xs:element name="IsPasswordToBeRenewed" type="xs:boolean" minOccurs="0" />
              <xs:element name="OldPasswords" type="xs:string" minOccurs="0" />
              <xs:element name="LoginErrors" type="xs:int" minOccurs="0" />
              <xs:element name="IsLocked" type="xs:boolean" minOccurs="0" />
              <xs:element name="IsEnabled" type="xs:boolean" minOccurs="0" />
              <xs:element name="LastAccessDate" type="xs:dateTime" minOccurs="0" />
              <xs:element name="ID_US_INSERT" type="xs:int" minOccurs="0" />
              <xs:element name="DT_INSERT" type="xs:dateTime" minOccurs="0" />
              <xs:element name="ID_US_UPDATE" type="xs:int" minOccurs="0" />
              <xs:element name="DT_UPDATE" type="xs:dateTime" minOccurs="0" />
              <xs:element name="UI_SYNC" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>


TABLE DATA (Data.xml)
Code: XML

<DocumentElement>
  <Test>
    <UserId>1</UserId>
    <UserType>IUS</UserType>
    <UserTypeDescription>Internal user</UserTypeDescription>
    <IsVisible>2</IsVisible>
    <Username>admin</Username>
    <Password>nimda</Password>
    <Description>System Administrator</Description>
    <CenterDescription />
    <EntityDescription xml:space="preserve"> </EntityDescription>
    <FillingCenterDescription />
    <VehicleDescription />
    <LanguageCode>en-GB</LanguageCode>
    <LanguageDescription>English</LanguageDescription>
    <ExpiryDate>2099-12-31T00:00:00+01:00</ExpiryDate>
    <LastPasswordChangeDate>2008-07-11T18:24:03+02:00</LastPasswordChangeDate>
    <IsPasswordToBeRenewed>false</IsPasswordToBeRenewed>
    <LoginErrors>0</LoginErrors>
    <IsLocked>false</IsLocked>
    <IsEnabled>true</IsEnabled>
    <ID_US_INSERT>-1</ID_US_INSERT>
    <DT_INSERT>2008-07-11T18:24:53.933+02:00</DT_INSERT>
    <ID_US_UPDATE>-1</ID_US_UPDATE>
    <DT_UPDATE>2008-07-24T11:23:30.13+02:00</DT_UPDATE>
    <UI_SYNC>c4c63a6c-55a5-405c-b045-1622ba10df06</UI_SYNC>
  </Test>

  <Test>
    <UserId>-1</UserId>
    <UserType>SYS</UserType>
    <UserTypeDescription>System</UserTypeDescription>
    <IsVisible>1</IsVisible>
    <Username>System</Username>
    <Password />
    <Description>System</Description>
    <CenterDescription />
    <EntityDescription xml:space="preserve"> </EntityDescription>
    <FillingCenterDescription />
    <VehicleDescription />
    <LanguageCode />
    <LoginErrors>0</LoginErrors>
    <IsLocked>false</IsLocked>
    <IsEnabled>true</IsEnabled>
    <ID_US_INSERT>-1</ID_US_INSERT>
    <DT_INSERT>2008-07-11T18:26:58.68+02:00</DT_INSERT>
    <ID_US_UPDATE>-1</ID_US_UPDATE>
    <DT_UPDATE>2008-07-18T15:21:06.17+02:00</DT_UPDATE>
    <UI_SYNC>d2bfe10c-433a-48ae-8f4c-e6c29852808f</UI_SYNC>
  </Test>
</DocumentElement>


Thanks
eo_support
Posted: Thursday, July 24, 2008 3:11:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Thanks for posting in the forum. We will look into it and get back to you as soon as possible.
eo_support
Posted: Thursday, July 24, 2008 7:15:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

We looked into the issue. Try to add Width="100%" to your Grid. That should solve the problem for you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.