C1Flexgrid C1ExpressionEditor Integration Not Working

Posted by: gkayne on 26 April 2020, 12:46 am EST

    • Post Options:
    • Link

    Posted 26 April 2020, 12:46 am EST

    After adding multiple unbound columns with AllowExpressionEditing to a flexgrid, the expression for each of the columns is reset to null when you use the expression editor to update a column’s expression.

    To duplicate this:

    • open the sample at "ComponentOne Samples\WinForms\v4.5.2\ExpressionEditor\VB\FlexGridIntegration

    • add a button with the following event handler:

      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

      Dim column = C1FlexGrid1.Cols.Add()

      column.Name = “CustomCol_” & C1FlexGrid1.Cols.Count

      column.Caption = column.Name

      column.DataType = GetType(Object)

      column.AllowEditing = False

      column.AllowExpressionEditing = True

      End Sub

    • use the expression editor on any of the columns added and notice that it resets the expressions previously assigned to the other added columns.

  • Posted 26 April 2020, 1:55 am EST

    A work around to this issue is to replace the unbound column with a clone after the Expression Editor has been closed. See the code below:

    
    
    Private Sub C1FlexGrid1_GridChanged(sender As Object, e As GridChangedEventArgs) Handles C1FlexGrid1.GridChanged
    
            If e.GridChangedType = GridChangedTypeEnum.ExpressionChanged Then
    
                Static Index As Integer = -1
    
                If Index = e.c1 Then Exit Sub
    
                Index = e.c1
    
                Dim Column = C1FlexGrid1.Cols(Index)
                Dim Name = Column.Name
                Dim Caption = Column.Caption
                Dim DataType = Column.DataType
                Dim AllowEditing = Column.AllowEditing
                Dim Expression = Column.Expression
                C1FlexGrid1.Cols.Remove(Column)
    
                Column = C1FlexGrid1.Cols.Insert(Index)
                Column.Name = Name
                Column.Caption = Caption
                Column.DataType = DataType
                Column.AllowEditing = AllowEditing
                Column.AllowExpressionEditing = True
                Column.Expression = Expression
    
                Index = -1
    
            End If
    
    End Sub
    
    
    
  • Posted 26 April 2020, 4:28 am EST

    A second issue - when the data source is a LiveView (C1.LiveLinq.LiveViews.View) and multiple unbound columns are added - only the left-most unbound column displays its results in the grid. Move the columns around - the left-most unbound column displays its values, but the other unbound columns do not display their values.

    To recreate this, use the same sample referenced in the original post and replace the “GetDataSource” Function with the code shown below (note you will need to add a project reference to the C1.LiveLinq.4.5.2 library)

    
        Private Function GetDataSource() As View
            Dim rs As String = "select ProductName, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel from Products;"
            Dim cn As String = GetConnectionString()
            Dim da As OleDbDataAdapter = New OleDbDataAdapter(rs, cn)
            Dim dt As DataTable = New DataTable()
            da.Fill(dt)
            Dim varQuery = From varItem In dt.DefaultView.AsLive(Of Object)
            Return varQuery
        End Function
    
    
  • Posted 26 April 2020, 11:31 pm EST

    Hi,

    Thanks for reporting the issue. We’ve reported it as a bug to the developers [Internal Tracking ID: 432986].

    We’ll let you know when a fix for this is available.

    Regards,

    Jitender

  • Posted 22 May 2020, 5:36 pm EST

    Any update on this.

  • Posted 25 May 2020, 3:43 pm EST

    Hi,

    The issue has been fixed. The fix should be available in a hotfix update.

    Regards,

    Jitender

  • Posted 28 May 2020, 8:24 am EST

    The first issue was corrected in the hotfix update, however the second issue still exists:

    When the data source is a LiveView (C1.LiveLinq.LiveViews.View) and multiple unbound columns are added - only the left-most unbound column displays its results in the grid. Move the columns around - the left-most unbound column displays its values, but the other unbound columns do not display their values.

    To recreate this, use the same sample referenced in the original post and replace the “GetDataSource” Function with the code shown below (note you will need to add a project reference to the C1.LiveLinq.4.5.2 library)

     Private Function GetDataSource() As View
            Dim rs As String = "select ProductName, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel from Products;"
            Dim cn As String = GetConnectionString()
            Dim da As OleDbDataAdapter = New OleDbDataAdapter(rs, cn)
            Dim dt As DataTable = New DataTable()
            da.Fill(dt)
            Dim varQuery = From varItem In dt.DefaultView.AsLive(Of Object)
            Return varQuery
        End Function
    
  • Posted 28 May 2020, 10:04 pm EST

    Hi,

    We’ve asked the developers to look into the issue [Internal Tracking ID: 438497]. I’ll update the thread once we get any information from them.

    Regards,

    Jitender

  • Posted 31 May 2020, 10:27 pm EST

    Hi,

    The developers have confirmed this as a bug. The fix will be available in 2020v2 update.

    Regards,

    Jitender

  • Posted 10 August 2020, 5:57 am EST

    Hi,

    This issue has been fixed in the latest release builds. You can use the builds in your application to resolve the problem that you are getting at your end.

    You can upgrade the builds via latest ComponentOneControlPanel utility by following below given steps:

    1: Run the utility.

    2: Go to the UPDATE tab under the PRODUCTS tab.

    3: Check the option: Include prerelease and hotfix versions.

    4: Expand WinForms and click the update button.

    Regards,

  • Posted 12 August 2020, 5:29 am EST

    This has not been corrected in the latest update.

  • Posted 12 August 2020, 3:51 pm EST

    Hello,

    Yes, you’re correct. The issue is fixed in an internal build version and not the latest public release. Apologies for the incorrect notification.

    Regards,

  • Posted 12 August 2020, 8:48 pm EST

    Can I get a copy of the internal build.

  • Posted 13 August 2020, 8:56 am EST

    I attached a video showing the behavior when using Expression Editor in a column with a C1Flexgrid bound to a LiveView data source - the last two columns in the video are Unbound. Is this issue caused by using the expression editor or is it with the Flexgrid?

    FlexGrid integration sample 2020-08-13 12-26-36.zipFlexGrid integration sample 2020-08-13 12-26-36.zip

  • Posted 13 August 2020, 7:58 pm EST

    Hi,

    Can I get a copy of the internal build.

    We do not provide internal builds as they are not suitable for normal use.

    I attached a video showing the behavior when using Expression Editor in a column with a C1Flexgrid bound to a LiveView data source - the last two columns in the video are Unbound. Is this issue caused by using the expression editor or is it with the Flexgrid?

    The issue is caused by the use of LiveView with ExpressionEditor. It’s related to the second issue you’ve posted which is fixed in an internal build. You can see that if a DataTable is bound with the grid, the issue does not occur.

    Regards,

    Jitender

  • Posted 8 September 2020, 7:48 pm EST

    Hello,

    The issue has been fixed in the 2020V2 Hf release.

    You can download the builds from the given link:

    http://prerelease.componentone.com/hotfixes/dotnet/C1WinForms-452_4.5.20202.450.zip

    Regards,

    Prabhat Sharma.

  • Posted 11 September 2020, 8:30 pm EST

    It is working - thank you.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels