473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dynamic DataGridView missing horizontal scrollbar

Hi,

I am dynamically creating datagridviews for my application, then
filling them with data from a 30 row datatable, and everything seems to
work great with one exception. My horizontal scrollbar never appears --
no problem with the vertical scrollbar. I even try setting the
scrollbars property to Both, but still I only see the vertical
scrollbar.

Is there any other way to force the DataGridView's vertical scrollbar
to appear?????

Thanks,

Crazy

Apr 3 '06 #1
10 12114
Try selecting the last cell of the grid row... using code... that might help

Vijay

"Crazy Cat" <da******@hotmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Hi,

I am dynamically creating datagridviews for my application, then
filling them with data from a 30 row datatable, and everything seems to
work great with one exception. My horizontal scrollbar never appears --
no problem with the vertical scrollbar. I even try setting the
scrollbars property to Both, but still I only see the vertical
scrollbar.

Is there any other way to force the DataGridView's vertical scrollbar
to appear?????

Thanks,

Crazy

Apr 3 '06 #2

Vijay wrote:
Try selecting the last cell of the grid row... using code... that might help

Vijay

"Crazy Cat" <da******@hotmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Hi,

I am dynamically creating datagridviews for my application, then
filling them with data from a 30 row datatable, and everything seems to
work great with one exception. My horizontal scrollbar never appears --
no problem with the vertical scrollbar. I even try setting the
scrollbars property to Both, but still I only see the vertical
scrollbar.

Is there any other way to force the DataGridView's vertical scrollbar
to appear?????

Thanks,

Crazy


Doesn't work -- I used datagridview.currentrow.cells(INDEX).selected =
true but no dice.

Any other ideas?

Thanks

Apr 3 '06 #3
uhm.. ok.., And you do have more than the visible area of columns, still not
getting scrollbars.. are u using 2.0 or 1.1 ?

VJ

"Crazy Cat" <da******@hotmail.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...

Vijay wrote:
Try selecting the last cell of the grid row... using code... that might
help

Vijay

"Crazy Cat" <da******@hotmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
> Hi,
>
> I am dynamically creating datagridviews for my application, then
> filling them with data from a 30 row datatable, and everything seems to
> work great with one exception. My horizontal scrollbar never appears --
> no problem with the vertical scrollbar. I even try setting the
> scrollbars property to Both, but still I only see the vertical
> scrollbar.
>
> Is there any other way to force the DataGridView's vertical scrollbar
> to appear?????
>
> Thanks,
>
> Crazy
>


Doesn't work -- I used datagridview.currentrow.cells(INDEX).selected =
true but no dice.

Any other ideas?

Thanks

Apr 3 '06 #4
Crazy,

With this code I see a vertical and a horizontal scrollbar

\\\
Dim mydatagridview As New DataGridView
Controls.Add(mydatagridview)
mydatagridview.DataSource = MyEmployeesBindingSource
///

I hope this helps,

Cor
Apr 4 '06 #5
I'm pretty sure I'm using 2.0. I do have more than the visible area of
columns -- almost twice as much.

Thanks,

Vijay wrote:
uhm.. ok.., And you do have more than the visible area of columns, still not
getting scrollbars.. are u using 2.0 or 1.1 ?

VJ

"Crazy Cat" <da******@hotmail.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...

Vijay wrote:
Try selecting the last cell of the grid row... using code... that might
help

Vijay

"Crazy Cat" <da******@hotmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
> Hi,
>
> I am dynamically creating datagridviews for my application, then
> filling them with data from a 30 row datatable, and everything seems to
> work great with one exception. My horizontal scrollbar never appears --
> no problem with the vertical scrollbar. I even try setting the
> scrollbars property to Both, but still I only see the vertical
> scrollbar.
>
> Is there any other way to force the DataGridView's vertical scrollbar
> to appear?????
>
> Thanks,
>
> Crazy
>


Doesn't work -- I used datagridview.currentrow.cells(INDEX).selected =
true but no dice.

Any other ideas?

Thanks


Apr 4 '06 #6
I don't have a binding source because I don't use the DataSet designer
to get the tables back. Perhaps that'll help? I'll take a look and post
back.

Thanks,
Cor Ligthert [MVP] wrote:
Crazy,

With this code I see a vertical and a horizontal scrollbar

\\\
Dim mydatagridview As New DataGridView
Controls.Add(mydatagridview)
mydatagridview.DataSource = MyEmployeesBindingSource
///

I hope this helps,

Cor


Apr 4 '06 #7
OK,

I tried this again with the Binding Source and still no scrollbar --
does anyone have any other ideas???? PLEASE???

Here's the code --
Dim tabDetails As TabPage
Dim DetailsBindingSource As BindingSource
Dim dgvDetails As DataGridView

tctlDetails.TabPages.Clear()
If PortDetailsDataSet IsNot Nothing Then
For Each dt As System.Data.DataTable In
PortDetailsDataSet.Tables

Me.tctlDetails.TabPages.Add(dt.Rows(0).Item("MSC_N AME"))
tabDetails =
tctlDetails.TabPages(tctlDetails.TabPages.Count - 1)
dgvDetails = New DataGridView()
With dgvDetails
.Visible = True
.AllowUserToAddRows = False
.AllowUserToDeleteRows = False
DetailsBindingSource = New
BindingSource(PortDetailsDataSet, dt.TableName)
.DataSource = DetailsBindingSource
tabDetails.Controls.Add(dgvDetails)
dgvDetails.Dock = DockStyle.Fill
dgvDetails.ScrollBars =
System.Windows.Forms.ScrollBars.Both
For Each a As DataGridViewColumn In .Columns
a.ReadOnly = True
Next
.ScrollBars = System.Windows.Forms.ScrollBars.Both
End With
Next
End If

BTW, on a side note I allow the user to clear the tabs from the
tabcontrol assuming that because the dynamic bindingsources and
datatables are no longer referenced the VS garbage collecter will clean
them up. Is that a correct assumption or should I delete the referenced
objects myself?

Thanks,

Crazy
Crazy Cat wrote:
I don't have a binding source because I don't use the DataSet designer
to get the tables back. Perhaps that'll help? I'll take a look and post
back.

Thanks,
Cor Ligthert [MVP] wrote:
Crazy,

With this code I see a vertical and a horizontal scrollbar

\\\
Dim mydatagridview As New DataGridView
Controls.Add(mydatagridview)
mydatagridview.DataSource = MyEmployeesBindingSource
///

I hope this helps,

Cor


Apr 5 '06 #8
Crazy Cat,

Because that I see "Dock Fill" are you sure that your DataGridView is narrow
enough to show the horizontal scrollbar?

Cor

"Crazy Cat" <da******@hotmail.com> schreef in bericht
news:11**********************@u72g2000cwu.googlegr oups.com...
OK,

I tried this again with the Binding Source and still no scrollbar --
does anyone have any other ideas???? PLEASE???

Here's the code --
Dim tabDetails As TabPage
Dim DetailsBindingSource As BindingSource
Dim dgvDetails As DataGridView

tctlDetails.TabPages.Clear()
If PortDetailsDataSet IsNot Nothing Then
For Each dt As System.Data.DataTable In
PortDetailsDataSet.Tables

Me.tctlDetails.TabPages.Add(dt.Rows(0).Item("MSC_N AME"))
tabDetails =
tctlDetails.TabPages(tctlDetails.TabPages.Count - 1)
dgvDetails = New DataGridView()
With dgvDetails
.Visible = True
.AllowUserToAddRows = False
.AllowUserToDeleteRows = False
DetailsBindingSource = New
BindingSource(PortDetailsDataSet, dt.TableName)
.DataSource = DetailsBindingSource
tabDetails.Controls.Add(dgvDetails)
dgvDetails.Dock = DockStyle.Fill
dgvDetails.ScrollBars =
System.Windows.Forms.ScrollBars.Both
For Each a As DataGridViewColumn In .Columns
a.ReadOnly = True
Next
.ScrollBars = System.Windows.Forms.ScrollBars.Both
End With
Next
End If

BTW, on a side note I allow the user to clear the tabs from the
tabcontrol assuming that because the dynamic bindingsources and
datatables are no longer referenced the VS garbage collecter will clean
them up. Is that a correct assumption or should I delete the referenced
objects myself?

Thanks,

Crazy
Crazy Cat wrote:
I don't have a binding source because I don't use the DataSet designer
to get the tables back. Perhaps that'll help? I'll take a look and post
back.

Thanks,
Cor Ligthert [MVP] wrote:
> Crazy,
>
> With this code I see a vertical and a horizontal scrollbar
>
> \\\
> Dim mydatagridview As New DataGridView
> Controls.Add(mydatagridview)
> mydatagridview.DataSource = MyEmployeesBindingSource
> ///
>
> I hope this helps,
>
> Cor

Apr 6 '06 #9

Cor Ligthert [MVP] wrote:
Crazy Cat,

Because that I see "Dock Fill" are you sure that your DataGridView is narrow
enough to show the horizontal scrollbar?

It should be, even when the application is maximized I can only see
about 50 - 60 % of the columns.

Thanks,
Cor

"Crazy Cat" <da******@hotmail.com> schreef in bericht
news:11**********************@u72g2000cwu.googlegr oups.com...
OK,

I tried this again with the Binding Source and still no scrollbar --
does anyone have any other ideas???? PLEASE???

Here's the code --
Dim tabDetails As TabPage
Dim DetailsBindingSource As BindingSource
Dim dgvDetails As DataGridView

tctlDetails.TabPages.Clear()
If PortDetailsDataSet IsNot Nothing Then
For Each dt As System.Data.DataTable In
PortDetailsDataSet.Tables

Me.tctlDetails.TabPages.Add(dt.Rows(0).Item("MSC_N AME"))
tabDetails =
tctlDetails.TabPages(tctlDetails.TabPages.Count - 1)
dgvDetails = New DataGridView()
With dgvDetails
.Visible = True
.AllowUserToAddRows = False
.AllowUserToDeleteRows = False
DetailsBindingSource = New
BindingSource(PortDetailsDataSet, dt.TableName)
.DataSource = DetailsBindingSource
tabDetails.Controls.Add(dgvDetails)
dgvDetails.Dock = DockStyle.Fill
dgvDetails.ScrollBars =
System.Windows.Forms.ScrollBars.Both
For Each a As DataGridViewColumn In .Columns
a.ReadOnly = True
Next
.ScrollBars = System.Windows.Forms.ScrollBars.Both
End With
Next
End If

BTW, on a side note I allow the user to clear the tabs from the
tabcontrol assuming that because the dynamic bindingsources and
datatables are no longer referenced the VS garbage collecter will clean
them up. Is that a correct assumption or should I delete the referenced
objects myself?

Thanks,

Crazy
Crazy Cat wrote:
I don't have a binding source because I don't use the DataSet designer
to get the tables back. Perhaps that'll help? I'll take a look and post
back.

Thanks,
Cor Ligthert [MVP] wrote:
> Crazy,
>
> With this code I see a vertical and a horizontal scrollbar
>
> \\\
> Dim mydatagridview As New DataGridView
> Controls.Add(mydatagridview)
> mydatagridview.DataSource = MyEmployeesBindingSource
> ///
>
> I hope this helps,
>
> Cor


Apr 6 '06 #10
did you solve it? I have the same problem
thankss!


http://www.hhdirecto.net
---
Posted via DotNetSlackers.com
Nov 20 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pal Csepregi | last post by:
Hi can i remove somehow the horizontal scrollbar? just the horizontal! Thx PallR
5
by: Jsp | last post by:
I created a vertically scrolling div. On initial rendering, Firefox shows a horizontal scrollbar in this div, over the complete width. Resizing the width of the window/viewport makes the horizontal...
4
by: anna | last post by:
How to tell if a horizontal scrollbar is present? I only want to use scrollTo if horizontal scrollbar is present. window.scrollbars.visibility doesn't specify which scrollbar is present, so it...
1
by: dhnriverside | last post by:
Hi guys I'm using a div to create a list with ajax stuff. At the moment, the div shows a scrollbar if the content is larger than the div. The problem is that if it isnt, the scrollbar...
4
by: Sakharam Phapale | last post by:
Hi All, I have installed VS .NET 2002 on my machine. I have checked both Vertical scrollbar and Horizontal Scrollbar options, in Tools -> Options-> Text Editor-> General-> Vertical Scrollbar...
0
by: Crazy Cat | last post by:
Hi, I've posted on this before, but was unable to get help. I really would like to use this control, but I can't offer it to my users until I am able to resolve this problem. I am creating...
14
by: Michael Weis | last post by:
Hello all, as a non-professional in these things, I searched for this topic but found no satisfying answer: I have to create a site with 3 frames. (Please no diskussion about the sense of...
1
by: malpani.abhijit | last post by:
Hi, I am having a ListView component in my WinForm, when i add some images into it, it gives me a vertical scroll bar. What i want is, the horizontal scrollbar instead of vertical. Is there any...
0
by: Mark Smith | last post by:
hi i use an ownerdraw method for coloring some items in the list different then the others. code: private void ListBoxDrawItem(object sender, DrawItemEventArgs e) { ListBox lst =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.