Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2715
Value List weird behaviour
posted

Hi !

I have a value list wich i apply to a column.

this is my value list :

 

 ValueList values = new ValueList();

 

            _cmd = new OracleCommand("select id, name from users", _conn);

            OracleDataReader odr = _cmd.ExecuteReader();

            if (odr != null && odr.HasRows) {

                while (odr.Read()) {

                    string id = odr[0].ToString();

                    string name = odr[1].ToString();

 

                    ValueListItem item = new ValueListItem(id, name);

                    values.ValueListItems.Add(item);

                }

            }

odr.Close();

 

 

So, this I apply to a column, and everything seems to be ok - it transforms the underneath ids to names, it saves any modification, etc.

My problem is when i try to insert something by typing in the value list. If i'm typing a name that does not exist in the loaded users, the characters are appearing very slow - there's something like a delay.

I type "asdfghjkl" and the characters are displayed in about 5 secs.

If i type a name that exists in the value list everything is ok. Also, it's ok if i type numbers, like "2334532654654".

Do you have any idea what's happening ?

Thank you!

Parents
  • 20872
    Offline posted

    Hello Mismar,

    I believe that what's happening in your scenario is the following:

    1. The DataType of the column having ValueList is a numeric like Integer or Double.
    2. Both of your ValueList properties - ID and Name are strings, so the slowlyness coming from the conversation time that the UltraGrid needs in order to perform the check whether the text that you are typing matches to one of items or not.

    Assuming that you are having Int column, and your ValueList contains the following Id - name pairs:

    "1" - "John"
    "2' - "Peter"
    "3" - "Sam"

    Now if you type only numbers like "2131321" the conversion would be really faster because this string contains only numeric chars and that's why the UltraGrid performs faster checks.

    If you write something like "abcdefjh" in the cell, the conversion would be really slower, becuase it will have to check each string char if maching any of the other values, which I assume are integers, and thus the process is slower.

    In order to verify  if my suggestion is correct, could you please change the data type of your column to be string, or even try it on another string column, and than perform the mentioned steps one more time.

    If you need any other assistance with this behavior please feel free to let me know.

     

Reply Children
No Data