loyal Posted November 14, 2004 Posted November 14, 2004 Hi I found the solution but it seems does not work ! I found that the Shared function without End Function TAG and it was a design time error then I fixed it well should I call the SetNoCurrentCell() from specific Event or just on Load Form Event can someone rewrite the code again with few notes & Comments here's the code Public Class MyDataGrid Inherits DataGrid Public WM_LBUTTONDOWN As Integer = 513 Public WM_LBUTTONUP As Integer = 514 Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal msg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Boolean End Function Public Sub SetNoCurrentCell() 'click on top left corner of the grid SendMessage(Me.Handle, WM_LBUTTONDOWN, 0, 0) SendMessage(Me.Handle, WM_LBUTTONUP, 0, 0) End Sub 'SetNoCurrentCell End Class 'MyDataGrid Help will be approciated Quote Gary Says: To be a good programmer, you must be good at debugging
JumpyNET Posted May 19, 2005 Posted May 19, 2005 Try this.... I had the same problem with the same example code. This works better! Private Sub myDataGrid_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles myDataGrid.CurrentCellChanged 'Lose focus myDataGrid.Controls.Clear() 'Select the whole ROW myDataGrid.Select(myDataGrid.CurrentCell.RowNumber) End Sub Quote
JumpyNET Posted May 19, 2005 Posted May 19, 2005 Hhmmm.... Maybe it needs some tweaking cause it will screw up the scrollbars. If anyone can solve this please let us know. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.