I have two rad grids on a page. The concept is the top grid gets the data at page load and the bottom one is empty at that time. On making some selections in the top grid and pressing a button to drag the selected ones to the bottom grid. Every thing works fine except that after making the drag the top grid doesn't loads the data from the next page in the pagination. To understand it better lets say I'v set the page size of the top grid as 8 and if make all of the them selected and dragged the top grid says "No records to display" even if there are more data available in next pages of the pagination. If I changes my code to make the pagesize of the grid as "pageSize = Me.dgProjects.PageSize" the top grid displays two more items if all 8 of the items on the first page is selected. But on selecting these two again the problem again begins as described above.
I'm a novice in ASp.NET. Please help me accordingly.
Thanks
Code is here
Protected Sub dgProjects_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles dgProjects.NeedDataSource
dgDataBind = True
Me.LoadSelectionList()
End Sub
Protected Sub LoadSelectionList()
Dim dg As Telerik.Web.UI.RadGrid
Dim ds As DataSet
Dim sortField As String = "name"
Dim sortOrder As String = "ASC"
Dim sortOrder1 As String = "DESC"
Dim filterExpression As String
Dim pageSize As Int16
Dim currentPageIndex As Int16
dg = Me.dgProjects
'pageSize = 8
pageSize = Me.dgProjects.PageSize
currentPageIndex = dg.CurrentPageIndex + 1
filterExpression = Me.dgProjects.MasterTableView.FilterExpression
If dg.MasterTableView.SortExpressions.Count > 0 Then
sortField = dg.MasterTableView.SortExpressions(0).FieldName
If (dg.MasterTableView.SortExpressions(0).SortOrder = GridSortOrder.Descending) Then
sortOrder = "DESC"
sortOrder1 = "ASC"
End If
Else
sortField = "name"
End If
ds = Project.getProjectsByUserId(userId, selectedVendors(), currentPageIndex, pageSize, filterExpression, sortField, sortOrder, Request.QueryString("Postingid"))
' Get # of rows in querry
' number of rows will be in table 0
' data will be in table 1
If ds.Tables.Count > 0 Then
Dim row As DataRow
For Each row In ds.Tables(0).Rows
dg.VirtualItemCount = Convert.ToInt32(row("rows"))
Next row
End If
dg.DataSource = ds.Tables(1)
If dgDataBind = True Then
dgDataBind = False
Else
dg.DataBind()
End If
Protected Sub dgProjects_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles dgProjects.ItemCreated
If TypeOf e.Item Is Telerik.Web.UI.GridFilteringItem Then
Dim filteringItem As Telerik.Web.UI.GridFilteringItem = CType(e.Item, Telerik.Web.UI.GridFilteringItem)
Dim box As TextBox
Dim myimage As Image
'box = CType(filteringItem("chkBox").Controls(0), TextBox)
'box.Visible = False
'myimage = CType(filteringItem("chkBox").Controls(1), Image)
'myimage.Visible = False
End If
End Sub
I'm a novice in ASp.NET. Please help me accordingly.
Thanks
Code is here
Protected Sub dgProjects_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles dgProjects.NeedDataSource
dgDataBind = True
Me.LoadSelectionList()
End Sub
Protected Sub LoadSelectionList()
Dim dg As Telerik.Web.UI.RadGrid
Dim ds As DataSet
Dim sortField As String = "name"
Dim sortOrder As String = "ASC"
Dim sortOrder1 As String = "DESC"
Dim filterExpression As String
Dim pageSize As Int16
Dim currentPageIndex As Int16
dg = Me.dgProjects
'pageSize = 8
pageSize = Me.dgProjects.PageSize
currentPageIndex = dg.CurrentPageIndex + 1
filterExpression = Me.dgProjects.MasterTableView.FilterExpression
If dg.MasterTableView.SortExpressions.Count > 0 Then
sortField = dg.MasterTableView.SortExpressions(0).FieldName
If (dg.MasterTableView.SortExpressions(0).SortOrder = GridSortOrder.Descending) Then
sortOrder = "DESC"
sortOrder1 = "ASC"
End If
Else
sortField = "name"
End If
ds = Project.getProjectsByUserId(userId, selectedVendors(), currentPageIndex, pageSize, filterExpression, sortField, sortOrder, Request.QueryString("Postingid"))
' Get # of rows in querry
' number of rows will be in table 0
' data will be in table 1
If ds.Tables.Count > 0 Then
Dim row As DataRow
For Each row In ds.Tables(0).Rows
dg.VirtualItemCount = Convert.ToInt32(row("rows"))
Next row
End If
dg.DataSource = ds.Tables(1)
If dgDataBind = True Then
dgDataBind = False
Else
dg.DataBind()
End If
Protected Sub dgProjects_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles dgProjects.ItemCreated
If TypeOf e.Item Is Telerik.Web.UI.GridFilteringItem Then
Dim filteringItem As Telerik.Web.UI.GridFilteringItem = CType(e.Item, Telerik.Web.UI.GridFilteringItem)
Dim box As TextBox
Dim myimage As Image
'box = CType(filteringItem("chkBox").Controls(0), TextBox)
'box.Visible = False
'myimage = CType(filteringItem("chkBox").Controls(1), Image)
'myimage.Visible = False
End If
End Sub