Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsLanguage PacksLanguage PacksHow do you localize a datagrid with RTL LTR? How do you localize a datagrid with RTL LTR?
Previous
 
Next
New Post
2/3/2006 10:34 PM
 

Hi,

Here is the question: I have a datagrid that display info. I have localised the header-text and it works fine. However I have a problem with the order of the columns and alignment of data. I would like the order of the columns to be based on the local: If it is RTL language, to have the first column starting from the right and vice versa.

Can this be done?

What about dynamically changing the alignment within the columns and the header?

thanks

 
New Post
2/4/2006 7:11 PM
 

I have found the solution for that whichi is (of course) dir="RTL" as an attribute of the the datagrid. However now I need to dynamically set the dir attribute to LTR (the default so no need to do it explicitly) or TRL. I have have decided to test the locale using System.Threading.Thread.CurrentThread.CurrentUICulture and if it turns out to be an RTL language then set the dir attribute to RTL (is there a better solution?).

Now, I am doing this in the code behind and I'd like to do it for the whole user control (ascx). In my case I have a table as the top most level object (all objects included within the table then should inherit this attribute). So I have tried changing the table to runat=Server and give it an ID so that I can add the attribute in the code behind, and I've declared the table as HtmlTable, but for some reason this doesnt work, rather crashes with an ugly error. Only on another user control where the top most object was a server control such as a asp:panel, did it work properly.

My new question: Can I use the table by turning it into htmltable to do the job as the top most object without having to change it to asp:table ?(since I have a lot of TRs and TDs and I will have to change all of them which is a lot of manual work)

or as an alternative, if I added some other server side object as the top most level object (such as asp:panel), will that be a good alternative, or unnecessarily resource-expensive?

Please advice

 

 

 
New Post
2/10/2006 8:09 PM
 
I've succeeded in using the above mentioned trick on one user control and it works great :

in the ascx's top most table: <table id="tblTop" runat="server"....>
in the codebehind (c#): string mLocale = System.Threading.Thread.CurrentThread.CurrentUICulture.ToString();
if(mLocale == "he-IL") //or any other RTL language you may have
{
    this.tblTop.Attributes.Add("dir", "RTL");
}

However, I have a problem with another user control, seemingly fairly identical to the previous one, which throws a MinMax persistance type of cookie.... error with the following details in the site log:

InnerException: Parser Error: System.Web.UI.HtmlControls.HtmlTableCellCollection must have items of type 'System.Web.UI.HtmlControls.HtmlTableCell'. 'tr' is of type 'System.Web.UI.HtmlControl.HtmlTableRow'.

Now, I didnt call any htmlcontrol in either of the pages, other than the htmlTable (tblTop) and in both pages I've been using plain 'tr' and 'td'.
Why then will it work on one ascx and not on the other??

thanks

 
New Post
2/10/2006 9:27 PM
 

sorry for the trouble with the htmlCellCollection. I've searched and it turned out to be just a misplaced closing of a asp:panel.

The asp:panel however, was the cause for another error which caused the Request Object to throw an exception (I don't know for the life of me why - if you are interested see post http://forums.asp.net/1137272/ShowPost.aspx). Anyway, I ended up getting rid of the asp:panel and the problem is gone.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsLanguage PacksLanguage PacksHow do you localize a datagrid with RTL LTR? How do you localize a datagrid with RTL LTR?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out