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


Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Charles R Hankey (06/09/2010)
Você é um gênio e você é meu herói


Oh, that is perfect Portuguese! BigGrin

Thank you for your kind words, Charles. Really glad it worked.

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Charles R Hankey (06/09/2010)
While I'm testing your solution, here's the response I got on StackOverflow. I'm thinking there might be a way to put an UltraDataSource between the BBS and the grid ?

Well, at least you got an answer over there, Experts Exchange didn't get me any.

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Works beautifully ! ( though I was less successful in putting formatting for font, size and bold around the Portugese - some it got post before I could switch to English )



this will definitely solve my immediate issues and really isn't difficult to implement wherever I need dates in an Ultrawingrid



Wow. I'm impressed Cool



Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Você é um gênio e você é meu herói




Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
While I'm testing your solution, here's the response I got on StackOverflow. I'm thinking there might be a way to put an UltraDataSource between the BBS and the grid ?





Do you have an UltraDataSource backing your grid? If so, then e.Row.ListObject should be the UltraDataRow corresponding to the grid's row.



I often keep a reference to a business object in the UltraDataRow's Tag property, and I end up with InitializeRow methods that look like this (apologies for C# instead of VB.net):



private void mygrid_InitializeRow(object sender, InitializeRowEventArgs e)

{

try

{

UltraDataRow udr = e.Row.ListObject as UltraDataRow;

if (udr == null)

{

return;

}



MyRecord rec = udr.Tag as MyRecord;

if (rec == null)

{

return;

}



...



You can also access the underlying datasource values from udr.Band.Cells.



Hope this helps!


Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
YOU ARE MY HERO ! BigGrin



I will test this tonight and let you know



Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Ah, forgot to say... set the actual date column Hidden property to True. Wink
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Charles.

I think I found a way to handle this, not sure you will like it, but it seems to be working.

The idea is to add an unbound column to you grid, you can do that with the grid designer clicking on the "Add Unbound Column" button at the Columns treeview item. Give it a Key name, like ubc_Date. Set its DataType to System.DateTime. We will use this unbound column to store your date from the table. Have a look at the code and let me know.

#Region "  Private Fields  "

    '-- keep current cell state
    Dim _CellUpdating As Boolean = False

#End Region

#Region "  Handled Events  "

    Private Sub grdYourGrid_InitializeRow(ByVal sender As Object, _
                                          ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) _
                                          Handles grdYourGrid.InitializeRow
        '-- check if there are rows to be initialized
        If Me.grdYourGrid.Rows.Count() = 0 Then
            Exit Sub
        End If

        '-- move record point to current row
        YourTableBO1.SeekToPrimaryKey(e.Row.Cells("yt_pk").Value)

        '-- if cell is updating, don't set unbound column
        If _CellUpdating = False Then
            '-- if underlying table has #1/1/1800#, show empty cell for date
            If YourTableBO1.yt_Date = #1/1/1800# Then
                e.Row.Cells("ubc_Date").Value = DBNull.Value
            Else
                e.Row.Cells("ubc_Date").Value = YourTableBO1.yt_Date
            End If
        End If

        '-- reset the flag
        _CellUpdating = False
    End Sub

    Private Sub grdYourGrid_AfterCellUpdate(ByVal sender As Object, _
                                            ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) _
                                            Handles grdYourGrid.AfterCellUpdate
        '-- if unbound date column, deal with empty date
        If e.Cell.Column.Key = "ubc_Date" Then
            If e.Cell.Value Is DBNull.Value Then
                YourTableBO1.yt_Date = #1/1/1800#
            Else
                YourTableBO1.yt_Date = CDate(e.Cell.Value)
            End If
        End If

        '-- set the cell state to updating
        _CellUpdating = True
    End Sub

#End Region


Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I seems the question we really need to ask is : How do we display the date #1/1/1800# as if it were null. And how do we save null to the datasource/bbs as #1/1/1800#



The answers people seem to give seem to always start with telling you you can't have null dates in .NET ( which we know ) but they don't know about our framework's handling nulls as #1/1/1800# Sad

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
I was dealing with other things around here, back to the matter. I have also posted your question in the Experts Exchange forum and will get back to it now. The first to accomplish this gives a shout! BigGrin
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