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
55
Key not found error thrown when assigning the value to datarow
posted

I got the below mentioned error when assigning the value to datarow. This issue happen only when using Hungarian locale. 

We are running the application in the Hungarian language. The same code works fine in English locale.

Infragistics.Win.UltraWinDataSource.UltraDataSource ultraDataSourcePages;
string strColumnCaption1 = "ColumnX";
string strColumnCaption2 = "ColumnY";
Infragistics.Win.UltraWinDataSource.UltraDataColumn ultraDataColumn1 = new Infragistics.Win.UltraWinDataSource.UltraDataColumn(strColumnCaption1);
Infragistics.Win.UltraWinDataSource.UltraDataColumn ultraDataColumn2 = new Infragistics.Win.UltraWinDataSource.UltraDataColumn(strColumnCaption2);
ultraDataSourcePages.Band.Columns.AddRange(new object[] { ultraDataColumn1, ultraDataColumn2});
Infragistics.Win.UltraWinDataSource.UltraDataRow dataRow = this.ultraDataSourcePages.Rows.Add();
dataRow[strColumnCaption1] = 10;
dataRow[strColumnCaption2] = 20;//Throwing error

Exception:
Key not found
Parameter name: key
at Infragistics.Shared.KeyedSubObjectsCollectionBase.GetItemUsingCachedKeys(String key, Boolean throwException)
at Infragistics.Shared.KeyedSubObjectsCollectionBase.GetItem(String key)
at Infragistics.Win.UltraWinDataSource.UltraDataColumnsCollection.get_Item(String columnKey)
at Infragistics.Win.UltraWinDataSource.UltraDataRow.set_Item(String columnKey, Object value)
at AddGridRow(Object page)

We found that the letter 'Ny' is treated as separate alphabet in Hungarian language, so due to this its throwing error.

string value "ColumnY" has the letter 'Ny', while match for this key in the column collection its throws error.

Can you explain how key is searched in the key collection with the infragistics code (dataRow[strColumnCaption2]), are you using any ToLower() functions?

The same scenario is handled properly with the DataTable and DataRow of Microsoft C# code.

Can you provide fix for this ?

we are using Infragistics 11 version in our code