2 Replies - 6073 Views - Last Post: 10 August 2007 - 09:22 AM Rate Topic: -----

#1 cygnusX  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 159
  • Joined: 19-May 07

DataGridViewColumn.AutoSizeMode property

Posted 10 August 2007 - 05:10 AM

I have DataGridView with three columns.I set the columns AutoSizeMode to Fill.When i add rows to the datagridview at runtime i change their WrapMode property to False through RowDefaultCellStyle property of the datagridview.Set ScrollBars property to Both too.And when run the application and add rows,the bottom scrollbar is not visible if the AutoSizeMode property of the columns is set to Fill.For example if it is set to DisplayedCells it's allright,the bottom scrollbar is visible and i can see the full text inside the columns.How to fix that?

Also how to prevent user to select multiple rows?

Is This A Good Question/Topic? 0
  • +

Replies To: DataGridViewColumn.AutoSizeMode property

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: DataGridViewColumn.AutoSizeMode property

Posted 10 August 2007 - 05:24 AM

To prevent users from selecting multiple rows set the MultiSelect Property of the DataGridView to False

As for the first part I really don't understand what you're asking, sorry
Was This Post Helpful? 0
  • +
  • -

#3 tody4me  Icon User is offline

  • Banned
  • member icon

Reputation: 12
  • View blog
  • Posts: 1,398
  • Joined: 12-April 06

Re: DataGridViewColumn.AutoSizeMode property

Posted 10 August 2007 - 09:22 AM

when you set the datasource property for the datagridview control is when the other options are settable / retain able. if you set the property for either before the datasource property is set, for some reason .NET doesn't pick it up, and it resets the values for columns / cells within the control.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1