Datagrid scroll disabled (unitentionally)

  • Thread starter Thread starter Bill Sonia
  • Start date Start date
B

Bill Sonia

It seems whenever I set a DataGrid.DataSource = DataTable
(vb.net) to populate a datagrid, the scroll bars on the
datagrid default to disabled. And the only way I can get
them to enable is to manually resize a column width with
the mouse (not very elegant).

Anyone have any ideas how I could enable the datagrid
scroll bars in my code?

Thanks,

~Bill
 
Hi Bill,

I cannot reproduce the problem you experienced. Would you please provide me
with more information so I can deliver my assistance more quickly?

If there's anything unclear, please feel free to reply to this post.

Kevin Yu
========
"This posting is provided "AS IS" with no warranties, and confers no
rights."


--------------------
| Content-Class: urn:content-classes:message
| From: "Bill Sonia" <[email protected]>
| Sender: "Bill Sonia" <[email protected]>
| Subject: Datagrid scroll disabled (unitentionally)
| Date: Fri, 12 Sep 2003 11:27:06 -0700
| Lines: 12
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcN5W3hfGMBFwqY9Ql20t5q2yn5sbA==
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108319
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| It seems whenever I set a DataGrid.DataSource = DataTable
| (vb.net) to populate a datagrid, the scroll bars on the
| datagrid default to disabled. And the only way I can get
| them to enable is to manually resize a column width with
| the mouse (not very elegant).
|
| Anyone have any ideas how I could enable the datagrid
| scroll bars in my code?
|
| Thanks,
|
| ~Bill
|
 
Thanks Kevin, here's the code

myCRCStudy.SearchStudy("")

Me.myDT = myCRCStudy.retDS.Tables(0)
Me.dgStudy.DataSource = Me.myDT

Where myCRCStudy.SearchStudy is a class sub that calls a
web services and receives a dataset. I set my local Data
Table equal to the class data table then I set the
datagrid datasource to the local datatable. The datagrid
is populated with the data table but the scroll is
disabled.

I have roughly 10 datagrids in my app and this disabled
grid problem is re-occurring all over the place. Also I
know it's not a version issue because I've had this
problem with Visual Studio 2002, VS 2003 Final Beta and my
current verion VS 2003.

Is there another way to set the data grid datasource
besides the way I'm doing it?

Thanks,

~Bill
 
Bill,

I also had this problem. Try setting the grid to visible = false prior to
setting the datasource.
Then set visible = true after you have set everything up.

It that doesn't work try playing with the SuspendLayout and
ResumeLayout(false) options.

HTH,
Eric Cadwell
http://www.origincontrols.com
 
Hi Bill,

I've tried your code, but I still cannot reproduce the problem. Please take
a look a Eric's reply. He offered a workaround.

If anything is unclear, please feel free to reply to this post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."



--------------------
| Content-Class: urn:content-classes:message
| From: "Bill Sonia" <[email protected]>
| Sender: "Bill Sonia" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: Datagrid scroll disabled (unitentionally)
| Date: Mon, 15 Sep 2003 08:14:35 -0700
| Lines: 85
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcN7nBJ5DWdu96vLT1alDV6RGbmolw==
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:108244
| NNTP-Posting-Host: tk2msftngxa12.phx.gbl 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Thanks Kevin, here's the code
|
| myCRCStudy.SearchStudy("")
|
| Me.myDT = myCRCStudy.retDS.Tables(0)
| Me.dgStudy.DataSource = Me.myDT
|
| Where myCRCStudy.SearchStudy is a class sub that calls a
| web services and receives a dataset. I set my local Data
| Table equal to the class data table then I set the
| datagrid datasource to the local datatable. The datagrid
| is populated with the data table but the scroll is
| disabled.
|
| I have roughly 10 datagrids in my app and this disabled
| grid problem is re-occurring all over the place. Also I
| know it's not a version issue because I've had this
| problem with Visual Studio 2002, VS 2003 Final Beta and my
| current verion VS 2003.
|
| Is there another way to set the data grid datasource
| besides the way I'm doing it?
|
| Thanks,
|
| ~Bill
| >-----Original Message-----
| >Hi Bill,
| >
| >I cannot reproduce the problem you experienced. Would you
| please provide me
| >with more information so I can deliver my assistance more
| quickly?
| >
| >If there's anything unclear, please feel free to reply to
| this post.
| >
| >Kevin Yu
| >========
| >"This posting is provided "AS IS" with no warranties, and
| confers no
| >rights."
| >
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Bill Sonia" <[email protected]>
| >| Sender: "Bill Sonia" <[email protected]>
| >| Subject: Datagrid scroll disabled (unitentionally)
| >| Date: Fri, 12 Sep 2003 11:27:06 -0700
| >| Lines: 12
| >| Message-ID: <[email protected]>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Thread-Index: AcN5W3hfGMBFwqY9Ql20t5q2yn5sbA==
| >| Newsgroups: microsoft.public.dotnet.general
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.general:108319
| >| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| >| X-Tomcat-NG: microsoft.public.dotnet.general
| >|
| >| It seems whenever I set a DataGrid.DataSource =
| DataTable
| >| (vb.net) to populate a datagrid, the scroll bars on the
| >| datagrid default to disabled. And the only way I can
| get
| >| them to enable is to manually resize a column width
| with
| >| the mouse (not very elegant).
| >|
| >| Anyone have any ideas how I could enable the datagrid
| >| scroll bars in my code?
| >|
| >| Thanks,
| >|
| >| ~Bill
| >|
| >
| >.
| >
|
 
Back
Top