Winform Flexgrid - Column filter values are not formatted as like column values

Posted by: NagarajAtEka on 7 November 2017, 4:06 pm EST

    • Post Options:
    • Link

    Posted 7 November 2017, 4:06 pm EST

    Hi,

    I am applying the column formatting using SetSellStyle method. I can see that the styles applied to the column values as expected. However, the column filter values are still showing the raw values (no formats applied). Please find the below code I have used for the same.

    With fgGrid

    Dim style As CellStyle

    style = .Styles( lStyleName)

    		 If lNumberFormat <> String.Empty Then
                             style.Format = lNumberFormat
                        End If
                        .SetCellStyle(rowIndex, colIndex, style)
                    End With
    

    Please let me know, how can I format the filter values as well.

  • Posted 8 November 2017, 4:42 am EST

    Hi Nagarajan!

    You might be doing this implementation in Form_Load event. I would suggest you to do this using OwnerDrawCell event of FlexGrid. This event fires whenever the cell needs to be painted. This way, you can control cell style even after filtering the values.

    For detailed information on OwnerDrawCell event, please see this link :

    http://helpcentral.componentone.com/nethelp/c1flexgrid/ownerdrawncells.html

    Regards,

    Meenakshi

  • Posted 13 November 2017, 2:15 pm EST

    Hi Meenakshi,

    Will that be OK, if I use SetCellStyle Method inside a OwnerDrawCell.

    I remember I have seen somewhere in the forum, it may create some recursive calls.

    Regards,

    Nagaraj

  • Posted 14 November 2017, 5:22 am EST

    Hi Nagaraj!

    Will that be OK, if I use SetCellStyle Method inside a OwnerDrawCell.

    • Yes.

    I believe, Tips 3 and 4 on the given link would give you a clear answer:

    http://helpcentral.componentone.com/nethelp/c1flexgrid/flexgridforwinformsttoptips.html

    Regards,

    Meenakshi

Need extra support?

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

Learn More

Forum Channels