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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid: Page Left/Right??? 1

Status
Not open for further replies.

LFCfan

Programmer
Nov 29, 2002
3,015
GB
Does anyone know of a way to get a datagrid to "page" left and right as well as the normal up and down paging?

Basically I have a datagrid with quite a few columns, and it's too wide and looks silly on the web page. All columns need to be visible. Is there a way to add scroll bars (or something) to the datagrid? or to vertically split the grid over two pages while keeping the two parts linked?

Any thoughts would be very much appreciated.

Maria

PS I'm rather new at this .NET lark and with a reasonable but not extensive knowledge of VB, so although i've looked in the online help etc, I apologise if i've missed something glaringly obvious! Thanks again
 
There is really no "automatic" way to do this. You can manually program this, though. For example, if the user clicks the "next page to right" button (or whatever), you could simply set the visible attributes of the first 5 columns to false, and then set the next 5 columns to visible. You would have to keep a viewstate record of the current left/right page, and make sure you are showing the correct page on each databind, but this should work. You could even make it where the "Primary Column" (name, record number, etc.) is always visible, to make it easier to use.

Another option may be to show the most vital information in the datagrid, and then have a "View Extended Info" button that would show all the information for any specific record. Just a thought!

HTH! Kevin B.
.Net Programmer [thumbsup]
 
Kevin

I will be following the "next page to right" option, sounds perfect.

I would like to think that I would have eventually come up with the idea myself, if it wasn't for the festive season :)

Thanks for your help

Maria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top