Deal of the Day

Home » Main » Manning Forums » 2007 » LINQ in Action

Thread: Custom Sort (Page 169):How to set gridview to have a fixed number of column

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Pages: 1 - Last Post: Aug 7, 2009 4:35 PM by: pheara Threads: [ Previous | Next ]
pheara

Posts: 2
Registered: 8/7/09
Custom Sort (Page 169):How to set gridview to have a fixed number of column
Posted: Aug 7, 2009 3:18 PM
  Click to reply to this thread Reply

I run the example, it display correctly, displaying three columns(Title, Page, Publisher). I have checked both Gridview Property and LINQ query, I didn't see anything related to specify those three columns. Where did you define it?

I try to follow the example, it display all rows, not just three column.

could you please explain me how to control gridview's column?

Thanks,
Pheara

pheara

Posts: 2
Registered: 8/7/09
Re: Custom Sort (Page 169):How to set gridview to have a fixed number of column
Posted: Aug 7, 2009 4:35 PM   in response to: pheara in response to: pheara
  Click to reply to this thread Reply

I found out that I need to set a property of GridView as below:

dataGridView1.AutoGenerateColumns = false;

I couldn't find it in the property window, but I can set it in the form load event.

Thanks,
Pheara

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor