This is a migrated thread and some comments may be shown as answers.

Problem Load Diagram with different Regional additionnal Parameters decimal and list separator

1 Answer 46 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Lise
Top achievements
Rank 1
Lise asked on 20 Mar 2018, 11:28 AM

Hi !

 

I  have a problem with the Diagram and Load (Serialize/Deserialize).

If I create a diagram on my computer with a Culture (FR for example) but setting additionnal Parameters :

- Decimal Separator : "." and List Separator : ","

I can create a diagram, open it, save it, ... No problem.

 

Now, I keep the same Culture (FR) but I change the additionnal Parameters :

- Decimal Separator : "," and List Separator : ";"

If I try to Load the previous created Diagram I have an error from the Load Method:

"Index was outside the bounds of the array."

This happens when the method :public Sub Load(serializationValue As String) Member of Telerik.Windows.Controls.RadDiagram is called.

The Serialized XML loaded is exactly the same if I create the diagram with different additionnal parameters of the culture. So, I think it's a problem from the Load method... Maybe...

 

Could you please help me ??

 

 

 

1 Answer, 1 is accepted

Sort by
0
Lise
Top achievements
Rank 1
answered on 20 Mar 2018, 12:23 PM

Problem solve !

 

I force the culture parameters to always be in the same configuration :

String CultureName = Thread.CurrentThread.CurrentCulture.Name;
CultureInfo ci = new CultureInfo(CultureName);
if (!ci.NumberFormat.NumberDecimalSeparator.Contains("."))
{
ci.NumberFormat.NumberDecimalSeparator = ".";
Thread.CurrentThread.CurrentCulture = ci;
}
if (!ci.TextInfo.ListSeparator.Contains(","))
{
ci.TextInfo.ListSeparator = ",";
Thread.CurrentThread.CurrentCulture = ci;
}

Tags
Diagram
Asked by
Lise
Top achievements
Rank 1
Answers by
Lise
Top achievements
Rank 1
Share this question
or