By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,600 Members | 956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,600 IT Pros & Developers. It's quick & easy.

How to create a grid of 20 Columns by 30 Rows using asp.net

P: n/a
Hi,

How can I create a grid of 20 Columns by 30 Rows using asp.net?

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies

P: n/a
GridView is a databound control. Once you have a 20x30 datasource,
databinding it to a gridview will produce a 20x30 grid.

Most common datasources are SqlDataSource, DataTable and SqlDataReader.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Claudia Fong" <cd********@yahoo.co.ukwrote in message
news:ep**************@TK2MSFTNGP06.phx.gbl...
Hi,

How can I create a grid of 20 Columns by 30 Rows using asp.net?

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***

Jun 27 '08 #2

P: n/a
"Claudia Fong" <cd********@yahoo.co.ukwrote in message
news:ep**************@TK2MSFTNGP06.phx.gbl...
How can I create a grid of 20 Columns by 30 Rows using asp.net?
By "grid" presumably you mean an <asp:GridView /webcontrol?

If so, then its geometry is (generally speaking) defined by the data which
is bound to it.

I.e. you can set its AutoGenerateColumns property to true and, assuming its
underlying datasource has 20 columns, you'll get a grid with 20 columns.
Alternatively, you can set its AutoGenerateColumns property to false, in
which case you define the columns yourself. If you define 20 columns, you'll
get a grid with 20 columns.

As regards rows, if you set the AllowPaging propery to true and set the
PageSize property to "30", you'll get a grid with 30 rows provided that the
underlying datasource contains at least 30 rows of data...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.