Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data grid paging

Status
Not open for further replies.

desi2002

Programmer
Jan 4, 2002
24
IN
Hi,
I am trying to use a built in paging functionality to set up a Data Grid.

I set parameters as follows.

<asp:datagrid id=&quot;myDataGrid&quot; runat=&quot;server&quot; Border=&quot;0&quot; width=&quot;100%&quot; CssClass=&quot;DataGrid&quot; AutoGenerateColumns=&quot;false&quot; AllowSorting=&quot;True&quot; onsortcommand=&quot;OnClick_Sort&quot; Allowpaging=&quot;true&quot; PageSize=&quot;5&quot; PagerStyle-Mode=&quot;NumericPages&quot; PagerStyle-Visible=&quot;True&quot; PagerStyle-Position=&quot;TopAndBottom&quot; OnPageIndexChanged= &quot;DataGrid_PageChanger&quot; PagerStyle-HorizontalAlign = &quot;Right&quot;>

I have more than 5 records in the database. It displays records depending on the value set to PageSize parameter.

However it doesn't display links to next and previous pages.

Is anything wrong in the parameter setting?
Waiting for reply.


Thanks.

Regards
Desi2002
 
I haven't used the datagrid (I'm more of a middle-tier developer), but I'm curious what you did to solve the problem. Can you post again with some more info?

Thanks.
Chip H.
 
Chiph,
I set parameters as follows.

<asp:datagrid id=&quot;myDataGrid&quot; runat=&quot;server&quot; Border=&quot;0&quot; width=&quot;100%&quot; AutoGenerateColumns=&quot;False&quot; AllowSorting=&quot;True&quot; onsortcommand=&quot;OnClick_Sort&quot; Allowpaging=&quot;True&quot; PagerStyle-Mode=&quot;NumericPages&quot; OnPageIndexChanged=&quot;DataGrid_PageChanger&quot; PagerStyle-HorizontalAlign=&quot;Right&quot;>

Then I set &quot;Show Navigation Button&quot; property through property window of &quot;mydatagrid&quot;. To do this

In Design view, select the DataGrid control, then click the Property Builder link at the bottom of the Properties window.
In the DataGrid Properties dialog box, click the Paging tab.
Click on Show Navigation Buttons.

I think this is what you want.

Smita.
 
Thanks. I'll play around with it tonight at home.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top