Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Language Packs ...  How do you localize a datagrid with RTL LTR?
Previous Previous
 
Next Next
New Post 2/3/2006 7:34 PM
User is offline eyal mayroz
10 posts
10th Ranked


How do you localize a datagrid with RTL LTR?  

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 4:11 PM
User is offline eyal mayroz
10 posts
10th Ranked


Re: How do you localize a datagrid with RTL LTR?  

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 5:09 PM
User is offline eyal mayroz
10 posts
10th Ranked


Re: How do you localize a user control with RTL LTR?  
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 6:27 PM
User is offline eyal mayroz
10 posts
10th Ranked


Re: How do you localize a user control with RTL LTR?  
Modified By eyal mayroz  on 2/13/2006 1:48:42 AM)

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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Language Packs ...  How do you localize a datagrid with RTL LTR?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


T-WORX, INC.
Professional DotNetNuke Solutions
www.t-worx.com
AppTheory
Professional development for medium to large projects based on the DotNetNuke platform.
www.apptheory.com
OnyakTech
Modules for Help Desks, Live Chat, Project Management, CRM, Charting, Reporting, Scrolling Text/Images, Portal Community tools and much more.
www.OnyakTech.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP