C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

Grid filtering slow downs the grid loding


Posted Date: 05 Sep 2008      Posted By: bhakti      Member Level: Gold     Points: 1   Responses: 1



in my application i have to use these much of filtering on diffrnt controls
i have used 6 checkedits,two combo's and 2 radio buttons. After changing any values of these control i have to execute all the following commands...
now the problem is it take very much time to load grid, it slow downs my application. I want to resolve this problem how to do this..


GridViewBooking.ClearColumnsFilter()
GridViewBooking.Columns("TourID").FilterInfo = New Columns.ColumnFilterInfo("TourID=" & nTourId & "")
GridViewBooking.Columns("Type").FilterInfo = New Columns.ColumnFilterInfo("Type Like '" & Type & "%'")
If Flag = "Today" Then
GridViewBooking.Columns("BookingDate").FilterInfo = New Columns.ColumnFilterInfo("BookingDate Like '" & Date.Today.Date & "%'")
Else
GridViewBooking.Columns("BookingStatus").FilterInfo = New Columns.ColumnFilterInfo("BookingStatus Like '" & Flag & "%'")
End If
If sMode1 = "" Then
GridViewBooking.Columns("Mode").FilterInfo = New Columns.ColumnFilterInfo("Mode Not Like 'Bus%'")
Else
GridViewBooking.Columns("Mode").FilterInfo = New Columns.ColumnFilterInfo("Mode Like '" & sMode1 & "%'")
End If

If nOptAll = 100 Then
''show all records
'' does not apply filter on Option no
GridViewBooking.Columns("OptionNo").FilterInfo = New Columns.ColumnFilterInfo("OptionNo is not null ")

ElseIf nOpt1 > 0 And nOpt2 > 0 And nOpt3 > 0 Then
'showing recors for option1, option2, option3
GridViewBooking.Columns("OptionNo").FilterInfo = New Columns.ColumnFilterInfo("OptionNo= " & nOpt1 & " or OptionNo= " & nOpt2 & " OptionNo= " & nOpt3 & "")
ElseIf nOpt1 > 0 And nOpt2 > 0 Then
'showing records for option1 and option2
GridViewBooking.Columns("OptionNo").FilterInfo = New Columns.ColumnFilterInfo("OptionNo= " & nOpt1 & " or OptionNo= " & nOpt2 & "")
ElseIf nOpt1 > 0 And nOpt3 > 0 Then
'showing records for option1 and option3
GridViewBooking.Columns("OptionNo").FilterInfo = New Columns.ColumnFilterInfo("OptionNo= " & nOpt1 & " or OptionNo= " & nOpt3 & "")
ElseIf nOpt2 > 0 And nOpt3 > 0 Then
'showing records for option2 and option3
GridViewBooking.Columns("OptionNo").FilterInfo = New Columns.ColumnFilterInfo("OptionNo= " & nOpt2 & " or OptionNo= " & nOpt3 & "")
ElseIf nOptionNo > 0 Then
'showing records only for one option at a time
GridViewBooking.Columns("OptionNo").FilterInfo = New Columns.ColumnFilterInfo("OptionNo= " & nOptionNo & "")
Else
''It will hide all records due to no any option selected
GridViewBooking.Columns("OptionNo").FilterInfo = New Columns.ColumnFilterInfo("OptionNo is null ")
End If
GridViewBooking.RefreshData()





Responses

Author: KVGaneshBabu    08 Sep 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi bhakti,
I think you are binding GridView with much more records. You should use custom paging to avoid slow binding of Gridview. Otherwise it will not slow to bind according to me.


Regards,
KVGaneshBabu



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Doubts
Previous : how to create crystal report at runtime
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use