Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
251 views
We are suddenly receiving the error outlined and I am unsure what could be the cause. The version of Telerik is a few years old but has been working for ages.

Error: Parameter count mismatch.​
Example Url: http://www.darlingcollective.com/WebResource.axd?d=icsadJ8Zc2rtQ_8NGTlm_jaJgpUwM1o7gz5kDbVk_NAwVMYjg4zv7a015htSWRhTaMKZNK6cxFYmS5br7LYZ3fHz73U1&t=635145392180000000
Exception Details: System.Reflection.TargetParameterCountException: Parameter count mismatch.

Stack trace:
[TargetParameterCountException: Parameter count mismatch.]
System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +10910101
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +54
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
Talifun.Web.Compress.Decryptor.DecryptString(String input) +217
Talifun.Web.Compress.WebResourceCompressionModule.GetDataFromQuery(NameValueCollection queryString) +141

[HttpException (0x80004005): This is an invalid webresource request.]
Talifun.Web.Compress.WebResourceCompressionModule.GetDataFromQuery(NameValueCollection queryString) +312
Talifun.Web.Compress.WebResourceCompressionModule.OnPreRequestHandlerExecute(Object sender, EventArgs e) +259
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
Pavlina
Telerik team
 answered on 09 Dec 2014
1 answer
130 views
Hello everybody,

following problem:

I have a RadGrid with a datasource to a custom class. The Grid is in "Batch" edit mode. When I try to save the changes in "itemcommand" event the edititems count are zero. Do u have any ideas?

<telerik:RadGrid runat="server" ID="RadGrid1" ShowFooter="True" AllowFilteringByColumn="false" AllowSorting="True" ExportSettings-FileName="Besuchspruefung"
             OnNeedDataSource="RadGrid1_NeedDataSource" OnBatchEditCommand="RadGrid1_BatchEditCommand" OnItemCommand="RadGrid1_ItemCommand"  OnItemDataBound="RadGrid1_ItemDataBound">
            <MasterTableView AutoGenerateColumns="False"   CommandItemDisplay="Top" CommandItemSettings-ShowAddNewRecordButton="false"  DataKeyNames="besuchID_Ist" EditMode="Batch">
                <BatchEditingSettings OpenEditingEvent="Click" EditType="row" SaveAllHierarchyLevels="false" />

01.Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
02.       Dim u As tmeotUser = CType(Membership.GetUser(), tmeotUser)
03.       Dim con As New ConnectionClass
04. 
05.       If (e.CommandName = "Update") Then
06. 
07.           For Each editedItem As GridEditableItem In RadGrid1.EditItems
08.               Dim newValues As Hashtable = New Hashtable
09. 
10.               'The GridTableView will fill the values from all editable columns in the hash
11.               e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
12. 
13.                    'perform update
14. 
15.               editedItem.Edit = False
16.           Next
17.       End If
18.       RadGrid1.Rebind()
19.   End Sub

Many thanks in advance!
Viktor Tachev
Telerik team
 answered on 09 Dec 2014
3 answers
143 views
I'm having a problem with the Menu on an iPad.  I'm using UI for ASP.NET AJAX, 2014.3 1024. The iPad os is V 8.1.  The menu works fine on an iPhone os V 7.1.1.

It's something to do with my application setup, although I haven't been able to determine what.  I set up a version of the demo app locally and then copied that to my application.  The major differences in the web.config are connection strings and such that my application uses.

I've attached the rendered HTML from my app and the Telerik demo.

Please let me know if you need anything else to help me troubleshoot this issue.

Thank you,
Tonya
Dimitar
Telerik team
 answered on 09 Dec 2014
6 answers
117 views
We found that every time a user clicks the Grid Export, the session size grows.  In our example we have a grid with about 700 records.  Every time the user clicks export the session state size grows another 1mb.  This has become a problem as our session sizes are now growing upto 100mb.  At which point the users are reporting slow downs which we can duplicate with an overly large session state size.

Questions:
Is this a known issue?  If so is it fixed in a newer version?
Is there a method to clear the session values used in the export, after the export is completed?

Notes:
We are storing session using the ASPState session database
We are using an older Telerik version (2013.3.1324) - but are in the process of upgrading.
All of our grids using the Telerik export are behaving this way.

Thanks for the help
Tim
Jeff
Top achievements
Rank 1
 answered on 08 Dec 2014
1 answer
114 views
After upgrading Telerik UI for ASP.NET Ajax from v2014.1.225.45 to v2014.3.1024.45, RadEditor has some problems on paste html from dialogs (both standard and custom) e.g. ImageManager, HyperLinkManager. Images and links are pasted at the top of document instead of cursor position. I'm using RadEditor on ToolbarMode="RibbonBar" and until now it has worked properly. It works on chrome and firefox but not in IE10. You can reproduce the same issue here: http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx. Is possible to do something to solve?

I'm using:

 - Telerik.Web.UI 2014.3.1024.45
 - Telerik.Web.UI.Skins 2013.3.1024.45
 - Internet Explorer 10
 - RibbonBar ToolbarMode
 - Skin Metro

This is my editor:
            <telerik:RadEditor runat="server" ID="Editor" ExternalDialogsPath="~/RadEditor/EditorDialogs" 
                ToolbarMode="RibbonBar" ToolsFile="~/RadEditor/editorToolsFile.xml" ContentFilters="IndentHTMLContent"
                Width="100%" Height="680" EnableResize="false" BorderWidth="0" ImageManager-MaxUploadFileSize="1024000"
                NewLineMode="Br"> 
            </telerik:RadEditor>


Ianko
Telerik team
 answered on 08 Dec 2014
6 answers
165 views
Can I get information from the page layout system that will tell me which span (i.e. SpanXl, SpanLg, SpanMd, SpanSm, or SpanXs) is in effect at any given browser size or device size?
I want to be able to say:
If SpanInEffect = "SpanMd" Then
   -Do this
ElseIf SpanInEffect = "SpanXs" Then
Do something different
End If

I am really hoping this is available, because I want to dynamically change which .css class I am applying to the Column based on the "Span in Effect" at a given time. Currently the columns are reacting responsively, but I want to be able, for example, when viewing in SpanXs mode, to make the font smaller, by applying a different class.

thanks,
got my fingers crossed!
Ivan Zhekov
Telerik team
 answered on 08 Dec 2014
1 answer
114 views
Hi,

I get the datasource data as date time and I want to display the x-axis data for past 8 hours. But the data is there only for 1hour. How can I set the MinValue and MaxValue so that I see all the 8 hours in x-axis but see data only in the particular hours and gaps for other data.
Danail Vasilev
Telerik team
 answered on 08 Dec 2014
1 answer
245 views
Hi

I'm using the RadCalendar control along with the OnDayRender method for a scheduler. The OnDayRender method calls a Customize Day method like on the example page which then fills in days with existing transactions using a different background colour.  The problem is a user can click a day to quick add a transaction and then after that transaction is made it will not show as blue until the user navigates forward a month then back. This is causing a lot of user confusion as they think nothing has happened.

So what I want to be able to do is call a .Rebind() or .Refresh() after the transaction has been inserted to redraw the calendar.  Yet this function does not seem to exist.

Any ideas?
Maria Ilieva
Telerik team
 answered on 08 Dec 2014
1 answer
117 views
Hello

I'm not able to apply in-built filters or in fact any filters on my grid. I followed these two demos in mix:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx#qsf-demo-source
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx

Please help.

ASPX code  :- 
<!------------------------------------------------------------------------------------------------------------------->
<%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" Inherits="UserPermissionManager.Applications" CodeBehind="Applications.aspx.cs" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="CTP" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <table align="center" cellspacing="10px" border="0">
                <tr align="center">
                    <td>
                        <input runat="server" type="hidden" id="hdUserName" name="hdUserName" />
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <div id="divlist" runat="server" visible="true" style="border: 1px solid #666666; background-color: #ffffff; font-size: 11px; overflow: scroll; height: 579px; width: 1860px;">
                            <asp:CheckBox ID="chkshowinactive" runat="server" Visible="true"
                                Text="Show Inactive" CausesValidation="false"
                                Checked="false" OnCheckedChanged="rad_needpermssion_SelectedIndexChanged"
                                AutoPostBack="True" CssClass="Checkbox" />
                            <br />
                            <%--<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />--%>
                            <%--<telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />--%>
                            <%--<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />--%>
                            <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
                                <script type="text/javascript">
                                    function RowDblClick(sender, eventArgs) {
                                        sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                                    }

                                    function onPopUpShowing(sender, args) {
                                        args.get_popUp().className += " popUpEditForm";
                                    }
                                </script>
                            </telerik:RadCodeBlock>
                            <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
                                <AjaxSettings>
                                    <telerik:AjaxSetting>
                                        <UpdatedControls>
                                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                </AjaxSettings>
                            </telerik:RadAjaxManagerProxy>
                            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" ShowFooter="True"
                                AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="True"
                                OnPreRender="RadGrid1_PreRender" OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand"
                                OnInsertCommand="RadGrid1_InsertCommand" OnItemDataBound="RadGrid1_ItemDataBound"
                                AllowFilteringByColumn="true" CellSpacing="-1" GridLines="Both">
                                <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                                <HeaderStyle Font-Bold="true" />
                                <MasterTableView CommandItemDisplay="Top" DataKeyNames="AppID" PageSize="15">
                                    <EditFormSettings>
                                        <PopUpSettings Modal="true" />
                                    </EditFormSettings>
                                    <Columns>
                                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" />
                                        <telerik:GridBoundColumn Visible="true" SortExpression="AppName" DataField="AppName"
                                            HeaderText="Application Name" ItemStyle-VerticalAlign="Top" />
                                        <telerik:GridHyperLinkColumn DataTextField="NoOfPermTypes" SortExpression="NoOfPermTypes" HeaderText="# of Permission Types" DataNavigateUrlFields="AppID"
                                            DataNavigateUrlFormatString="ApplicationPermission.aspx?AppID={0}" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Left" />
                                        <telerik:GridBoundColumn Visible="true" SortExpression="Active" DataField="Active"
                                            HeaderText="Active" ItemStyle-VerticalAlign="Top" AllowFiltering="false" />
                                        <telerik:GridBoundColumn Visible="true" SortExpression="WebBased" DataField="WebBased"
                                            HeaderText="Web Based" ItemStyle-VerticalAlign="Top" AllowFiltering="false" />
                                        <telerik:GridBoundColumn Visible="true" SortExpression="ModifiedOn" DataField="ModifiedOn"
                                            HeaderText="Modified On" ItemStyle-VerticalAlign="Top" DataFormatString="{0:d-MMM-yyyy hh:mm tt}" />
                                        <telerik:GridBoundColumn Visible="true" SortExpression="ModifiedBy" DataField="ModifiedBy"
                                            HeaderText="Modified By" ItemStyle-VerticalAlign="Top" />
                                    </Columns>
                                    <EditFormSettings EditFormType="Template" CaptionFormatString="Add/Edit Application">
                                        <FormTemplate>
                                            <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                                                style="border-collapse: collapse;">
                                                <tr>
                                                    <td>
                                                        <table id="Table3" cellspacing="1" cellpadding="1" border="0" class="module">
                                                            <tr>
                                                                <td>Application Name:</td>
                                                                <td>
                                                                    <asp:TextBox ID="txtAppName" runat="server" Text='<%# Bind("AppName") %>' />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>Web Based:
                                                                </td>
                                                                <td>
                                                                    <asp:CheckBox ID="chkWebBased" runat="server" Enabled='<%# (Container is GridEditFormInsertItem) ? false : true %>'
                                                                        Checked='<%# (DataBinder.Eval(Container.DataItem,"WebBased")==DBNull.Value ? true:Eval("WebBased"))%>' />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>Active:
                                                                </td>
                                                                <td>
                                                                    <asp:CheckBox ID="chkActive" runat="server" Enabled='<%# (Container is GridEditFormInsertItem) ? false : true %>'
                                                                        Checked='<%# (DataBinder.Eval(Container.DataItem,"Active")==DBNull.Value ? true:Eval("Active"))%>' />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left">
                                                        <asp:Label ID="lblError1" ForeColor="Red" runat="server"></asp:Label>
                                                    </td>
                                                    <td align="right">
                                                        <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button>
                                                        &nbsp;
                                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                            CommandName="Cancel"></asp:Button>
                                                    </td>
                                                </tr>
                                            </table>
                                        </FormTemplate>
                                    </EditFormSettings>
                                </MasterTableView>
                                <ClientSettings>
                                    <ClientEvents OnRowDblClick="RowDblClick" OnPopUpShowing="onPopUpShowing" />
                                </ClientSettings>
                            </telerik:RadGrid>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <font color="#666666">* Red color represents the applications that does not need permissions.</font><br />
                        <font color="#666666">* Green color represents the applications that needs permissions.</font>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<!------------------------------------------------------------------------------------------------------------------->

CodeBehind :- 

/***************************************************************************************************/
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Web.UI;
using System.Linq;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using UPMLibrary;

namespace UserPermissionManager
{
    public partial class Applications : Page
    {
        AppPermission objApp = new AppPermission();
        Users objusers = new Users();
        string strFilters = "";

        public DataTable BindApplications()
        {
            //the table index (.Tables[1]) in the below statement is done 
            //for TEMPORARY SUPPORT of old UPM and must changed back to (.Tables[0]) 
            //after this new UPM is rolled OUT
            /********************************************************************************************************************************************/
            DataView aView = objApp.ListApplications().Tables[1].DefaultView;
            /********************************************************************************************************************************************/

            aView.RowFilter = "Active=" + ((chkshowinactive.Checked) ? false : true).ToString();
            return aView.ToTable();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            ((HtmlGenericControl)this.Master.FindControl("liApps")).Attributes.Add("class", "SelectedMainMenu");

            if (!IsPostBack)
            {
                if (Session["PERMISSIONLOGONUSER"] != null)
                    objApp.CurrentUser = Session["PERMISSIONLOGONUSER"].ToString();
                else
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "document.getElementById('CTP_hdUserName').value = document.getElementById('lblSupplier').innerText;", true);
            }
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            //RadGrid1.DataSource = ApplicationsTable;
            //RadGrid1.DataBind();
            //ApplicationsTable.PrimaryKey = new DataColumn[] { ApplicationsTable.Columns["AppID"] };
                
            RadGrid1.MasterTableView.EditMode = (GridEditMode)Enum.Parse(typeof(GridEditMode), "PopUp");
            //GridFilterMenu menu = RadGrid1.FilterMenu;
            //int i = 0;
            //while (i < menu.Items.Count)
            //{
            //    if (menu.Items[i].Text == "NoFilter" ||
            //        menu.Items[i].Text == "Contains" ||
            //        menu.Items[i].Text == "DoesNotContain" ||
            //        menu.Items[i].Text == "StartsWith" ||
            //        menu.Items[i].Text == "EndsWith" ||
            //        menu.Items[i].Text == "EqualTo" ||
            //        menu.Items[i].Text == "NotEqualTo"
            //        )
            //        i++;
            //    else
            //        menu.Items.RemoveAt(i);
            //}
        }

        protected void rad_needpermssion_SelectedIndexChanged(object sender, EventArgs e)
        {
            Session["Applications"] = null;
            RadGrid1.MasterTableView.Rebind();
        }

        protected void RadGrid1_PreRender(object sender, System.EventArgs e)
        {
            if (!IsPostBack && RadGrid1.MasterTableView.Items.Count > 1)
            {
                //RadGrid1.MasterTableView.Items[1].Edit = true;
                //RadGrid1.EditIndexes.Add(0);
                //RadGrid1.MasterTableView.Rebind();
                //RadGrid1.Rebind();
            }
        }

        private DataTable ApplicationsTable
        {
            get
            {
                object obj = Session["Applications"];
                DataTable myDataTable = new DataTable();
                if (obj != null)
                {
                    myDataTable = (DataTable)obj;

                    //bool bActive = true;
                    //bActive = (chkshowinactive.Checked) ? false : true;
                    //myDataTable.DefaultView.RowFilter = "Active='" + bActive.ToString() + "'";
                    //myDataTable = myDataTable.DefaultView.ToTable();
                    //return myDataTable;
                }
                else
                    myDataTable = BindApplications();

                DataView aView = myDataTable.DefaultView;
                aView.RowFilter = strFilters;

                //myDataTable = aView.ToTable();

                //DataTable datasource;
                //if (strFilters != "")
                //{
                DataRow[] drArr = myDataTable.Select(strFilters);
                DataTable dtFiltered = myDataTable.Clone();

                foreach (DataRow dr in drArr)
                    dtFiltered.ImportRow(dr);

                //    datasource = ApplicationsTable;
                //    DataView aView = datasource.DefaultView;
                //    aView.RowFilter = strFilters;

                //    datasource = aView.ToTable();
                //}
                //else
                //    datasource = ApplicationsTable;
                //DataView aView = ApplicationsTable.DefaultView;
                //aView.RowFilter = strFilters;
                //DataTable dtFiltered = aView.ToTable();

                Session["Applications"] = myDataTable;
                return myDataTable;
            }
        }

        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = ApplicationsTable;
            ApplicationsTable.PrimaryKey = new DataColumn[] { ApplicationsTable.Columns["AppID"] };
        }

        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                //Get the instance of the right type
                GridDataItem dataBoundItem = e.Item as GridDataItem;

                //Check the formatting condition
                if (dataBoundItem["Active"].Text.ToLower() == "true")
                {
                    dataBoundItem["Active"].Text = "YES";
                    dataBoundItem["Active"].ForeColor = Color.Green;
                    dataBoundItem["Active"].Font.Bold = true;
                    dataBoundItem["AppName"].ForeColor = Color.Green;
                    dataBoundItem["AppName"].Font.Bold = true;
                }
                else
                {
                    dataBoundItem["Active"].Text = "NO";
                    dataBoundItem["Active"].ForeColor = Color.Red;
                    dataBoundItem["AppName"].ForeColor = Color.Red;
                }
                if (dataBoundItem["WebBased"].Text.ToLower() == "true")
                {
                    dataBoundItem["WebBased"].Text = "YES";
                    dataBoundItem["WebBased"].ForeColor = Color.Green;
                    dataBoundItem["WebBased"].Font.Bold = true;
                }
                else
                {
                    dataBoundItem["WebBased"].Text = "NO";
                    dataBoundItem["WebBased"].ForeColor = Color.Red;
                }
            }
            if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
            {
                GridEditableItem editform = (GridEditableItem)e.Item;
                TextBox txtAppName = (TextBox)editform.FindControl("txtAppName");
                Button btnUpdate = (Button)editform.FindControl("btnUpdate");
                Label lblError1 = (Label)editform.FindControl("lblError1");
                //btnUpdate.Attributes.Add("onclick", "return clientValidation(" + txtAppName.ClientID + "," + lblError1.ClientID + ");");
                btnUpdate.Attributes.Add("onclick", "if(document.getElementById('" + txtAppName.ClientID + "').value == '') { document.getElementById('" +
                    lblError1.ClientID + "').innerText = 'Application name cannot be empty.'; document.getElementById('" + txtAppName.ClientID + "').focus(); return false; }");
                txtAppName.Attributes.Add("onkeydown", "document.getElementById('" + lblError1.ClientID + "').innerText = '';");
            }
        }

        protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            TextBox txtAppName = (TextBox)editedItem.FindControl("txtAppName");
            CheckBox chkWebBased = (CheckBox)editedItem.FindControl("chkWebBased");
            CheckBox chkActive = (CheckBox)editedItem.FindControl("chkActive");
            Label lblError1 = (Label)editedItem.FindControl("lblError1");
            
            //Prepare new row to add it in the DataSource
            string sAppID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["AppID"].ToString();
            DataRow[] changedRows = ApplicationsTable.Select("AppID = " + sAppID);

            Label lblError = new Label();
            RadGrid1.Controls.Add(lblError);

            if (changedRows.Length != 1)
            {
                lblError1.Text = "Unable to locate the Application for updating.";
                e.Canceled = true;
                return;
            }
            if (txtAppName.Text == "")
            {
                lblError1.Text = "Application name cannot be empty.";
                txtAppName.Focus();
                e.Canceled = true;
                return;
            }

            //Update new values
            Hashtable newValues = new Hashtable();
            newValues["AppName"] = txtAppName.Text;
            newValues["WebBased"] = chkWebBased.Checked;
            newValues["Active"] = chkActive.Checked;
            newValues["ModifiedOn"] = DateTime.Now;
            newValues["ModifiedBy"] = "";

            changedRows[0].BeginEdit();
            try
            {
                foreach (DictionaryEntry entry in newValues)
                    changedRows[0][(string)entry.Key] = entry.Value;

                changedRows[0].EndEdit();
                ApplicationsTable.AcceptChanges();

                objApp.APPID = Convert.ToInt32(sAppID);
                objApp.AppName = txtAppName.Text;
                objApp.WebBased = (chkWebBased.Checked) ? 1 : 0;
                objApp.AppStatus = (chkActive.Checked) ? 1 : 0;
                objApp.CurrentUser = "";

                int ischanged = objApp.ChangeAppStatus();

                lblError.Text = "Application is updated successfully!";
                lblError.ForeColor = Color.Green;
            }
            catch (Exception ex)
            {
                changedRows[0].CancelEdit();
                lblError1.Text = "Unable to update Application. Reason: " + ex.Message;
                e.Canceled = true;
            }
        }

        protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            TextBox txtAppName = (TextBox)editedItem.FindControl("txtAppName");
            CheckBox chkWebBased = (CheckBox)editedItem.FindControl("chkWebBased");
            CheckBox chkActive = (CheckBox)editedItem.FindControl("chkActive");
            Label lblError1 = (Label)editedItem.FindControl("lblError1");

            //Create new row in the DataSource
            DataRow newRow = ApplicationsTable.NewRow();

            Label lblError = new Label();
            RadGrid1.Controls.Add(lblError);
            
            if (txtAppName.Text == "")
            {
                lblError1.Text = "Application name cannot be empty.";
                txtAppName.Focus();
                e.Canceled = true;
                return;
            }
            
            //Insert new values
            Hashtable newValues = new Hashtable();
            newValues["AppName"] = txtAppName.Text;
            newValues["WebBased"] = chkWebBased.Checked;
            newValues["Active"] = chkActive.Checked;
            newValues["ModifiedOn"] = DateTime.Now;
            newValues["ModifiedBy"] = "";

            //make sure that unique primary key value is generated for the inserted row
            try
            {
                objApp.APPID = 0;
                objApp.AppName = txtAppName.Text;
                objApp.WebBased = (chkWebBased.Checked) ? 1 : 0;
                objApp.AppStatus = (chkActive.Checked) ? 1 : 0;
                objApp.CurrentUser = "";

                newValues["AppID"] = objApp.ChangeAppStatus();

                foreach (DictionaryEntry entry in newValues)
                    newRow[(string)entry.Key] = entry.Value;
                ApplicationsTable.Rows.Add(newRow);
                ApplicationsTable.AcceptChanges();

                lblError.Text = "<font color=Green>Application is inserted successfully!</font>";
                lblError.ForeColor = Color.Green;
            }
            catch (Exception ex)
            {
                lblError1.Text = "Unable to insert Application. Reason: " + ex.Message;
                e.Canceled = true;
            }
        }

        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            //if (e.CommandName == RadGrid.FilterCommandName)
            //{
            //    Pair filterPair = (Pair)e.CommandArgument;
            //    string s1 = "Current Filter function: '" + filterPair.First + "' for column '" + filterPair.Second + "'";
            //    TextBox filterBox = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[0] as TextBox;
            //    string s2 = "<br> Entered pattern for search: " + filterBox.Text;


            //    if (strFilters != "")
            //    {
            //        switch (filterPair.First.ToString())
            //        {
            //            case "Contains":
            //                strFilters = strFilters + " and " + filterPair.Second + " like '%" + filterBox.Text + "%'";
            //                break;
            //            case "DoesNotContain":
            //                strFilters = strFilters + " and " + filterPair.Second + " not like '%" + filterBox.Text + "%'";
            //                break;
            //            case "StartsWith":
            //                strFilters = strFilters + " and " + filterPair.Second + " like '%>" + filterBox.Text + "%'";
            //                break;
            //            case "EndsWith":
            //                strFilters = strFilters + " and " + filterPair.Second + " like '%" + filterBox.Text + "</%'";
            //                break;
            //            case "EqualTo":
            //                strFilters = strFilters + " and " + filterPair.Second + " like '%>" + filterBox.Text + "</%'";
            //                break;
            //            case "NotEqualTo":
            //                strFilters = strFilters + " and " + filterPair.Second + " not like '%>" + filterBox.Text + "</%'";
            //                break;
            //        }
            //        //strFilters = strFilters + " and " + filterExpressions[i].FieldName + " like '%" + filterExpressions[i].FieldValue + "%'";
            //    }
            //    else
            //    {
            //        switch (filterPair.First.ToString())
            //        {
            //            case "Contains":
            //                strFilters = filterPair.Second + " like '%" + filterBox.Text + "%'";
            //                break;
            //            case "DoesNotContain":
            //                strFilters = filterPair.Second + " not like '%" + filterBox.Text + "%'";
            //                break;
            //            case "StartsWith":
            //                strFilters = filterPair.Second + " like '%>" + filterBox.Text + "%'";
            //                break;
            //            case "EndsWith":
            //                strFilters = filterPair.Second + " like '%" + filterBox.Text + "</%'";
            //                break;
            //            case "EqualTo":
            //                strFilters = filterPair.Second + " like '%>" + filterBox.Text + "</%'";
            //                break;
            //            case "NotEqualTo":
            //                strFilters = filterPair.Second + " not like '%>" + filterBox.Text + "</%'";
            //                break;
            //        }
            //        //strFilters = filterExpressions[i].FieldName + " like '%" + filterExpressions[i].FieldValue + "%'";
            //    }
            //    //RadGrid1.MasterTableView.FilterExpression = strFilters;
            //    //RadGrid1.MasterTableView.Rebind();
            //    //ApplicationsTable.DefaultView.RowFilter = strFilters;
            //    //RadGrid1.DataSource = ApplicationsTable.DefaultView.ToTable();
            //    Session["Applications"] = null;
            //    RadGrid1.MasterTableView.Rebind();
            //}
        }
    }
}

/*************************************************************************************************/

Please guide...
Konstantin Dikov
Telerik team
 answered on 08 Dec 2014
1 answer
132 views
I've found an issue with RadGrid horizontal scrolling in Firefox & Safari (IE & Chrome work without issue). If the user filters a column & no results come back, the horizontal scroll bar appears but doesn't work. This is a problem when a user filters on a column that isn't displayed by default & can only be viewed using the horizontal scroll bar.

Here's some details about the RadGrid:

1.) The columns are autogenerated
2.) The first columns are frozen
3.) The client settings "scrolling-AllowScroll" and "scrolling-UseStaticHeaders" are enabled

Any help on this issue would be greatly appreciated.

Venelin
Telerik team
 answered on 08 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?