我面临着一个奇怪的问题。我已将RadGrid
添加到我的网页并启用了过滤功能,直到我关闭系统并再次回来之前,它一直运行良好。它停止工作,现在当我点击过滤器图标页面只是刷新和下拉不打开。我花了整整2天没有找到任何修复。此外,我可以看到参数列表后面有Telerik.Web.UI.WebResource
及其"Uncaught SyntaxError: missing
)的错误“
此错误是否与过滤器的工作有关?什么过滤器需要打开下拉列表?
网页
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="estimate_view.aspx.cs" Inherits="ePrint.Printcenter.Views.Estimate.estimate_view" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadGrid
ID="GridView1"
runat="server"
AutoGenerateColumns="false"
AllowPaging="true"
AllowFilteringByColumn="true"
OnSortCommand="GridView1_SortCommand"
OnItemCommand="GridView1_ItemCommand"
OnColumnCreated="GridView1_ColumnCreated"
OnNeedDataSource="GridView1_NeedDataSource"
PagerStyle-AlwaysVisible="true"
PageSize="50"
HeaderStyle-Font-Bold="true">
<MasterTableView>
</MasterTableView>
</telerik:RadGrid>
</form>
CS代码
protected void GridView1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
this.GridBind(this.CompanyID, this.UserID, this.GridView1.PageSize, this.GridView1.CurrentPageIndex + 1, Convert.ToInt32(this.ddl_View.SelectedValue), estimate_view.SortedBy, estimate_view.sortdirection, estimate_view.WhereCondition);
}
public void GridBind(int CompanyID, int UserID, int PageSize, int PageNumber, int ViewID, string SortedBy, string SortDirection, string para)
{
string empty = string.Empty;
viewClass _viewClass = new viewClass();
empty = _viewClass.ReturnFinalQueryForNewCustomView(CompanyID, UserID, PageSize, PageNumber, this.pg, ViewID, SortedBy, SortDirection, para);
commonClass _commonClass = new commonClass();
SqlCommand sqlCommand = new SqlCommand("PC_CustomizeView_Execute", _commonClass.openConnection())
{
CommandTimeout = 0,
CommandType = CommandType.StoredProcedure
};
sqlCommand.Parameters.AddWithValue("@strSQL", empty);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
DataSet dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet);
DataTable item = dataSet.Tables[0];
for (int i = 0; i < item.Columns.Count; i++)
{
item.Columns[i].ReadOnly = false;
}
if (item != null)
{
foreach (DataRow row in item.Rows)
{
if (row.Table.Columns.Contains("CreatedDate"))
{
row["CreatedDate"] = this.objJava.Eprint_return_Date_Before_View(row["CreatedDate"].ToString(), CompanyID, UserID, false);
}
if (row.Table.Columns.Contains("EstimateDate"))
{
row["EstimateDate"] = this.objJava.Eprint_return_Date_Before_View(row["EstimateDate"].ToString(), CompanyID, UserID, false);
}
if (row.Table.Columns.Contains("OrderNumber"))
{
row["OrderNumber"] = this.objBase.SpecialDecode(row["OrderNumber"].ToString());
}
if (row.Table.Columns.Contains("EstimateNumber"))
{
row["EstimateNumber"] = this.objBase.SpecialDecode(row["EstimateNumber"].ToString());
}
if (row.Table.Columns.Contains("EstimateTitle"))
{
row["EstimateTitle"] = this.objBase.SpecialDecode(row["EstimateTitle"].ToString());
}
if (row.Table.Columns.Contains("Estimator"))
{
row["Estimator"] = this.objBase.SpecialDecode(row["Estimator"].ToString());
}
if (row.Table.Columns.Contains("Header"))
{
row["Header"] = this.objBase.SpecialDecode(row["Header"].ToString());
}
if (row.Table.Columns.Contains("Footer"))
{
row["Footer"] = this.objBase.SpecialDecode(row["Footer"].ToString());
}
if (row.Table.Columns.Contains("SalesPerson"))
{
row["SalesPerson"] = this.objBase.SpecialDecode(row["SalesPerson"].ToString());
}
if (row.Table.Columns.Contains("StatusID"))
{
row["StatusID"] = this.objBase.SpecialDecode(row["StatusID"].ToString());
}
if (row.Table.Columns.Contains("ReferredBY"))
{
row["ReferredBY"] = this.objBase.SpecialDecode(row["ReferredBY"].ToString());
}
if (row.Table.Columns.Contains("Company"))
{
row["Company"] = this.objBase.SpecialDecode(row["Company"].ToString());
}
if (row.Table.Columns.Contains("Greeting"))
{
row["Greeting"] = this.objBase.SpecialDecode(row["Greeting"].ToString());
}
if (row.Table.Columns.Contains("CostCentre"))
{
row["CostCentre"] = this.objBase.SpecialDecode(row["CostCentre"].ToString());
}
if (row.Table.Columns.Contains("CustomerID"))
{
row["CustomerID"] = this.objBase.SpecialDecode(row["CustomerID"].ToString());
}
if (row.Table.Columns.Contains("AttentionID"))
{
row["AttentionID"] = this.objBase.SpecialDecode(row["AttentionID"].ToString());
}
if (row.Table.Columns.Contains("CustomerAccountNumber"))
{
row["CustomerAccountNumber"] = this.objBase.SpecialDecode(row["CustomerAccountNumber"].ToString());
}
if (row.Table.Columns.Contains("PaymentTerms"))
{
row["PaymentTerms"] = this.objBase.SpecialDecode(row["PaymentTerms"].ToString());
}
if (row.Table.Columns.Contains("CompanyEmail"))
{
row["CompanyEmail"] = this.objBase.SpecialDecode(row["CompanyEmail"].ToString());
}
if (row.Table.Columns.Contains("ContactEmail"))
{
row["ContactEmail"] = this.objBase.SpecialDecode(row["ContactEmail"].ToString());
}
if (row.Table.Columns.Contains("ItemMaterial"))
{
row["ItemMaterial"] = this.objBase.SpecialDecode(row["ItemMaterial"].ToString());
}
if (row.Table.Columns.Contains("ItemTitle"))
{
row["ItemTitle"] = this.objBase.SpecialDecode(row["ItemTitle"].ToString());
}
if (row.Table.Columns.Contains("ItemDescription"))
{
row["ItemDescription"] = this.objBase.SpecialDecode(row["ItemDescription"].ToString());
}
if (row.Table.Columns.Contains("ItemColour"))
{
row["ItemColour"] = this.objBase.SpecialDecode(row["ItemColour"].ToString());
}
if (row.Table.Columns.Contains("ItemSize"))
{
row["ItemSize"] = this.objBase.SpecialDecode(row["ItemSize"].ToString());
}
if (row.Table.Columns.Contains("ItemArtwork"))
{
row["ItemArtwork"] = this.objBase.SpecialDecode(row["ItemArtwork"].ToString());
}
if (row.Table.Columns.Contains("ItemProofs"))
{
row["ItemProofs"] = this.objBase.SpecialDecode(row["ItemProofs"].ToString());
}
if (row.Table.Columns.Contains("ItemDelivery"))
{
row["ItemDelivery"] = this.objBase.SpecialDecode(row["ItemDelivery"].ToString());
}
if (row.Table.Columns.Contains("ItemFinishing"))
{
row["ItemFinishing"] = this.objBase.SpecialDecode(row["ItemFinishing"].ToString());
}
if (row.Table.Columns.Contains("Itemterms_Instructions"))
{
row["Itemterms_Instructions"] = this.objBase.SpecialDecode(row["Itemterms_Instructions"].ToString());
}
if (row.Table.Columns.Contains("ItemNotes"))
{
row["ItemNotes"] = this.objBase.SpecialDecode(row["ItemNotes"].ToString());
}
if (row.Table.Columns.Contains("ItemPacking"))
{
row["ItemPacking"] = this.objBase.SpecialDecode(row["ItemPacking"].ToString());
}
if (row.Table.Columns.Contains("EstimateStatus"))
{
row["EstimateStatus"] = this.objBase.SpecialDecode(row["EstimateStatus"].ToString());
}
if (row.Table.Columns.Contains("ArtworkDate"))
{
row["ArtworkDate"] = this.objJava.Eprint_return_Date_Before_View(row["ArtworkDate"].ToString(), CompanyID, UserID, false);
}
if (row.Table.Columns.Contains("ProofDate"))
{
row["ProofDate"] = this.objJava.Eprint_return_Date_Before_View(row["ProofDate"].ToString(), CompanyID, UserID, false);
}
if (row.Table.Columns.Contains("ApprovalDate"))
{
row["ApprovalDate"] = this.objJava.Eprint_return_Date_Before_View(row["ApprovalDate"].ToString(), CompanyID, UserID, false);
}
if (row.Table.Columns.Contains("ProductionDate"))
{
row["ProductionDate"] = this.objJava.Eprint_return_Date_Before_View(row["ProductionDate"].ToString(), CompanyID, UserID, false);
}
if (row.Table.Columns.Contains("CompletionDate"))
{
row["CompletionDate"] = this.objJava.Eprint_return_Date_Before_View(row["CompletionDate"].ToString(), CompanyID, UserID, false);
}
if (!row.Table.Columns.Contains("DeliveryDate"))
{
continue;
}
row["DeliveryDate"] = this.objJava.Eprint_return_Date_Before_View(row["DeliveryDate"].ToString(), CompanyID, UserID, false);
}
}
_commonClass.closeConnection();
this.GridView1.DataSource = dataSet;
if (dataSet.Tables[0].Rows.Count <= 0)
{
this.AddBoundColumns(dataSet.Tables[0], this.GridView1);
this.div_Main.Style.Add("display", "block");
this.GridView1.AllowCustomPaging = true;
return;
}
this.AddBoundColumns(dataSet.Tables[0], this.GridView1);
this.div_Main.Style.Add("display", "block");
this.GridView1.AllowCustomPaging = true;
this.GridView1.VirtualItemCount = Convert.ToInt32(dataSet.Tables[1].Rows[0][0].ToString());
}
答案 0 :(得分:0)
你能展示一些代码,例如来自NeedDataSource事件处理程序?