473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Datagrid Paging with AutoGenerateColumns

I have a Datagrid on a Form. AutoGenerateColumns is set to true,
AllowPaing is set to true, PagerStyle-HorizonalAlign is set to
"center".

I data bind the grid, then view the results. The problem is that the
Page numbers appear centred in a cell, that is the same width of the
first cell in the data, and is the only cell in the row, it has no
colspan. This obviously looks wrong, and has a grid line, what I need
is the page number to be aligned in the centre of the row.

I debugged into pre_render, and saw that the TableCell correctly had a
ColumnSpan equivalent to the number of columns, but it never renders
this attribute. I had originally thought maybe it wasn't going to
guess the number of columns in the data source(a wild excuse for this
behaviour).

If I set AutoGenerateColumns to false, and supply some dummy columns
and content, the page numbers align correcty. It's basically the same
table, but with the pager cell having a colspan. As the contents of
the grid are dynamic, and I deal with it in the datasource, I dont wish
to permantently make this false.

I have fixed this by adding finding the Pager Item's cell, and adding
the colspan attribute myself.

Can anybody explain why this behaviour occurs? (I am using IIS 6, ASP
..NET 2.0)

Aug 30 '06 #1
0 976

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: enak | last post by:
I can not get my datagrid to page. I have a datagrid that I can sort 2 of the columns. This works great. I added paging and when I display the dg it shows 5 pages. (I am showing page numbers at...
3
by: DC | last post by:
Dear ASP.Net Experts, In ASP, I can write something like this: <table> <tr> <th align=left>ID</th> <th align=left>Product Name</th> <th align=left>Price</th> </tr> <%
1
by: iforsyth | last post by:
Have a paging datagrid with a checkbox control in column(0). ViewState is enabled. I check the checkbox in first row of the grid on a page and then the program hits this event: Private Sub...
5
by: Patrick.O.Ige | last post by:
Hi Guys, I have a datagrid wit editing and updating. But after adding Paging IT WON'T PAGE!! It compiles well but when i click on the paging link it doesn't go to the next link.. When i remove...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
1
by: Steve Wonderful | last post by:
Hi, I have dynamically created a datagrid by: 1. created a number of columns from reading a column difinition so I can dynamically create the columns I want to display. 2. bind to a...
0
by: =?Utf-8?B?U2Vhblc=?= | last post by:
It appears that in the .NET Framework 2.0, if you create a datagrid, set AllowPaging="true", and set AutoGenerateColumns="true" the behaviour of the paging cell is incorrect, the ColumnSpan...
0
by: hanusoft | last post by:
This is an example of editing in DataGrid and Default Paging http://www.hanusoftware.com Html Design Code : - <asp:DataGrid id="DataGrid1" DataKeyField="id" runat="server" Height="224px"...
0
by: webaccess | last post by:
Hi Friends ..!! I want to use datagrid/dataview control to data in tablular format,also I want to add paging and format the data of table column. Problem is data is coming from API Dom in as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.