Export C1FlexGrid with Data Mapping

Posted by: ahmdsalh on 10 January 2018, 6:41 am EST

    • Post Options:
    • Link

    Posted 10 January 2018, 6:41 am EST

    Hi,

    I’m trying to export a C1FlexGrid to excel and other formats.

    My Grid has DataMap in many columns, however when i’m trying to do the export, the generated files contain the original data not the mapped one.

    So, how can i export a grid while preserving the data mapping?

    Thanks

  • Posted 10 January 2018, 5:08 pm EST

    Hi,

    Thank you for contacting us.

    For exporting FlexGrid with data map preserved, you need to use FileFlags.AsDisplayed in SaveExcel/SaveGrid methods.

    Let me know if you need anything else.

    Thanks,

    Ruchir Agarwal

  • Posted 18 August 2019, 8:18 pm EST - Updated 3 October 2022, 3:53 pm EST

    Hi, I’m have a code

    
            Dim c As C1.Win.C1FlexGrid.Column = C1FlexGrid1.Cols(1)
    
            Dim dtMap As ListDictionary = New ListDictionary()
            dtMap.Add(1, "Apple")
            dtMap.Add(2, "Avocado")
            dtMap.Add(3, "Sky")
            dtMap.Add(4, "Coal")
            dtMap.Add(5, "Snow")
    
            c.Name = "DataMap"
            c.DataType = GetType(Integer)
            c.DataMap = dtMap
    
            C1FlexGrid1(1, 1) = 1
            C1FlexGrid1(2, 1) = 2
            C1FlexGrid1(3, 1) = 3
    
            ' the generated the original data not the mapped one 
            MessageBox.Show(C1FlexGrid1(1, 1).ToString) ' = 1
    
            'How can i view DataDisplay (data mapping) from Code ?
            'Error!!
            MessageBox.Show(C1FlexGrid1(1, 1).DataDisplay) 'error
    
    
    

  • Posted 19 August 2019, 2:37 pm EST

    Hello,

    To view the DataDisplay from the code, you need to use the GetDataDisplay method of FlexGrid.

    Code snippet is given below :

    MessageBox.Show(C1FlexGrid1.GetDataDisplay(1, 1))

    Please go through the attached sample demonstrating the same.

    Thanks and Regards,

    Prabhat Sharma.

    DataDisplayFlexGridDemo.zip

Need extra support?

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

Learn More

Forum Channels