Click here to Skip to main content
15,908,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Date time picker Pin
teddddddddddd29-May-07 19:30
teddddddddddd29-May-07 19:30 
QuestionPrinting Datagrids in ASP.net Pin
umashankergr829-May-07 6:05
umashankergr829-May-07 6:05 
AnswerRe: Printing Datagrids in ASP.net Pin
Suresh Pirsquare29-May-07 7:11
Suresh Pirsquare29-May-07 7:11 
QuestionOverwriting controls contents Pin
totig29-May-07 5:42
totig29-May-07 5:42 
QuestionFTP and Virtual director Pin
Engineerusa29-May-07 5:27
Engineerusa29-May-07 5:27 
QuestionPagedDataSource Unlimited size Pin
Senseicads29-May-07 5:07
Senseicads29-May-07 5:07 
AnswerRe: PagedDataSource Unlimited size Pin
kubben29-May-07 5:25
kubben29-May-07 5:25 
GeneralRe: PagedDataSource Unlimited size Pin
Senseicads29-May-07 5:50
Senseicads29-May-07 5:50 
Good plan although I am not sure how I can do this using my code. I mean I know its possible but just having a mental block, been looking at it for ages now and all the words are jumbling into one! Wink | ;)

I have a load data method which populates my repeater.

' This Method is responsible for reloading the data when a user event like a sort or <br />
    ' a filter is applied to the user control<br />
    Private Sub LoadData(ByVal b As Boolean)<br />
        'I need to load all my data into the repeater control.<br />
        Dim strConnectionString As String = sqlViewCalls.ConnectionString<br />
<br />
        Dim sqlConnection As SqlConnection = New SqlConnection(strConnectionString)<br />
        sqlConnection.Open()<br />
<br />
        Dim sqlDA As SqlDataAdapter<br />
        sqlDA = New SqlDataAdapter(hidViewString.Value.ToString() & hidQueryString.Value.ToString() & hidSortString.Value.ToString(), sqlConnection)<br />
<br />
        Dim dt As DataTable<br />
        dt = New DataTable()<br />
        sqlDA.Fill(dt)<br />
        sqlConnection.Close()<br />
<br />
        ' Create a new PagedDataSource<br />
        Dim pgItems As PagedDataSource<br />
        pgItems = New PagedDataSource()<br />
<br />
        ' Create a new DataView from the datatable we created before.<br />
        Dim dv As DataView = New DataView(dt)<br />
        ' Initialise the PagedDataSource and populate it.<br />
        pgItems.DataSource = dv<br />
        pgItems.AllowPaging = True<br />
        pgItems.PageSize = pgSize<br />
        pgItems.CurrentPageIndex = PageNumber<br />
<br />
        If b = True Then<br />
            If pgItems.PageCount > 1 Then<br />
                Dim pages As ArrayList = New ArrayList()<br />
                For index As Integer = 0 To (pgItems.PageCount() - 1)<br />
                    pages.Add((index + 1).ToString())<br />
                Next<br />
                hidLast.Value = (pages.Count() - 1).ToString()<br />
            Else<br />
                hidLast.Value = 0<br />
            End If<br />
        End If<br />
<br />
        lblPagination.Text = "   Page: " & (pgItems.CurrentPageIndex + 1).ToString() & " of " & pgItems.PageCount & " (" & pgItems.DataSourceCount & " Records)"<br />
<br />
        repResults.DataSource = pgItems<br />
        repResults.DataBind()<br />
<br />
End Sub


Then in the selection Changed of the ddl (which is populated by 4 values, 10,20,50 and all) I have

<br />
    Protected Sub ddlPageSize_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlPageSize.SelectedIndexChanged<br />
        If ddlPageSize.SelectedIndex = 3 Then<br />
            pgSize = 2000000<br />
            PageNumber = 0<br />
            LoadData(True)<br />
            ' Code to enable buttons/disable buttons here<br />
        Else<br />
            pgSize = Integer.Parse(ddlPageSize.SelectedValue)<br />
            PageNumber = 0<br />
            LoadData(True)<br />
            ' Code to enable buttons/disable buttons here<br />
        End If<br />
    End Sub<br />


I commented out the paging buttons disabling/renabling but you get the idea. Anyhelp would be appreciated.

Cheers

Ian
GeneralRe: PagedDataSource Unlimited size Pin
kubben29-May-07 5:56
kubben29-May-07 5:56 
GeneralRe: PagedDataSource Unlimited size Pin
Senseicads29-May-07 6:02
Senseicads29-May-07 6:02 
GeneralRe: PagedDataSource Unlimited size Pin
kubben29-May-07 6:25
kubben29-May-07 6:25 
QuestionError occur on start project from shared folder Pin
Nimua29-May-07 5:06
Nimua29-May-07 5:06 
AnswerRe: Error occur on start project from shared folder Pin
kubben29-May-07 5:27
kubben29-May-07 5:27 
GeneralRe: Error occur on start project from shared folder Pin
Nimua29-May-07 21:38
Nimua29-May-07 21:38 
GeneralRe: Error occur on start project from shared folder Pin
kubben30-May-07 2:13
kubben30-May-07 2:13 
QuestionDesign Time Error: &quot;File could not be loaded into Designer&quot; [modified] Pin
Blumen29-May-07 4:33
Blumen29-May-07 4:33 
Questionasp.net1.1 - marquee text [modified] Pin
sanaziuse29-May-07 4:11
sanaziuse29-May-07 4:11 
AnswerRe: asp.net1.1 - marquee text Pin
Christian Graus29-May-07 13:48
protectorChristian Graus29-May-07 13:48 
GeneralRe: asp.net1.1 - marquee text Pin
sanaziuse29-May-07 21:16
sanaziuse29-May-07 21:16 
QuestionReading a Text Files in ASP.NET Pin
.NET- India 29-May-07 3:44
.NET- India 29-May-07 3:44 
AnswerRe: Reading a Text Files in ASP.NET Pin
Not Active29-May-07 3:55
mentorNot Active29-May-07 3:55 
Questionhow to Customize createuserwizard control Pin
mohd imran abdul aziz29-May-07 3:35
mohd imran abdul aziz29-May-07 3:35 
QuestionMinimizing the interactions with the database Pin
yuvachandra29-May-07 3:27
yuvachandra29-May-07 3:27 
AnswerRe: Minimizing the interactions with the database Pin
Not Active29-May-07 4:05
mentorNot Active29-May-07 4:05 
QuestionMenu control help Pin
eric_tran29-May-07 3:10
eric_tran29-May-07 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.