We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Mouse Cell Selection (works 1st time, doesn't afterward)

I have a tab control containing a grid in a modeless form. What I find is I can select a cell in my grid with the mouse one time only. I can't select any other cells afterward and need to rely on the keyboard controls for navigation. Once I leave this tab and renter the tab again then I can select a cell one more time. I'm using mostly default settings for the grid, so I'm perplexed about this behavior. I can add the grid to a model dialog and see that multiple mouse selects work fine. Is there something weird about modeless dialogs? Attached is a snippet of my InitializeComponent() method that should show the default grid settings. The grid in question is called 'grdChromProperties' thanks, Rollan

3 Replies

CB Clay Burch Syncfusion Team September 20, 2002 06:12 AM UTC

With version, I created a form with a button on it. Then in the button handler, I created a second form and used ShowDialog to display this second form. On the second form I had a tabcontrol with 3 tabpages. On the first page, I put two panels docked left and fill with a splitter between them. In the fill panel I added a GridControl using exactly the code in your attached vb file. With this setup, I was able to click several cells, select several ranges of cells, change tabs and then return to the first tab, and was able to still click on cells. Are you using version Earlier releases had a focus problem when the grid was parented in panels inside other controls. What is different about what you are doing than what I described above?

RM Rollan Mosko September 20, 2002 11:55 AM UTC

Hi Clay, I'm using version as well. I found out what's aggravating the grid. We have a user-control that bothers it. This user control is owner-drawn using an OnPaint() override. Another developer created this control and isn't with us anymore so I don't know a lot about the guts of it (yet). Once I blank out the panel containing this control things are groovy. Are there some suggestions you can give me for what to look for to make the user control play well with the grid? thanks, Rollan

CB Clay Burch Syncfusion Team September 20, 2002 02:24 PM UTC

Rollan, So the user control is in a completely different sibling panel than the panel holding the grid? One thing you might want to do is to make sure you call CurrentCell.EndEdit to close any open edits as you leave the grid. You could use code such as: Private Sub GridDataBoundGrid1_CurrentCellDeactivating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles GridDataBoundGrid1.CurrentCellDeactivating If Not Me.GridDataBoundGrid1.CurrentCell.IsInMoveTo And Me.GridDataBoundGrid1.CurrentCell.IsEditing Then Me.GridDataBoundGrid1.CurrentCell.EndEdit() Console.WriteLine("EndEdit") End If End Sub in the CurrentCellDeactivating event to do this. Other than that, I cannot think of anything. -Clay

Live Chat Icon For mobile
Up arrow icon