Hi Kira,
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 :
- privatevoidpanel1_Scroll(objectsender,ScrollEventArgse)
- {
- 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.
can you please suggest something
Regards
Abhishek