MXDataGrid Sorting Probelms

S

Steve Bishop

My mxDataGrid doesn't sort, even if I set the properties to sort. When I
drag a SQL table onto my form, it works fine, but I'm working with ODBC
databases and it's not working. Paging works good, but not sorting. Can
someone put me in the right direction? Thanks.

<%@ Page Language="vb" %>
<%@ Register TagPrefix="wmx"
Namespace="Microsoft.Matrix.Framework.Web.UI"
Assembly="Microsoft.Matrix.Framework, Version=0.6.0.0, Culture=neutral,
PublicKeyToken=6f763c9966660626" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="Microsoft.Data.ODBC" %>
<script runat="server">

Sub Page_Load(source As Object, E As EventArgs)

Dim cn as OdbcConnection
cn = New
OdbcConnection("dsn=SOTAMAS90AUTO;uid=sys;pwd=Rangers;")
Dim mystring As String = "Select * FROM AR1_CustomerMaster"

Dim ObjAdapter As New OdbcDataAdapter(mystring, cn)

Dim ObjDataSet As New DataSet()

ObjAdapter.Fill(objDataSet, "dtAR1")

dgAR1.DataSource = objDataSet.Tables("dtAR1")
dgAR1.DataBind()

End Sub

</script>
<html>
<head>
</head>
<body>
<h3><font color="#000040">Bring in AR1 </font>
</h3>
<p>
</p>
<form runat="server">
<wmx:MxDataGrid id="dgAR1" runat="server" Width="700px"
AutoGenerateFields="False" Height="50px" HorizontalAlign="Center"
ForeColor="Navy" CellPadding="5" ShowFooter="True" BackColor="AliceBlue"
AllowSorting="True" AllowPaging="True">
<AlternatingItemStyle forecolor="White"
backcolor="Navy"></AlternatingItemStyle>
<FooterStyle backcolor="Navy"></FooterStyle>
<HeaderStyle forecolor="White"
backcolor="Navy"></HeaderStyle>
<Fields>
<wmx:BoundField DataField="CustomerNumber"
HeaderText="Customer No."></wmx:BoundField>
<wmx:BoundField DataField="CustomerName"
HeaderText="Customer Name"></wmx:BoundField>
<wmx:BoundField DataField="PhoneNumber"
HeaderText="Phone"></wmx:BoundField>
<wmx:BoundField DataField="EmailAddress"
HeaderText="Email"></wmx:BoundField>
</Fields>
</wmx:MxDataGrid>
<!-- Insert content here -->
</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top