Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Gasser  
#1 Posted : Friday, April 20, 2012 10:19:59 AM(UTC)
Gasser

Rank: Newbie

Groups: Registered
Joined: 4/16/2012(UTC)
Posts: 4
Location: Saint-Sulpice

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 :
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

Edited by moderator Tuesday, November 25, 2014 3:50:51 PM(UTC)  | Reason: Attach images

Gasser attached the following image(s):
iGrid001.png
iGrid002.png
iGrid003.png
Igor/10Tec  
#2 Posted : Monday, April 23, 2012 4:19:04 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,111

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
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  
#3 Posted : Thursday, May 3, 2012 8:46:25 AM(UTC)
Gasser

Rank: Newbie

Groups: Registered
Joined: 4/16/2012(UTC)
Posts: 4
Location: Saint-Sulpice

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  
#4 Posted : Friday, May 4, 2012 7:11:26 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,111

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
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  
#5 Posted : Thursday, November 14, 2019 4:27:23 PM(UTC)
GeoU

Rank: Newbie

Groups: Registered
Joined: 11/14/2019(UTC)
Posts: 2

Извиняюсь, что по-русски, английского не хватит, чтобы сформулировать внятно.

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

Дело в том, что не совпадает тип данных поля таблицы, которой заполняется iGrid, и поля, которым заполняется ключ iGDropDownList. Например, в одной int, а в другой byte или long. Особенно неприятно, если в результате какого-нибудь union sql решает, что он сам знает, какой тип данных нужен. Надо либо самостоятельно приводить данные к нужному типу, либо чтобы это неявно умел делать iGrid.

Edited by user Thursday, November 14, 2019 4:29:24 PM(UTC)  | Reason: Not specified

Igor/10Tec  
#6 Posted : Monday, November 18, 2019 3:06:05 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,111

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
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:

Code:
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:

Code:
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:

Code:
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.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.