Welcome Guest Search | Active Topics | Sign In | Register

EO Web Grid Column Sort Error Options
Mah Elg
Posted: Monday, January 12, 2015 5:49:16 AM
Rank: Newbie
Groups: Member

Joined: 6/23/2012
Posts: 6
When Make Column Sort in Web Grid Runining Mode on Server, it make unlimited refresh and not stop.

Desgin Code
==========
<eo:StaticColumn DataField="RequestNo" HeaderText="Request No" Name="RequestNo" AllowSort="true" meta:resourcekey="RequestNo">
</eo:StaticColumn>

VB.net Code
=========
Protected Sub gridMails_ColumnSort(ByVal sender As Object, ByVal e As EO.Web.GridColumnEventArgs) Handles gridMails.ColumnSort
hdnSortColumn.Value = e.Column.DataField
If e.Column.SortOrder = EO.Web.SortOrder.Ascending Then
hdnSortType.Value = "ASC"
Else
hdnSortType.Value = "DESC"
End If

Dim ds As New Data.DataSet() = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(ConnectionString, _
"SearchRequestsInbox")

ClsRequest.GridLoadData(gridMails, ds, gridMails.CurrentPage, gridMails.PageSize, hdnSortColumn.Value, hdnSortType.Value)

End Sub


Public Sub GridLoadData(ByRef Grid1 As EO.Web.Grid, ByVal ds As Data.DataSet, Optional ByVal intPI As Integer = -1, Optional ByVal intPC As Integer = 0, Optional ByVal SortColumn As String = "", Optional ByVal SortType As String = "ASC")
ds.Tables(0).TableName = "tab2"

If intPI > -1 And intPC > 0 Then
Dim intIndex As Integer = (intPI * intPC)
Dim intCount As Integer = Math.Min((intPI * intPC) + intPC, ds.Tables(0).Rows.Count)

Dim dataView As New DataView(ds.Tables(0))
If SortColumn <> "" Then
dataView.Sort = SortColumn & " " & SortType
End If
Dim tmpTable As DataTable = dataView.ToTable()

'Dim tmpTable As Data.DataTable = ds.Tables(0).Clone()
Dim i As Integer = intIndex

While i < intCount

Dim newR As Data.DataRow = tmpTable.NewRow()
For j As Integer = 0 To tmpTable.Columns.Count - 1
newR(j) = ds.Tables(0).Rows(i)(j)
Next
tmpTable.Rows.Add(newR)

i += 1
End While

Grid1.DataSource = tmpTable
Else
Grid1.DataSource = ds.Tables(0)
End If

Grid1.RecordCount = ds.Tables(0).Rows.Count
Grid1.DataBind()

End Sub

Result
==========

Thanks

eo_support
Posted: Monday, January 12, 2015 10:41:08 AM
Rank: Administration
Groups: Administration

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

Your code by itself looks fine. So the problem must be somewhere else. You can try to compare our sample code with your code to see if you can find out what triggered the problem. If that does not reveal anything, you can try to isolate the problem into a test project and send the test project to us. Once we have that we will be happy to take a look. See here for details about sending test project to us:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!

eo_support
Posted: Wednesday, January 14, 2015 9:11:28 PM
Rank: Administration
Groups: Administration

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

We have looked into the sample code you sent to us and have confirmed this to be a bug. We will fix it and post an update as soon as possible.

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.