Ultragrid - ctrl-TAB won't work out of UG in groupbox when on TabPage


Author
Message
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I have not been able to figure out where to intervene to translate the null in the control to #1/1/1800# in the BBS.



There is a BeforeRowUpdate and AfterRowUpdate and I can test for e.row.cells("DateofSale").value and there is a .setvalue method but I don't see how to change the data coming from the BBS to a null if it is #1/1/1800# and to change it back on the update.



I don't have source, so I'm poking around in the dark. Have a question up on StackOverflow but didn't have any luck there on my last Ultragrid question. The tech support guy on the Infragistics forum really doesn't seem to have his heart in it and doesn't answer questions very well. A couple of people have asked questions like this and his answers have not been helpful.



Anybody know if DevExpress grid has this problem? I have their trial right now and considering switching over.



Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Yep, guess we have this ahead of us. Ermm

The SF wrapper UltraDateTimePicker works just fine on itself, but when we set it to be the column editor, no luck.

Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I only have one data field in my grid which defaults to now() so I didn't realize it was a problem until you mention it and I try to blank the date.



I just tried using an SF wrapper UltraDateTimePicker as an editor component and at least the error message is different. When I blank the field in the grid I get an error that i have violated the minimum on the datetimeconstraint and the date is set to 01/01/0001



I think modifying an editorcomponent is going to be the way to go, but haven't worked it out yet. Perhaps modifying the SF picker control to implement that interface Infragistics says is necessary to use a control in an Ultragrid ? Or just using a straight winforms datetime picker and implementing that interface as well as the logic that SF uses to blank dates on null?
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
By the way, since we are in this UltraGrid marathon, have you been dealing with date columns on the grids? I am going nuts trying to duplicate the DateTimePicker behavior where 1/1/1800 should show empty date and entering empty date should save 1/1/1800 to the table.
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Greg McGuffey (06/02/2010)
Charles is like a kid in a candy store..... w00t


That is a common effect from SF Hehe

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Charles is like a kid in a candy store..... w00t
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Actually we got it working BigGrin



It turns out my code to override the tabcontrol and to set focus coming out of the groupbox was the right thing.



But your baseform code in ProcessCmdKey was what was actually making it leave the grid. That is the right place to put it ( though it still seems to have the problem of not knowing where to go next )



I took out your baseform code and it stopped working. Put it back in, took out my Ultragrid onkeydown code for the navigation and it still works.



Oh, and I subclassed groupbox to call me.controls(0).focus() on Enter to be used where it just contains a grid. Created a property NextControl ( string ) and am trying to figure out how to say, in the Leave of the groupbox class "Set focus to the control named NextControl"



Here's the latest



Attachments
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Brilliant, Charles! Great to hear you got it working. Wink
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
BigGrinBigGrinBigGrinBigGrinBigGrinBigGrinBigGrin



Actually, it is kind of easy. ( or at least the 90% I have so far is )



First, the ctrl-tab handled by the tabcontrol has to be disabled. In the subclass of TabControl :



Public Class MyTabControl

Inherits MicroFour.StrataFrame.UI.Windows.Forms.TabControl



Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)

If e.KeyCode = Keys.Tab AndAlso e.Control Then

e.Handled = False

e.SuppressKeyPress = False

Else

MyBase.OnKeyDown(e)

End If



End Sub

End Class




This allows the cntrl-tab to fire in the Ultragrid and to actually leave the grid and the groupbox. The problem is, I can't tell where it goes next. the next control doesn't get focus, but tab again and the control after that gets focus, so it did honor the tab order but somehow lost energy for focusing.



But if I explicitly call the focus() of that next control in the tab order in groupbox.leave everything is good.



Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

Me.grdCustomers.Focus()

End Sub



Private Sub GroupBox1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles GroupBox1.Leave

Me.Textbox2.Focus()

End Sub





For now, this will work, though I want to make it generic and actually have a subclassed groupbox that knows how to set focus to its contained ultragrid on Enter and set focus to the next control according to the TabOrderController on Leave.



I'll be working on it more but here is it so far





Attachments
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Not sure I understand. Moving between tab pages isn't the problem. I just need to subclass the tab control to completely ignore key input just as the form does, no? I will look at the ultratab to see if I can turn it off there.



Somewhere a tabcontrol is handling control tab and I think all I need to do is convince it to ignore it.



I'll read your reply over a couple of times to see if I'm getting it but I may end up just finding a combination that is *not* blocked by tabcontrol and using that. So far I know ctrl-tab and ctrl-E won't work.



Maybe Stackoverflow will come to the rescue ...



It just seems it should be easier than this, given the granular control we have over most of the .net events.



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search