|
Rank: Newbie Groups: Member
Joined: 5/27/2009 Posts: 9
|
Hi,
We have a E.O Web Grid (2009 version) with 1500 rows, when i sort by one of then the IExplorer show me alerts about the execution of the script. I think it's a problem of performance.
How can I solve this problem?
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
What is the column data type?
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/27/2009 Posts: 9
|
Is a StaticColumn with the AllowSort flag=TRUE. In this column I load strings (html). For example: <span style='font-weight:bold;color:red'>Invalid</span>
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Just to let you know that we are still working on this one.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We tested it on the latest version and it can sort about 5000 rows less than a second with no problems. However it does give a "busy" message when we increased the row number to 10000.
So please check whether your have the latest version first. If you already have it, you may want to consider enable paging and do the sorting on the server side. Client side sorting is done by calling string.localeCompare. Since it is a built-in function, there is very little we can do to make it faster.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/27/2009 Posts: 9
|
Hello,
I'm sure we have the last version because we purchased two months ago. When u say "5000 rows less than a second" is sorting on client side?
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Yes. It's sorting on the client side.
|
|
Rank: Newbie Groups: Member
Joined: 5/27/2009 Posts: 9
|
Umm.strange.
1.- ¿The javascript alert message in IExplorer is displayed?
2.- Could u send me the colums properties of your test?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Here is our test code:
Code: HTML/ASPX
<eo:Grid ID="Grid1" runat="server" Width="380px"
Height="200px" BorderColor="#828790" BorderWidth="1px"
ColumnHeaderAscImage="00050204" ColumnHeaderDescImage="00050205"
ColumnHeaderDividerImage="00050203" ColumnHeaderHeight="24"
FixedColumnCount="1" Font-Bold="False" Font-Italic="False" Font-Names="Tahoma"
Font-Overline="False" Font-Size="8.75pt" Font-Strikeout="False"
Font-Underline="False" GridLineColor="240, 240, 240" GridLines="Both"
ItemHeight="19">
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ItemStyles>
<eo:GridItemStyleSet>
<ItemStyle CssText="background-color: white" />
<ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" />
<SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" />
<CellStyle CssText="padding-left:8px;padding-top:2px;white-space:nowrap;" />
</eo:GridItemStyleSet>
</ItemStyles>
<ColumnTemplates>
<eo:TextBoxColumn>
<TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
</eo:TextBoxColumn>
<eo:DateTimeColumn>
<DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19"
DayHeaderFormat="FirstLetter" DisabledDates="" OtherMonthDayVisible="True"
SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
TitleRightArrowImageUrl="DefaultSubMenuIcon">
<TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
<SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
<CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
<TitleArrowStyle CssText="cursor:hand" />
<DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
<MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
<TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
<OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
<DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
</DatePicker>
</eo:DateTimeColumn>
<eo:MaskedEditColumn>
<MaskedEdit ControlSkinID="None"
TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
</MaskedEdit>
</eo:MaskedEditColumn>
</ColumnTemplates>
<ColumnHeaderHoverStyle CssText="background-image:url('00050202');padding-left:8px;padding-top:4px;" />
<Columns>
<eo:StaticColumn DataField="name" HeaderText="Name" AllowSort="True">
</eo:StaticColumn>
</Columns>
<ColumnHeaderStyle CssText="background-image:url('00050201');padding-left:8px;padding-top:4px;" />
</eo:Grid>
Code: C#
public class test
{
private string m_szName;
private static Random m_Random = new Random();
public string name
{
get
{
//IMPORTANT: Modify the following line from "<div" to "<div"
return string.Format("<div style='color:red'>{0}</div>", m_Random.Next());
}
set { m_szName = value; }
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList tests = new ArrayList();
for (int i = 1; i < 5000; i++)
{
test t = new test();
t.name = i.ToString();
tests.Add(t);
}
Grid1.DataSource = tests;
Grid1.DataBind();
}
}
This code does not display the JavaScript alert message. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/27/2009 Posts: 9
|
Hi,
Thanks, I have tried your code and works fine. But if you change the line
return string.Format("<div style='color:red'>{0}</div>", m_Random.Next());
by
return string.Format("<div style='color:red'>{0}</div>", 555);
You'll see that does not work well. I think that when there are many repeated data the sorting algorithm is very slow. In my case I have only two different values in the 1500 rows and probably this is the problem.
Thanks for everything
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
In that case you might want to add a second "key" to your data. For example, change it to
string.Format("<div style='color:red'><span style='display:none'>{0}</span>{1}</div>", record_id, 555);
It added an additional invisible segment "<span style='display:none'>{0}</span>". This segment is different for every record but does not change what you see.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/27/2009 Posts: 9
|
Good solution, now works fine!
Thanks u
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Glad that it works for you!
|
|