Gasser
2012-04-20T09:19:59Z
Hello,
I'm facing a strange behavior with iGDropDownList.

I have iGrid with somes dropdown cells. I use the FillWithData function in order to fill the lists, here is my code :

      DataAccess.OpenConnection();

      using(SqlDataReader l_sdrGroups = DataAccess.ExecuteQuery("SELECT ID, Name FROM ActivityGroups"))
        m_gdlGroup.FillWithData(l_sdrGroups, "ID", "Name");

      using(SqlDataReader l_sdrTypes = DataAccess.ExecuteQuery("SELECT ID, Name FROM ActivityTypes"))
        m_gdlType.FillWithData(l_sdrTypes, "ID", "Name");

      DataAccess.CloseConnection();



The first time I display the iGrid it shows the content of the Value col, instead of the Text col :
(See iGrid001)

And when the user drops down the list he can see the right value :
(See iGrid002)

But if I reload the control that owns the iGrid it will display informations correctly :
(See iGrid003)

Is this a bug, or can someone help me resolve this problem ?

Thank you in advance.

Greetings
Gasser attached the following image(s):
Igor/10Tec
2012-04-23T15:19:04Z
After thinking about the problem, we can conclude that the problem occurs after populating the main grid from a datasource using the FillWithData method.

It is evident that we need more information to investigate the issue, so could you prepare and send us a small demo project to demonstrate it? It can be a "standalone" project that does not uses external databases - it seems the problem can be reproduced using say ADO.NET DataTables which are created on the fly in code.
Gasser
2012-05-03T07:46:25Z
Hello Igor,
I tried to reproduce the problem in another application, but I could not get the same behavior.

One more thing : I noticed that I had the same behavior even if the program fills the data without using FillWithData.

It seems like if the problem is caused by the fact that the iGrid control is embeded in an usercontrol.
I had the problem only if I populate the data as the control is not visible (Visible property of the UserControl is set to false).
So I decide to show the control when populating the data and so my problem disappear.

Thank you for the support

Greetings
Igor/10Tec
2012-05-04T18:11:26Z
If you are ever able to create a demo project to reproduce this issue, we would be glad to examine it and fix it if it is a bug in our control as our policy is to have robust and totally bug free products.
GeoU
2019-11-14T16:27:23Z
Извиняюсь, что по-русски, английского не хватит, чтобы сформулировать внятно.

Сталкивался с этой проблемой, и она, к слову, до сих пор актуальна.

Дело в том, что не совпадает тип данных поля таблицы, которой заполняется iGrid, и поля, которым заполняется ключ iGDropDownList. Например, в одной int, а в другой byte или long. Особенно неприятно, если в результате какого-нибудь union sql решает, что он сам знает, какой тип данных нужен. Надо либо самостоятельно приводить данные к нужному типу, либо чтобы это неявно умел делать iGrid.
Igor/10Tec
2019-11-18T15:06:05Z
Thanks to GeoU who sent us a sample demonstrating a possible nature of the problem. Let us translate it into English and place some code.

Let's suppose we have a DataTable defined like this:

DataTable dt = new DataTable();
dt.Columns.Add("combobox", typeof(byte));
dt.Columns.Add("text", typeof(string));


And we use it to populate iGrid in which the first column has the key 'combobox' and is linked to the following drop-down list:

iGDropDownList1.Items.Add((int)1, "Item 1");
iGDropDownList1.Items.Add((int)2, "Item 2");
iGDropDownList1.Items.Add((int)3, "Item 3");


This will not work because the 'combobox' column contains byte values but iGrid expects integers to link them to the drop-down list items. The proper definition for the 'combobox' column in the DataTable would be:

dt.Columns.Add("combobox", typeof(int));


iGrid cannot link bytes to integers because of the general comparison algorithm used to compare two values of any type. Maybe, it's time to improve this algorithm and make it work as expected at least for integer data types? These are System.SByte, System.Int16, System.Int32, System.Int64 and their unsigned counterparts.