Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Pete Dembrowski #1
DataGrid exception on U+200D in text w/ Arial Unicode MS font
The DataGrid control throws the following exception:
"An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
system.windows.forms.dll. Add'l information: "A generic error occurred in
GDI+"
This occurs when I have the 'Font' property set to the "Arial Unicode MS"
font AND send it a string of Unicode-encoded text that contains the Zero
Width Non Joiner character (U+200D). The following code pasted below the
"InitializeComponent" call in a Form ctor will show the problem (of a
default-C# Windows Application project in VS.Net 2003, where the Form has a
DataGrid control named dataGrid1):
+-----------------cut here -----------------+
const string strColumn = "Column name";
DataTable myTable = new DataTable("myTable");
myTable.Columns.Add(new DataColumn(strColumn,typeof(string)));
DataRow rowNew = myTable.NewRow();
myTable.Rows.Add(rowNew);
dataGrid1.DataSource = myTable;
// PROBLEM STATEMENTs begin
rowNew[strColumn] = "\x0938\x091A\x094d\x200d\x091A";
dataGrid1.Font = new Font("Arial Unicode MS", 12);
// PROBLEM STATEMENTs end
+-----------------cut here -----------------+
If you either a) remove the "\x200d" portion of the string or b) comment out
the change of Font property (i.e. so it remains the default "Microsoft Sans
Serif" font), then it works fine.
Any ideas on a fix (besides using a different font?)
Pete Dembrowski Guest
-
how to display unicode characters in datagrid
Characters that are not 7-bit ascii don't display in a datagrid. Do I need a custom cell renderer? My dataprovider is xml data of the form:... -
Arial Unicode TT font not available in ID 3.0.1
Because I design multi-language work, I sometimes use Arial Unicode MS truetype font which contains tons of special characters. But it doesn't... -
Arial Unicode MS
I have a text string using Arial Unicode MS in Word which I want to cut and paste over to Illustrator 10. I have arial unicode ms installed on my PC,... -
Arial Font - Windows 2000 - Being replaced with squares - MX
Hi We tested our product on Windows 2000 and the (non-embedded) Arial font was replaced with funny squares ie none of the characters worked. We... -
Japanese Unicode Font
Hello, once again a problem of displaying japanese text in Flash MX... - Where I'm at : Thanks to this forum I've understood that I had to set...



Reply With Quote

