or
We had RadControls for ASP.NET AJAX 2010 verstion when this app was first created. ASPX file has a simple RadGrid in it and everything worked fine.
Beginning this year we found out RadGrid in my App is not working with IE10. Telerik suggested us to upgrade to 2013 version.Then we did upgrade.
Now we are haveing the latest version of RadControls (2013 Q2). The .net framework is 3.5. I copied all dll files from C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q2 2013\Bin35
to my own project bin folder and added reference again.
The problem is that RadGrid is getting worse it does not even work for IE8 anymore.
When<telerik:GridButtonColumn ButtonType="LinkButton" DataTextField="type" UniqueName="type" CommandName="OnType" ></telerik:GridButtonColumn> is clicked
dataItem["document"].Text keeps on getting a vaule of " ".
Below are my ASPX file and code behind it.
Thank you for your help.
****ASPX file:***********
<telerik:RadScriptManager runat="server" ID="RadScriptManager2" /> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="dgDocuments"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="dgDocuments" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> <telerik:RadGrid runat="server" ID="dgDocuments" AllowPaging="True" Width="60%" AllowSorting="False" GridLines="None" Skin="Simple" AutoGenerateColumns="False" PageSize="200" ShowStatusBar="true" OnItemCommand="dgDocuments_ItemCommand" onneeddatasource="dgDocuments_NeedDataSource" oncolumncreated="dgDocuments_ColumnCreated" onitemcreated="dgDocuments_ItemCreated" > <GroupHeaderItemStyle Font-Bold = "true" /> <GroupingSettings CaseSensitive="false" /> <ClientSettings AllowGroupExpandCollapse="True" > </ClientSettings> <MasterTableView GroupsDefaultExpanded="true" ItemStyle-Wrap="false" HeaderStyle-Wrap="false" AutoGenerateColumns="false" EditMode="InPlace" ShowHeader = "false" TableLayout="Auto" GroupLoadMode="Client" > <PagerStyle Mode="NumericPages" /> <Columns> <telerik:GridButtonColumn ButtonType="LinkButton" DataTextField="type" UniqueName="type" CommandName="OnType" ></telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="status" Visible="false" ></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="document" Visible="false" ></telerik:GridBoundColumn> </Columns> <GroupByExpressions> <telerik:GridGroupByExpression > <GroupByFields> <telerik:GridGroupByField FieldName="id" HeaderText=" " HeaderValueSeparator="" /> </GroupByFields> <SelectFields> <telerik:GridGroupByField FieldName="document" HeaderText=" " HeaderValueSeparator="" /> </SelectFields> </telerik:GridGroupByExpression> </GroupByExpressions> </MasterTableView> </telerik:RadGrid>
*****Code****:
protected void dgDocuments_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { DataTable table = new DataTable(); table.Columns.Add("document", typeof(string)); table.Columns.Add("type", typeof(string)); table.Columns.Add("status", typeof(string)); table.Columns.Add("id", typeof(int)); if (Session["commercial"].ToString().ToUpper() == "N") { table.Rows.Add("Product Catalog", "Active Product", "CURRENT",1); } table.Rows.Add("Product Specifications (EHB)", "Active Product", "CURRENT", 2); table.Rows.Add("Product Specifications (EHB)", "Out of Production", "DISCONTINUED", 2); table.Rows.Add("Installation Instructions", "Active Product", "CURRENT",3); table.Rows.Add("Installation Instructions", "Out of Production", "DISCONTINUED",3); table.Rows.Add("Service Literature", "Active Product & Out of Production", "BOTH", 4); table.Rows.Add("Service & Application Notes", "Active Product & Out of Production", "BOTH",5); table.Rows.Add("Application and Design Guidelines", "Active Product & Out of Production", "BOTH",6); table.Rows.Add("Wiring Diagrams", "Active Product", "CURRENT",7); table.Rows.Add("Wiring Diagrams", "Out of Production", "DISCONTINUED",7); table.Rows.Add("User Manuals", "Active Product", "CURRENT", 8); table.Rows.Add("User Manuals", "Out of Production", "DISCONTINUED", 8); dgDocuments.DataSource = table; } protected void dgDocuments_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName.Equals("OnType")) { GridDataItem dataItem = (GridDataItem)e.Item; Session["ProductStatus"] = dataItem["status"].Text; if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == PRODUCT_CATALOG.ToUpper()) { Session["publication"] = PRODUCT_CATALOG; Session["publicationID"] = "9"; Response.Redirect("SearchbyCategory_ProductCatlog.aspx"); } else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == ENGINEERING_HANDBOOK.ToUpper()) { Session["publication"] = ENGINEERING_HANDBOOK; Session["publicationID"] = "8"; Response.Redirect("SearchbyCategory_engineering.aspx"); } else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == HOMEOWNERS_MANUALS.ToUpper()) { Session["publication"] = HOMEOWNERS_MANUALS; Session["publicationID"] = "5"; Response.Redirect("SearchbyCategory.aspx"); } else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == INSTALLATION_INSTRUCTION.ToUpper()) { Session["publication"] = INSTALLATION_INSTRUCTION; Session["publicationID"] = "1"; Response.Redirect("SearchbyCategory.aspx"); } else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == WIRING_DIAGRAMS.ToUpper()) { Session["publication"] = WIRING_DIAGRAMS; Session["publicationID"] = "3"; Response.Redirect("SearchbyCategory.aspx"); } else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == SERVICE_MANUALS.ToUpper()) { Session["publication"] = SERVICE_MANUALS; Session["publicationID"] = "4"; Response.Redirect("SearchbyCategory.aspx"); } else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == SERVICE_APP.ToUpper()) { Session["publication"] = SERVICE_APP; Session["publicationID"] = "6"; Response.Redirect("SearchbyCategory.aspx"); } else if (dataItem["document"].Text.ToUpper().Trim().ToUpper() == APPLICATION_DESIGN.ToUpper()) { Session["publication"] = APPLICATION_DESIGN; Session["publicationID"] = "13"; Response.Redirect("SearchbyCategory.aspx"); } } }<telerik:RadTreeList ID="rtl_TaxonomyGrids" runat="server" AutoGenerateColumns="False" DataKeyNames="Allocation" ParentDataKeyNames="Parent_Allocation" OnItemDataBound="rtl_TaxonomyGrids_ItemDataBound" OnLoad="rtl_TaxonomyGrids_Load" OnNeedDataSource="rtl_TaxonomyGrids_NeedDataSource" OnItemCreated="rtl_TaxonomyGrids_ItemCreated"> <Columns> <telerik:TreeListBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name"> <HeaderStyle Width="100px"></HeaderStyle> </telerik:TreeListBoundColumn> <telerik:TreeListTemplateColumn UniqueName="PermissionsGrid" HeaderText="Permissions" DataField="Allocation"> <ItemStyle CssClass="TreeGridCell NoPadding"></ItemStyle> <ItemTemplate> <asp:Label ID="lb_GridAllocation" Font-Bold="true" Font-Italic="true" Text='<%# Eval("Allocation") %>' Visible="false" runat="server"></asp:Label> <telerik:RadGrid ID="rg_TaxonomyGroupProfiling" AllowMultiRowSelection="True" BorderStyle="None" runat="server" AutoGenerateColumns="false" OnItemDataBound="rg_TaxonomyGroupProfiling_ItemDataBound" OnItemCreated="rg_TaxonomyGroupProfiling_ItemCreated"> <ClientSettings AllowExpandCollapse="true"> <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True"></Selecting> </ClientSettings> <MasterTableView ClientDataKeyNames="Allocation" Width="100%" EditMode="InPlace"> <Columns> <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn"> </telerik:GridClientSelectColumn> <telerik:GridBoundColumn Visible="false" UniqueName="Allocation" DataField="Allocation" HeaderText="Allocation" ReadOnly="True"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="UserGroup" DataField="UserGroup" HeaderText="UserGroup" ReadOnly="True"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Status" DataField="Status" HeaderText="Status" ReadOnly="True"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Inherits" DataField="Inherits" HeaderText="Inherits" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="View" DataField="View" HeaderText="View" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Competent" DataField="Process" HeaderText="Competent" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="BatchSize" DataField="BatchSize" HeaderText="Batch Size" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Escalate" DataField="Escalate" HeaderText="Escalate" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Suspend" DataField="Suspend" HeaderText="Suspend" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="SamplingX" DataField="SamplingX" HeaderText="SamplingX" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="SamplingY" DataField="SamplingY" HeaderText="SamplingY" ColumnEditorID="GridTextBoxColumnEditor1"> </telerik:GridBoundColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1"> <HeaderStyle Width="20px"></HeaderStyle> <ItemStyle CssClass="MyImageButton"></ItemStyle> </telerik:GridEditCommandColumn> </Columns> </MasterTableView> </telerik:RadGrid> <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="35px"> </telerik:GridTextBoxColumnEditor> <telerik:GridDropDownListColumnEditor ID="GridDropDownListColumnEditor1" runat="server" DropDownStyle-Width="70px"> </telerik:GridDropDownListColumnEditor> </ItemTemplate> </telerik:TreeListTemplateColumn> </Columns></telerik:RadTreeList>protected void rtl_TaxonomyGrids_NeedDataSource(object sender, Telerik.Web.UI.TreeListNeedDataSourceEventArgs e){ if (sender is RadTreeList) { RadTreeList tree = sender as RadTreeList; tree.DataSource = null; tree.DataSource = dh.GetTaxonomyData(); }}protected void rtl_TaxonomyGrids_ItemCreated(object sender, TreeListItemCreatedEventArgs e){ if (e.Item is TreeListDataItem) { RadGrid grid = (RadGrid) e.Item.FindControl("rg_TaxonomyGroupProfiling"); grid.NeedDataSource += new GridNeedDataSourceEventHandler(rg_TaxonomyGroupProfiling_NeedDataSource); }}protected void rg_TaxonomyGroupProfiling_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e){ if (sender is RadGrid) { RadGrid grid = sender as RadGrid; grid.MasterTableView.DataSource = null; grid.DataSource = null; string taxSelection = this.GroupProfilerContainer.GroupProfilerContext.CriteriaSettings.Selection["Taxonomy"].ToString(); string gpSelection = ConverToWhereClause(this.GroupProfilerContainer.GroupProfilerContext.CriteriaSettings.Selection); TreeListDataItem nestedItem = (TreeListDataItem)(grid.NamingContainer); string allocation = nestedItem.GetDataKeyValue("Allocation").ToString(); if (!string.IsNullOrEmpty(taxSelection)) { if (taxSelection.Split(',').Contains(allocation)) { grid.DataSource = dh.GetPermissionsData(allocation, gpSelection); } } }}var a=document.activeElement;if(a&&a.tagName.toLowerCase()==="input"){document.activeElement.blur();Server Error in '/WSCUSTSERVICE' Application.Value cannot be null.Parameter name: Unable to read application setting. Please make sure that you have set Telerik.Web.CaptchaImageStorageProviderTypeName in the web.config.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.ArgumentNullException: Value cannot be null.Parameter name: Unable to read application setting. Please make sure that you have set Telerik.Web.CaptchaImageStorageProviderTypeName in the web.config.Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:[ArgumentNullException: Value cannot be null.Parameter name: Unable to read application setting. Please make sure that you have set Telerik.Web.CaptchaImageStorageProviderTypeName in the web.config.] Telerik.Web.UI.Captcha.CachingProviderFactory..ctor(CaptchaImageStorage storage) +334 Telerik.Web.UI.CaptchaProtector.get_CachingProvider() +52 Telerik.Web.UI.CaptchaProtector.GenerateNewCaptcha() +160 Telerik.Web.UI.RadCaptcha.ControlPreRender() +449 Telerik.Web.UI.RadWebControl.OnPreRender(EventArgs e) +22 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842Imports System.Data.SqlClientImports System.IOImports System.LinqImports System.Runtime.Serialization.Formatters.BinaryImports System.WebImports Telerik.Web.UIImports Telerik.Web.UI.CaptchaImports WalkStyles.CommonImports System.DataNamespace CustService Public Class DBImageStorageProvider Inherits BaseCaptchaCachingProvider Public Sub New(ByVal context As HttpContext) MyBase.New(context) End Sub Private Function connectionString() As String '' = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|CachingProviderDatabase.mdf;Integrated Security=True;User Instance=True;" Return ConfigMgr.ConfigSetting(ConfigMgr.CK_DSN) End Function Public Overrides ReadOnly Property ShouldAddCacheDependecy() As Boolean Get Return True End Get End Property Public Overrides Sub Save(ByVal key As String, ByVal image As CaptchaImage) Using conn As SqlConnection = GetConnection(connectionString) conn.Open() Using command As SqlCommand = New SqlCommand("INSERT INTO [RadCaptchaImageCache] ([ImageKey], [ImageContent]) VALUES (@key, @value)", conn) Using ms As MemoryStream = SerializeImage(image) command.Parameters.Add("@key", SqlDbType.NVarChar, 100) command.Parameters("@key").Value = key command.Parameters.Add("@value", SqlDbType.VarBinary, Int32.MaxValue) command.Parameters("@value").Value = ms.GetBuffer() ''command.Parameters.Add(New SqlParameter("key", key)) ''command.Parameters.Add(New SqlParameter("value", ms)) command.ExecuteNonQuery() End Using End Using End Using End Sub Public Overrides Function Load(ByVal key As String) As CaptchaImage Dim result As CaptchaImage = Nothing Using conn As SqlConnection = GetConnection(connectionString) conn.Open() Using command As SqlCommand = New SqlCommand("SELECT [ImageContent] FROM [RadCaptchaImageCache] WHERE [ImageKey] = @key", conn) command.Parameters.Add(New SqlParameter("key", key)) Dim bData As Byte() = DirectCast(command.ExecuteScalar(), Byte()) Using ms As MemoryStream = New MemoryStream() result = DeserializeImage(bData, ms) End Using End Using End Using Return result End Function Public Overrides Sub Clear(ByVal key As String) Using conn As SqlConnection = GetConnection(connectionString) conn.Open() Using command As SqlCommand = New SqlCommand("DELETE FROM [RadCaptchaImageCache] WHERE [ImageKey] = @key", conn) command.Parameters.Add(New SqlParameter("key", key)) command.ExecuteNonQuery() End Using End Using End Sub Private Function GetConnection(ByVal connString As String) As SqlConnection Return New SqlConnection(connString) End Function Private Function SerializeImage(ByVal image As CaptchaImage) As MemoryStream Dim ms As MemoryStream = New MemoryStream() Dim bFormatter As BinaryFormatter = New BinaryFormatter() bFormatter.Serialize(ms, image) ms.Seek(0, 0) Return ms End Function Private Function DeserializeImage(ByVal bData As Byte(), ByVal ms As MemoryStream) As CaptchaImage Dim bFormatter As BinaryFormatter = New BinaryFormatter() ms.Write(bData, 0, bData.Length) ms.Seek(0, 0) Return DirectCast(bFormatter.Deserialize(ms), CaptchaImage) End Function End ClassEnd Namespace<!-- ================================================================= --><!-- Image storage cache handler for radCaptcha controls --><!-- --><add key="Telerik.Web.CaptchaImageStorageProviderTypeName" value="CustService.DBImageStorageProvider, App_Code.lfcwuanr, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"/>