iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
We are running a website on Windows 7 Server with China Chinese (zh-CN) culture and having a strange problem while sorting Grid Columns, the details of the problem are as follows,We are using a grid with Classic Paging and Custom Paging Load.
<LayoutSettings PagingMode="ClassicPaging" PagingLoadMode="Custom" PagingSize="20" AllowSorting="Yes"> </LayoutSettings>
ISDataSource having our own sorting method "GetData"
<ISDataSource:ISDataSource ID="ISDataSource1" runat="server" SchemaType="CustomObject"> <Tables> <ISDataSource:ISDataSourceTable SelectMethod="GetData" EnablePaging="true" SelectCountMethod="GetCount" TableName="Messages_Center" TypeName="WebApplication1.App_Code.Messages_Center"> </ISDataSource:ISDataSourceTable> </Tables> </ISDataSource:ISDataSource>
We are experiencing the following behaviour : When I sort the "StepName" column(contains Simplified Chinese) from A to Z we get the correct value of each page ( see the attach picture) througth "GetData" method.But each page show the value only containing Simplified Chinese incorrectly(see the attach picture).
Do you have any idea on what is causing this behaviour ?We need to fix this soon, kindly help
Thanks
Hello,
I couldn't download your attached WebApplication1.rar. The link is corrupted.
If it's possible, could you provide the working sample that I can download?
Since I don't have a chinese database, it is difficult for me to run a test based on your scenario.
Therefore, it would be helpful if you can provide a simple working sample (including the database) that replicates your issue.
Thank you.
Regards,
-Martin-
Hi Martin,
the attachment files are the code and the sql server 2005 database.Thanks for your help!
gavin
Hello Gavin,
I couldn't find StepName column in the attached sample.
Let me clarify your error. The sorting produces incorrect sorting value when you use WebGrid.
But when you use the same method on other control, it work fine. Is this correct?
However, if you try to sort in the grid without enabling paging, will the sorting value still display incorrectly?
Regards,-Martin-
You can find "BeiZhu" column in the attached sample.
Our own sorting method "GetData" return the correct sorting value in the attached sample when we are using a grid with Classic Paging and Custom Paging Load .But the sorting value display incorrectly.(see the attach picture)
I sort in the grid without enabling paging, the sorting value still display incorrectly.
Regards,-gavin-
Regarding this issue, I will need to discuss further with the developer team.
I will let you know when I get the update news from them.
I've discussed this issue with the developer team.
It is recommended to use either LinqDataSource or ISLinqDataSource in order to sort the data correctly, because WebGrid's sorting is using ASCII code mechanism. Therefore, it might not suitable for your scenario and the sorting will not work perfectly in chinese characters.
If you use LinqDataSource, it will sort the data from the server, not using WebGrid's sorting mechanism.
Hope this helps. Thank you.
Thank you for your kind reply!
However, in the large amount of data and flexibility,it is not enough for us to use LinqDataSource or ISLinqDataSource.Such as our queries is not sure sometime, we have many ready-made "GetData" methods , we need to handle large amount of data and so on. Is there any way to solve the chinese sorting issue when we use ISDataSource having our own sorting method? Or do you have an indirect solution to solve this problem?
We need to fix this soon, kindly help
I'm currently forwarding your issue to the developer team.
I will let you know when I get any feedback from them.
Is there any feedback from your developer team?
Unfortunately, I haven't received any update from them.
Your issue is already queued in our work items. Possibly, it hasn't been processed further due to work items priorities and urgency.
I may be able to help raising the priority for your issue if you can assist me with your license information. Could you let me know if you currently own an active subscription?
I just get the update from the team.
When using ISDataSource, this issue could be resolved by setting the CultureInfo.CurrentCulture to new CultureInfo(“zh-CN”).
This is already implemented in ISDS, but certainly won’t work in SQLDS or others. But I believe you are using ISDS in your project.
Therefore, please try this suggestion and see how it works on your end.
Actually we are using ISDS in our project! However, I had not found the CultureInfo.CurrentCulture. I found a property called Culture in the LayoutSettings property, and I set the culture in IntializeLayout(Please see the attached sample).
protected void WebGrid1_OnInitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e) { CultureInfo culture = new CultureInfo("zh-CN"); this.WebGrid1.LayoutSettings.Culture = culture; this.WebGrid1.LayoutSettings.TextSettings.Language = LanguageMode.UseCulture; this.WebGrid1.LayoutSettings.TextSettings.UseLanguage = culture.ToString(); }
However, chinese sorting issue still exist.Where should the WebGrid's CultureInfo.CurrentCulture should be set?
I’m currently still investigating this issue and need more time to provide you with solution, suggestion, or sample. I’ll get back to you as soon as possible.
You should use System.Threading.Current.CultureInfo.CurrentCulture. Note that this is not a WebGrid's properties since this issue is related to ISDataSource instead.
I had not found the System.Threading.Current.CultureInfo.CurrentCulture. I found a property called System.Threading.Thread.CurrentThread.CurrentCulture property, and I set it to new CultureInfo(“zh-CN”).
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-CN"); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");
However, chinese sorting issue still exist.Where should the System.Threading.Current.CultureInfo.CurrentCulture should be set?
Let me clarify this property with the developer team.
I will get back to you as soon as possible.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname