hi we have a problem with the Arabic text displaying. basically we subscribe to Arabic rss feed @https://arabic.cnn.com/rss
here is a snippet of the feed:
<item> <title>مسؤول كوري شمالي لـCNN: لن نوقف التجارب النووية والصاروخية</title> <link>https://arabic.cnn.com/world/2017/04/27/wd-250417-north-korea-dprk-official-interview</link> <description>يجري الجيش الكوري الشمالي ما وصفه بأنه "أكبر تدريب عسكري". </description> <pubDate>Thu, 27 Apr 2017 08:41:18 +0000</pubDate> <dc:creator>nshalalda</dc:creator> <guid isPermaLink="false">107711 at https://arabic.cnn.com</guid> </item>
as you see the highlighted <title> node, this is what we wanted to display in the grid text. note that if you put the following text in WORD:
<title>مسؤول كوري شمالي لـCNN: لن نوقف التجارب النووية والصاروخية</title>
and click on text direction button: you get the following result
مسؤول كوري شمالي لـCNN: لن نوقف التجارب النووية والصاروخية</title>
note that it moved the text to the right and the order of the text had been altered.
back to the DevExpress grid control, I added the following in the CustomDrawCell function trying t o achieve the same effect:
e.Appearance.TextOptions.RightToLeft = true;
unfortunately it's not doing anything, it's not even align the text to the right.
i have to add the following so the text align to the right:
e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
but the text order is wrong and the following is displayed (the same as the raw feed):
<title> مسؤول كوري شمالي لـCNN: لن نوقف التجارب النووية والصاروخية</title>
I know there are lots of things going on on your end regarding RTL in recent years, can I get an update on if the control support displaying Arabic text? or did I do something wrong?
thanks
Jia
UPDATE: in the editor the text showed up the correct order but as soon as i click on Submit button the text messed up so there's even a bug here :)
anyways, I have made a screenshot of what the text supposed to look like. see attachment,
I have to add attachment here. "Edit" won't allow me to add attachment anymore…
Hello Jia,
Before providing you with a solution, I wish to clarify your task. Do you wish to paint the Grid in the right-to-left direction or only the text in a specific cell? Generally, it is possible to enable RTL using the RightToLeft property.
When this property is set to DefaultBoolean.True text in the Grid is painted in correct direction.
UPDATE: in the editor the text showed up the correct order but as soon as i click on Submit button the text messed up so there's even a bug here :)
I've created a separate ticket on your behalf regarding this problem: Arabic text order is changed when a ticket's data is submitted. Our team will address it as soon as possible.
hi Sasha,
thanks for the reply.
since it's Arabic, we want to show it the right way Arabic people read. so in this case we need to make sure the following 2:
so what we need is the text in the cells should show up as expected.
I agree with you, and I tried to set the RightToLeft property: e.Appearance.TextOptions.RightToLeft = true; but it seems not doing the job.
regarding the DefaultBoolean.True , can you explain a bit more? I don't see how it can be applied here…
thanks
Jia
and FYI this grid is used in a multi-language environment meaning not all the rows are Arabic. so some of them will be LTR and some will be RTL. this is why we are trying to manipulate the text in the
CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
function. here I located the e.Appearance.TextOptions.RightToLeft property and this takes a Boolean instead of DefaultBoolean.