Infragistics Controls


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
Thanks Russell. Wink

By the way, I have managed to translate the sample into C#. Just found out the thing doesn't Handle Events... BigGrin

Russell Scott Brown
Russell Scott Brown
StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)
Group: Forum Members
Posts: 124, Visits: 597
Yes, congratulations Ivan on your new title!  Well deserved!

Also, can you post a sample for subclassing the Ultragrid in C# in User Contributed Examples forum?

Russ Brown (Using C#2010/SQL Server 2008)

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
Hey Edhy! Thank you... by the way, I solved my grid problem after your post on the Datasource = Nothing. Wink
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Ivan and congratulations on your new title!!! Tongue

Edhy Rijo

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
Hiya.

I have created a sample on this grid layout saving thing. Hehe

Hope it helps in some way. It is on the StrataFrame Users Contributed Samples forum.

Regarding the buttons, I would have to test them, as I haven't used these grids' features yet.

Abraços.

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
This is very cool stuff Smile



I started to subclass the Ultragrid then saw the stuff for saving layout in the grid designer and have just been using that for most of the behavior and appearance properties but I think I still need to learn more about using a subclass.



Since I'm still trying to wrap my head around subclassing the Ultragrid, would you mind posting the actual class code - all of it - of the subclass? I'm still mystified about setting a lot of the properties in code ( the overrides, for example ) and seeing examples in a strataframe context would really help.



This is what I have figured out so far about subclassing it.



Imports Infragistics

Imports Infragistics.Shared



Public Class uWingrid

Inherits Infragistics.Win.UltraWinGrid.UltraGrid



Public Sub new()





Me.DisplayLayout.CaptionVisible = Win.DefaultableBoolean.False

Me.DisplayLayout.GroupByBox.Hidden = True

Me.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.FixedAddRowOnBottom

Me.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.[True]

Me.DisplayLayout.Override.AllowRowSummaries = Infragistics.Win.UltraWinGrid.AllowRowSummaries.[False]

Me.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.[True]

End Sub



End Class






Is there a row delete button ( like the add button ) that can be called up in a setting someplace or is it a matter of calling Activerow.delete() from your own button?



Right now I'm creating a button, making it visible with the Gotfocus of the grid (if the form is in edit or new mode ) and invisible on lostfocus and using it to call Activerow.Delete but if I am going to use this approach I'd rather put the button in the grid header or something in a subclass. I have 13 grids on this form and I have 13 gotfocus/lostfocus/click methods. Would prefer something more generic for my Ultragrids in general.



( and I thought there is probably some Ultragrid delete button property if I could find it Cool )



Any suggestions (and code) most welcome BigGrin



obrigado muito !

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 Gerard.

Well, I think that that is all doable. Have a look at the grid's DisplayLayout.SaveAsXml and you will see that you have many property categories that you can save. I'm posting the code I have on my subclassed grid to give you an idea...

    ''' <summary>
    ''' Created a public method to be called on the Form's OnFormClosing for every Grid on it in order to save
    ''' columns order and width that might have been changed by user and keep it in a XML file. The call is on
    ''' the base form (PFNStandardForm) which checks all form's controls for an UltraGrid and then calls this
    ''' method whenever one is found.
    ''' Tried to use the grid's own Validated but had problems because we need to set the Grid's DataSource
    ''' to Nothing on closing the form to avoid "The given key was not present in the dictionary."
    ''' </summary>
    ''' <param name="grid"></param>
    ''' <remarks></remarks>
    Public Sub SaveGridLayoutAndLeave(ByVal grid As Infragistics.Win.UltraWinGrid.UltraGrid)
        '-- establish locals
        Dim lcPath As String
        Dim lcFile As String

        '-- create the Path
        lcPath = Application.StartupPath & "\Layouts"
        If lcPath <> String.Empty Then
            If IO.Directory.Exists(lcPath) = False Then
                '-- create folder for Grid Layout, if it doesn't exist already
                Try
                    IO.Directory.CreateDirectory(lcPath)
                Catch ex As Exception
                End Try
            End If
        End If

        '-- delete older Layout file, so it won't keep older files when Version changes
        For Each FileFound As String In IO.Directory.GetFiles(lcPath, grid.Name.Trim & "*.xml")
            IO.File.Delete(FileFound)
        Next

        '-- get the path and build the file name
        lcFile = lcPath & "\" & grid.FindForm.Name.Trim & "_" & grid.Name.Trim & "_" & Me.Version.Trim & ".xml"

        '-- save current layout
        Try
            grid.DisplayLayout.SaveAsXml(lcFile, Infragistics.Win.UltraWinGrid.PropertyCategories.Bands)
        Catch ex As Exception
        End Try

        '-- sets Datasource to nothing to avoid "key not found exception"
        Me.DataSource = Nothing
    End Sub

 

Also, to save it, I used its InitializeLayout:

    Private Sub UltraGridOffisys_InitializeLayout(ByVal sender As System.Object, ByVal e As _
                Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles MyBase.InitializeLayout
        '-- establish locals
        Dim lcFile As String

        '-- set path and build the file name
        lcFile = Application.StartupPath & "\Layouts\" & Me.FindForm.Name.Trim & "_" & Me.Name.Trim & "_" & _
                 Me.Version.Trim & ".xml"

        '-- load saved layout, if Version changed, Layout will be reset to original
        Try
            Me.DisplayLayout.LoadFromXml(lcFile)
        Catch ex As Exception
        End Try
    End Sub

As for the roadmap to WPF I only know that the guys are going to get it done, but I don't have a time for that. If I get any info about that, I will come back here.

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
Hey Charles.

Yeah, I saw your post when you wrote it, but since that would be the approach I would take, I was waching to see if someone else gave you some other advice. I will check on that and see if I get other ideas. Wink

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Ivan.

Its interesting tht you have written away settings to an XMl file for users. One of the things i want to do is specify columns, headings, widths, background colour, whether a column is editiable etc in a user file, and then as the grid loads, go to the user file and populate the columns with hte data to be viewed or edited. It would appear that is is all do-able ?

On the WPF side ot things, any idea of what timeline is there to interface SF with some of this Infragistics functionality

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
Hi Ivan



Since Microfour seems to be on a extended vacation Wink would you mind taking a look at my Ultragrid question



http://forum.strataframe.net/Topic26995-7-1.aspx



regarding setting up parent-child data entry Ultragrids.



It seems the technique used for creating reporting involved readonly properties and I thought there might be a better way to accomplish this with Ultragrid for data entry.



Thanks



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