ComboList inside C1FlexGridClassic load on demand

Posted by: salams on 24 January 2018, 5:52 pm EST

    • Post Options:
    • Link

    Posted 24 January 2018, 5:52 pm EST

    Hi,

    I am using C1FlexGridClassic and one of the Column is ComboList that need to display alot of items as combolist.

    when i use set_ColComboList and attached to it the list of data it take long time to open the combolist.

    is there any way to implement the load on demand or make it load faster?

    i am attaching example

    CombolistLoadDataIssue.zip

  • Posted 28 January 2018, 5:10 pm EST

    Hi,

    Please note, there is no way to make faster loading with ComboList when the number of items is large.

    However, you can use combo box as custom editor for achieving your requirement as:

        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                this.Load += Form1_Load1;
            }
            ComboBox c1 = null;
            private void Form1_Load1(object sender, EventArgs e)
            {
                string list = "0;0|2;2|3;3.....";
                c1FlexGridClassic2.AllowEditing = true;
                c1FlexGridClassic2.ColumnCollection[1].TextAlign = TextAlignEnum.RightCenter;
                c1 = new ComboBox();
                c1.Items.AddRange(list.Split('|'));
                c1FlexGridClassic2.ColumnCollection[1].Editor = c1;
            }
        }
    

    Hope, it will solve your issue.

    Thanks,

    Singh

  • Posted 30 January 2018, 9:09 pm EST

    Hi sonu.singh,

    its actually faster but i have now another issue with the ComboList

    private void Form1_Load1(object sender, EventArgs e)

    {

    string list = “0;0|2;2|3;3…”;

    c1FlexGridClassic2.AllowEditing = true;

    c1FlexGridClassic2.ColumnCollection[1].TextAlign = TextAlignEnum.RightCenter;

    c1 = new ComboBox();

    c1.Items.AddRange(list.Split(‘|’));

    c1FlexGridClassic2.ColumnCollection[1].Editor = c1;

    }

    when i open the ComboList now the item display for example the first item is 0;0 and it should be “0” the display and “0” the value . see attached file ComboListItemsIssue.jpg

    and what we want to see is key ,value like attached file ComboListItemsShouldbe.jpg .

  • Posted 31 January 2018, 3:11 pm EST

    Hi,

    Please find a sample application attached for achieving your requirement.

    Thanks,

    Singh

    CombolistLoadDataIssue_Mod.zip

  • Posted 31 January 2018, 6:08 pm EST

    it’s working , thanks a lot sonu.singh.

  • Posted 24 February 2018, 10:46 pm EST

    hello

    i have another issue

    after i select item in the combobox i receive error message:

    System.FormatException occurred

    HResult=-2146233033

    Message=Input string was not in a correct format.

    Source=mscorlib

    StackTrace:

    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

    InnerException:

    the column type is int32 i need to keep it like this and not changing it to string

  • Posted 25 February 2018, 4:02 pm EST

    Hi,

    Please note, this is the desired behavior of control, if you want to display a string that is not convertible in Integer. You need to set String datatype for the same column.

    Hope, you can understand the same as developer.

    Also please create a new thread if your previous query is closed or not related to current one.

    Thanks,

    Singh

  • Posted 25 February 2018, 5:14 pm EST

    there is 2 way binding between the grid and the dataset

    i there the error message happen after the dataset get the string value from the combobox and try to update the dataset with it

  • Posted 25 February 2018, 6:37 pm EST

    hi again,

    Please find a sample application attached for demonstrate the issue bellow

    run the application and try to change one of the combobox value in column 1 and then click in other cell in the grid and you will see the exception in Application.Run(new Form1());

    for seeing the exception please enable the “Common Language Runtime Exceptions”

    System.FormatException occurred

    HResult=-2146233033

    Message=Input string was not in a correct format.

    Source=mscorlib

    StackTrace:

    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

    StringToNumberexception.zip

  • Posted 26 February 2018, 3:00 pm EST

    Hi,

    I escalated this to concern team. Will let you know as soon as there is any information from them.

    (TFS ID: 310836 for internal use only.)

    Thanks,

    Singh

  • Posted 27 February 2018, 5:00 pm EST

    hello,

    please provide update from concern team

  • Posted 28 February 2018, 2:25 pm EST

    Sure. Will do once there is anything.

  • Posted 28 February 2018, 11:17 pm EST

  • Posted 4 March 2018, 5:14 pm EST

    hello,

    I’m still waiting for a solution.

    Thanks

    Salam S

  • Posted 5 March 2018, 4:28 pm EST

    Hi,

    The issue is still with the development team. I have raised its priority. Will let you know once there is any information from them.

    Thanks,

    Pragati

  • Posted 6 March 2018, 8:59 pm EST

    Hello,

    As per the team,

    The user should use the same DataMap for column with combobox to convert ID to Display value.

    Also, the IC1EmbeddedEditor.C1EditorGetValue() implementation of MyComboBox class should return SelectedItem.Id to use it with DataMap in the column.

    A sample has been attached for your reference.

    Best Regards,

    Esha

    WindowsFormsApplication8.zip

  • Posted 7 March 2018, 12:19 am EST

    Hello esha.dhir,

    its look good . thanks a lot.

Need extra support?

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

Learn More

Forum Channels