469,637 Members | 1,628 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,637 developers. It's quick & easy.

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

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
2 1365
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
"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.

Similar topics

1 post views Thread by Sergiu Cojocaru | last post: by
1 post views Thread by Phil | last post: by
reply views Thread by neo | last post: by
4 posts views Thread by =?Utf-8?B?Sm9zaW4gSm9obg==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.