Welcome Guest Search | Active Topics | Sign In | Register

strange grid error Options
quirtep
Posted: Saturday, February 2, 2013 9:11:52 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
OK, I admit that this is a vague issue - but I seem to have it narrowed down to having something to do with the grid component being sorted. I have a grid with records, when you select a row, it shows the full record in the bottom half of a splitter pane. Everything works great EXCEPT when I first sort the grid by clicking a column header (any of them). Then, when I subsequently select a row, I get the following error:

"Object must be of type String."

Actually, the error message is different on my development machine (Windows 8) than on the hosted server. There, it shows this error under the same conditions:

"At least one object must implement IComparable."

It shows me no code line in the error message, which is another reason I suspect the issue has something to do with the EO.Web.dll. Any suggestions would be MUCH appreciated.

Thank you.
quirtep
Posted: Sunday, February 3, 2013 10:15:45 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
Here is the stack trace - it sure seems to indicate that the issue is related to the EO.Web component:

[ArgumentException: Object must be of type Int32.]
System.Int32.CompareTo(Object value) +14398336
System.Collections.Comparer.Compare(Object a, Object b) +14154538
EO.Web.Internal.ec.a(Int32[] A_0, Int32 A_1, Int32 A_2, IComparer A_3) +892
EO.Web.Internal.ec.a(kq[] A_0) +1920
EO.Web.Internal.ec.a(kq A_0) +848
EO.Web.Internal.cg.ac() +363
EO.Web.WebControlBase.LoadViewState(Object savedState) +238
EO.Web.Grid.a(Object A_0) +16
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +329
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +216
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +381
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +216
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +381
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +216
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +381
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +216
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +381
System.Web.UI.Page.LoadAllState() +563
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2533
eo_support
Posted: Monday, February 4, 2013 9:04:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Thanks for the update. Please check whether you have the latest version first. We have fixed something like this in the past so it may have already been fixed in the latest version. If it is not fixed yet, please try to isolate the problem into a test project and send the test project to us. Once we have that we will debug through it and get to the bottom of it.

Thanks!
quirtep
Posted: Monday, February 4, 2013 9:37:31 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
I can confirm that I am using the latest version of the component. I set up an isolated sample project to show the problem, but it relies on my database to populate the grid. Is that ok? You can see the issue here:

http://educatorsabroad.org/test.aspx

If you just click a row, it posts back properly without error. As soon as you sort by, for example, the Year column, and then try to select a row, it gives the error.

Here is my aspx page:
---
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function GridParticipants_ItemSelected(grid) {
var SelectedParticipant = String(grid.getSelectedItem().getKey());
__doPostBack(null, 'SelectParticipant_' + SelectedParticipant);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<eo:Grid ID="GridParticipants" runat="server" KeyField="ID" BorderColor="#DCDDDE"
BorderWidth="0px" ColumnHeaderDescImage="00050105" ColumnHeaderAscImage="00050104"
GoToBoxVisible="True" GridLineColor="220, 223, 228" GridLines="Both" ColumnHeaderDividerImage="00050103"
AllowPaging="True" PageSize="100" Font-Size="8.75pt" Font-Names="Tahoma" Width="1069px"
Height="670px" IsCallbackByMe="False" ClientSideOnItemSelected="GridParticipants_ItemSelected"
LoadingHTML="Loading..." Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False">
<FooterStyle CssText="border-left: #dcddde 1px solid;border-right: #dcddde 1px solid;padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;border-top:#dcddde 1px dotted;border-bottom:#dcddde 1px solid;background-color:#f5f5dc;"></FooterStyle>
<ItemStyles>
<eo:GridItemStyleSet>
<ItemHoverStyle CssText="background-color: whitesmoke; cursor: pointer;border-left: #dcddde 1px solid;"></ItemHoverStyle>
<SelectedStyle CssText="background-color:#c57715;color:#f5f5dc; cursor: pointer;"></SelectedStyle>
<CellStyle CssText="padding-left:8px;padding-top:2px; cursor: pointer;"></CellStyle>
<ItemStyle CssText="background-color:#f5f5dc;cursor:pointer;border-left: #dcddde 1px solid;"></ItemStyle>
<FixedColumnCellStyle CssText="border-right: #d6d2c2 1px solid; padding-right: 10px; border-top: #faf9f4 1px solid; border-left: #faf9f4 1px solid; border-bottom: #d6d2c2 1px solid; background-color: #ebeadb; text-align: right; color: black;"></FixedColumnCellStyle>
</eo:GridItemStyleSet>
</ItemStyles>
<GoToBoxStyle CssText="BORDER-RIGHT: #c57715 1px solid; BORDER-TOP: #c57715 1px solid; BORDER-LEFT: #c57715 1px solid; WIDTH: 40px; BORDER-BOTTOM: #c57715 1px solid"></GoToBoxStyle>
<ContentPaneStyle CssText="border-bottom-color:#c57715;border-bottom-style:solid;border-bottom-width:0px;border-left-color:#c57715;border-left-style:solid;border-left-width:0px;border-right-color:#c57715;border-right-style:solid;border-right-width:0px;border-top-color:#c57715;border-top-style:solid;border-top-width:0px;"></ContentPaneStyle>
<ColumnTemplates>
<eo:TextBoxColumn>
<TextBoxStyle CssText="BORDER-RIGHT: #c57715 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #c57715 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #c57715 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #c57715 1px solid; FONT-FAMILY: Arial"></TextBoxStyle>
</eo:TextBoxColumn>
<eo:DateTimeColumn>
<DatePicker ID="DatePicker1" runat="server" DayHeaderFormat="FirstLetter" DayCellHeight="16" DisabledDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
OtherMonthDayVisible="True" DayCellWidth="19" TitleRightArrowImageUrl="DefaultSubMenuIcon"
ControlSkinID="None" SelectedDates="">
<DayHoverStyle CssText="FONT-FAMILY: Arial; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid"></DayHoverStyle>
<TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;"></TitleStyle>
<DayHeaderStyle CssText="FONT-FAMILY: Arial; font-size: 12px; border-bottom: #aca899 1px solid"></DayHeaderStyle>
<DayStyle CssText="FONT-FAMILY: Arial; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid"></DayStyle>
<SelectedDayStyle CssText="FONT-FAMILY: Arial; 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"></SelectedDayStyle>
<TitleArrowStyle CssText="cursor:hand"></TitleArrowStyle>
<TodayStyle CssText="FONT-FAMILY: Arial; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid"></TodayStyle>
<PickerStyle CssText="border-bottom-color:#c57715;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#c57715;border-left-style:solid;border-left-width:1px;border-right-color:#c57715;border-right-style:solid;border-right-width:1px;border-top-color:#c57715;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;"></PickerStyle>
<OtherMonthDayStyle CssText="FONT-FAMILY: Arial; 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"></OtherMonthDayStyle>
<CalendarStyle CssText="background-color: white; border-right: #c57715 1px solid; padding-right: 4px; border-top: #c57715 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #c57715 1px solid; padding-top: 4px; border-bottom: #c57715 1px solid; FONT-FAMILY: Arial"></CalendarStyle>
<DisabledDayStyle CssText="FONT-FAMILY: Arial; 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"></DisabledDayStyle>
<MonthStyle CssText="FONT-FAMILY: Arial; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px"></MonthStyle>
</DatePicker>
</eo:DateTimeColumn>
<eo:MaskedEditColumn>
<MaskedEdit ID="MaskedEdit1" runat="server" ControlSkinID="None" TextBoxStyle-CssText="BORDER-RIGHT: #c57715 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #c57715 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #c57715 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #c57715 1px solid; font-family:Courier New;font-size:8pt;">
</MaskedEdit>
</eo:MaskedEditColumn>
</ColumnTemplates>
<Columns>
<eo:RowNumberColumn Width="40" />
<eo:StaticColumn HeaderText="First Name" AllowSort="True" DataField="GSTParticipantsFirstName"
Width="150" />
<eo:StaticColumn HeaderText="Last Name" AllowSort="True" DataField="GSTParticipantsLastName"
Width="150" />
<eo:StaticColumn HeaderText="Year" AllowSort="True" DataField="GSTParticipantsYear"
Width="75" />
</Columns>
<ColumnHeaderTextStyle CssText="color: #C57715" />
<ColumnHeaderStyle CssText="background-image:url('00050101');padding-left:8px;padding-top:3px; color: #C57715;"></ColumnHeaderStyle>
</eo:Grid>
</div>
</form>
</body>
</html>
---

Here is the aspx.cs page:
---
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class test : System.Web.UI.Page
{
DataTable DTCurrentData;
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
SqlDataAdapter da = new SqlDataAdapter();
string strSQL = "Select GSTParticipantsID AS ID, GSTParticipantsFirstName, GSTParticipantsLastName, GSTParticipantsTerm, GSTParticipantsYear FROM TblGSTParticipants";
Session["CurrentUserSQL"] = strSQL;
SqlCommand cmd = new SqlCommand(strSQL, con);
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "CurrentData");
DTCurrentData = ds.Tables[0];
GridParticipants.DataSource = DTCurrentData;
GridParticipants.DataBind();

if (Request["__EVENTARGUMENT"] != null && Request["__EVENTARGUMENT"].ToString().IndexOf("SelectParticipant") != -1)
{
double Num;
bool isNum = double.TryParse(Request["__EVENTARGUMENT"].ToString().Replace("SelectParticipant_", ""), out Num);
//Response.Write(isNum.ToString() + " " + Request["__EVENTARGUMENT"].ToString()); Response.End();
ParticipantSelect(Request["__EVENTARGUMENT"].ToString().Replace("SelectParticipant_", ""));
}
}
protected void ParticipantSelect(string strParticipantID)
{
Response.Write(strParticipantID);
}
}
---
eo_support
Posted: Monday, February 4, 2013 9:44:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

No. We can not connect to your DB. You will have to replace that with some dummy data (sometimes it simply has to do with the number of records or one specific record). We have to be able to run and debug it in our environment in order to find out the root cause.

Thanks!
quirtep
Posted: Monday, February 4, 2013 10:03:40 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
OK, I have more information. Some values for the Year field were null, and when I filter those records out the issue does not happen. However, I need to be able to include records for which the Year field is null, and I would assume I could still sort by that column? It sorts fine by putting the records with a null Year at the top, but then the error happens subsequently. Thanks.
eo_support
Posted: Monday, February 4, 2013 10:30:17 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

I would think it should. Can you put up a sample page to demonstrate the problem?

Thanks!
quirtep
Posted: Monday, February 4, 2013 10:42:28 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
I found a workaround. I just cast the year as a varchar instead of int32, and ensure make any null values be just a blank string instead, but this seems like a bit of a hack. Here is a simple example of the issue - again, first sort by the Year column, then click a row to generate the error.

http://educatorsabroad.org/test.aspx

.aspx page:
---
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function GridParticipants_ItemSelected(grid) {
var SelectedParticipant = String(grid.getSelectedItem().getKey());
__doPostBack(null, 'SelectParticipant_' + SelectedParticipant);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<eo:Grid ID="GridParticipants" runat="server" KeyField="ID" BorderColor="#DCDDDE"
BorderWidth="0px" ColumnHeaderDescImage="00050105" ColumnHeaderAscImage="00050104"
GoToBoxVisible="True" GridLineColor="220, 223, 228" GridLines="Both" ColumnHeaderDividerImage="00050103"
AllowPaging="True" PageSize="100" Font-Size="8.75pt" Font-Names="Tahoma" Width="1069px"
Height="670px" IsCallbackByMe="False" ClientSideOnItemSelected="GridParticipants_ItemSelected"
LoadingHTML="Loading..." Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False">
<Columns>
<eo:RowNumberColumn Width="40" />
<eo:StaticColumn HeaderText="First Name" AllowSort="True" DataField="FirstName"
Width="150" />
<eo:StaticColumn HeaderText="Last Name" AllowSort="True" DataField="LastName"
Width="150" />
<eo:StaticColumn HeaderText="Year" AllowSort="True" DataField="Year"
Width="75" />
</Columns>
<ColumnHeaderTextStyle CssText="color: #C57715" />
<ColumnHeaderStyle CssText="background-image:url('00050101');padding-left:8px;padding-top:3px; color: #C57715;"></ColumnHeaderStyle>
</eo:Grid>
</div>
</form>
</body>
</html>
---

.aspx.cs page:
---
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataTable DTCurrentData = new DataTable("sample");
DTCurrentData.Columns.Add("ID");
DTCurrentData.Columns.Add("FirstName");
DTCurrentData.Columns.Add("LastName");
DataColumn dcYear = new DataColumn();
dcYear.ColumnName = "Year";
dcYear.DataType = System.Type.GetType("System.Int32");
DTCurrentData.Columns.Add(dcYear);

DataRow row = DTCurrentData.NewRow();
row[0] = "1";
row[1] = "John";
row[2] = "Doe";
row[3] = "2013";
DTCurrentData.Rows.Add(row);
DataRow row2 = DTCurrentData.NewRow();
row2[0] = "2";
row2[1] = "Jane";
row2[2] = "Doe";
//row2[3] = "2012";
DTCurrentData.Rows.Add(row2);

GridParticipants.DataSource = DTCurrentData;
GridParticipants.DataBind();

if (Request["__EVENTARGUMENT"] != null && Request["__EVENTARGUMENT"].ToString().IndexOf("SelectParticipant") != -1)
{
double Num;
bool isNum = double.TryParse(Request["__EVENTARGUMENT"].ToString().Replace("SelectParticipant_", ""), out Num);
//Response.Write(isNum.ToString() + " " + Request["__EVENTARGUMENT"].ToString()); Response.End();
ParticipantSelect(Request["__EVENTARGUMENT"].ToString().Replace("SelectParticipant_", ""));
}
}
protected void ParticipantSelect(string strParticipantID)
{
Response.Write(strParticipantID);
}
}
---
eo_support
Posted: Tuesday, February 5, 2013 5:21:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

We have posted a new build that should fix this problem for you. Please see your private message for the download location.

Thanks!
anet
Posted: Friday, April 12, 2013 3:07:33 PM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
Hello,
I am seeing the exact same error as described above when I sort on any of three custom columns I have in my grid.
Stack Trace:

[ArgumentException: Object must be of type String.]
System.String.CompareTo(Object value) +4098997
System.Collections.Comparer.Compare(Object a, Object b) +101
EO.Web.Internal.b.a(Object A_0, Object A_1) +456
EO.Web.Internal.b.b(Object A_0, Object A_1) +106
EO.Web.Internal.ec.a(Int32[] A_0, Int32 A_1, Int32 A_2, IComparer A_3) +756
EO.Web.Internal.ec.a(kq[] A_0) +2808
EO.Web.Internal.ec.a(kq A_0) +874
EO.Web.Internal.cg.ac() +350
EO.Web.WebControlBase.LoadViewState(Object savedState) +156
EO.Web.Grid.a(Object A_0) +37
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +232
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +144
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +215
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +144
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +215
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +144
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +215
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +144
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +215
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +144
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +215
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +144
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +215
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +144
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +215
System.Web.UI.Page.LoadAllState() +464
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1849

Have you seen this error since this post? Do I need to create a small sample project? My EO.Web.dll is dated 12/17/2012

Is there any way to clear out the grid on the client side before I do postback? I don't need any data saved at this point and it will rebind the grid to a new set of data.
quirtep
Posted: Saturday, April 13, 2013 7:59:49 AM
Rank: Advanced Member
Groups: Member

Joined: 9/6/2007
Posts: 133
The custom build they provided fixed it for me...
anet
Posted: Saturday, April 13, 2013 11:46:14 PM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
I'm actually seeing this error when any of my enabled columns are sorted.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.