multiple DataGrid headers with paging

G

Guest

I have a datagrid that has two headers... one that has the column titles, and
one above it that spans multiple columns as a grouping display ... example:

Members Dates
Types
Name Address Phone Start Finish Active
Inactive

header "Members" would be columnspan=3 "Dates" = 2 "Types" = 2 etc...

It all works great until paging gets involved. I have paging set to 100
records per page initially, with a dropdown to change it incrementally, with
PagerStyle-Pagebuttoncount=10. If there are 100 records or less,
pagerstyle.visible=False, so there is no problem. The problem I am having is
that when there are more than 100 records, the page numbers are inserted
between the first and second headers as well as at the bottom of the page. I
have set PagerStyle.Position = PagerPosition.Bottom, and tried numerous other
remedies, all to no avail.... can anyone help please??? Thanks in advance...
 
M

marss

I have a datagrid that has two headers... one that has the column titles, and
one above it that spans multiple columns as a grouping display ... example:

Members Dates
Types
Name Address Phone Start Finish Active
Inactive

header "Members" would be columnspan=3 "Dates" = 2 "Types" = 2 etc...

It all works great until paging gets involved. I have paging set to 100
records per page initially, with a dropdown to change it incrementally, with
PagerStyle-Pagebuttoncount=10. If there are 100 records or less,
pagerstyle.visible=False, so there is no problem. The problem I am having is
that when there are more than 100 records, the page numbers are inserted
between the first and second headers as well as at the bottom of the page. I
have set PagerStyle.Position = PagerPosition.Bottom, and tried numerous other
remedies, all to no avail.... can anyone help please??? Thanks in advance...

Perhaps this method of merging columns in header is more resistant
against paging.
http://marss.co.ua/MergingGridViewHeaderColumns.aspx

Regards,
Mykola
 
K

kavitha shankar

Hi,
Could you please share the code of getting the two header rows in the datagrid. I want to do the same in my project , but have no idea of how to achieve it. Also I want to be able to create the columns dynamically.

I would appreciate any suggestion.

Thanks in advance

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
M

marss

Hi,
Could you please share the code of getting the two header rows in the datagrid.
I want to do the same in my project , but have no idea of how to achieve it.


Did you closely view the above link?
There is the separate code for GridView and DataGrid.
http://marss.co.ua/MergingGridViewHeaderColumns.aspx
If you mean that you set AutoGenerateColumns=true in your DataGrid -
no problem, it works in this case.

Regards,
Mykola
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top