This is a discussion on Problem with scrollbars of panel in C# within the C# Programming forums, part of the Software Development category; Problem with scrollbars of panel in C# I am using panel with autoscroll = true. I have added dataGridView control inside ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Problem with scrollbars of panel in C# I am using panel with autoscroll = true. I have added dataGridView control inside panel. When the height and width of dataGridView increases and becomes more than panel size, scrollbars of panel are enabled. When i scroll using any scrollbar and click on the dataGridView which is inside panel, the position of the scrolled scrollbar changes automatically and scrollbars goes to start position |
|
#2
| |||
| |||
| Hi, I confuse why the size of your DataGridView in the panel will increase? DataGridView has scroll bar by default. When the count of the rows in DataGridView is great, it will show scroll bar automatically. Can you tell me the reason why you want to enlarge the DataGridView and let the panel show scroll bar?
__________________ Shaalini.S ![]() Be the Best of Whatever you are... |
|
#3
| |||
| |||
| Hi, Actually I am not using DataGridView as it is, I have created User Control "Table", in which user will be allowed to merge rows and columns. so I am painting the whole DataGridView in CellPainting event. This "Table" control is added in other application on panel for which AutoScroll is enabled. so I set the Width and Height of DataGridView equal to sum of Widths of columns and that of heights of rows respectively. now here the above mentioned problem comes into picture. i have tried like this : private void panel1_Scroll(object sender, ScrollEventArgs e) { dataGridView1.Focus(); } but actually the above approach solves the problem to some extent. whenever i click on DataGridView after scrolling, the problem is not there, but now if i leave the scrollbars in any position other than starting position and the focus is shifted to other control say ComboBox, now again when i click on DataGridView inside panel, scrollbars move to original position. |
|
#4
| |||
| |||
| Hi, I have found the solution to this problem, I am handling the MouseDown and MouseClick events for DataGridView in which I am setting the position of the scrollbars for the panel, this position was saved in "Panel_Scroll" event. Thanks for all |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| a new problem? | saravanan | Computer Hardware | 0 | 03-24-2008 06:09 AM |
| Problem in IE | krishnakumar | HTML, CSS and Javascript Coding Techniques | 13 | 11-28-2007 08:51 PM |
| publicdomainregistry - control panel? | annerz | General Web hosting Discussions | 0 | 11-06-2007 08:10 PM |
| How to create an image from panel background Image | S.Vinothkumar | C# Programming | 1 | 10-22-2007 02:52 AM |
| My LiteralControl inside the AJAX panel is not working? | kingmaker | ASP and ASP.NET Programming | 0 | 08-20-2007 10:00 PM |
Our Partners |