Is there a way to have different data in each row specific column COMBO LIST

Posted by: amit.jain3 on 22 January 2023, 8:52 pm EST

    • Post Options:
    • Link

    Posted 22 January 2023, 8:52 pm EST

    Hello,

    I am using Flex Grid which have 4 columns. I want the last column to be have combolist and each row combolist will have different value.

    If I am using

    .Cols(VALUE).ComboList = col_valueGridData.ToString - If is use this line the column has same data in comboList

    and if I use .Rows(.Rows.Count - 1).ComboList = col_valueGridData.ToString - the whole row is converted to combolist but has different data for each row.

    Can we do like .Rows().Cols().ComboList ?

  • Posted 22 January 2023, 9:42 pm EST

    Hello Amit,

    As of now, there is no direct way to assign the combolist to the cell directly but you can create a custom CellStyle and set its Combolist property, and then assign that specific CellStyle to a particular cell to achieve this requirement. Please see the following code for the same:

    CellStyle cs = c1FlexGrid1.Styles.Add("Style");
    cs.ComboList = "Value1 | Value2 | Value3";
    c1FlexGrid1.SetCellStyle(1, 2, cs);

    If you want to assign different combo list values based on any other cell value then you can refer to the following blog implementing the same:

    https://www.grapecity.com/blogs/how-to-assign-different-combobox-values-in-each-row-of-a-winforms-datagrid

    Regards,

    Prabhat Sharma.

Need extra support?

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

Learn More

Forum Channels