Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
497 views
   I'm not exactly sure if this is a Rad control issue or not, but i'm thinking it is because the error started occurring after I added a rad grid to the program.  I have a web page that has several controls in it, including an ajax manager/loading panel.  the user adds an item number and when the add button is clicked, the manager is activated and it adds the item number to a grid (asp:GridView).  Everything works fine with that.  I just added a RadGrid and when a submit button (not the add button) is clicked, it sends out a url, which brings back info and enters that info into the rad grid. This is working just fine when using most internet browsers.  When I use Firefox with this, it's erroring out, almost like it's not even reaching my code.  here's the page i get:

Server Error in '/' Application.

Input string was not in a correct format.

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.FormatException: Input string was not in a correct format.

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:

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7469351
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
   System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +193
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +14
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +693
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743


Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

Any possibly information would be greatly appreciated.  Thanks!
Amanda
Top achievements
Rank 2
 answered on 14 May 2010
2 answers
255 views
Hello,
  • .Net 3.5Sp1
  • Win2003 server
  • IE 7 and 8
  • Telerik RadControls 2010.1.45  (2010 NET35)
  • preferred programming language C#
  • Receiving the error: "Insert Item is available only when grid is in insert mode."  Shown at the end of this post.  I have a grid with 3 text boxes and 3 dropdown lists.  When I click a link " Add new item" it calls the RadGrid1_InsertCommand which would add a blank record to my data source and then I rebind.  I do not modify any of the controls directly just the data source and rebind.  Suddenly I have started to recieve this error and I don't understand what has changed for me to start getting this error. I've had this working fine.  Please provide any insight you may have.

    <Page snippet>
     <rad:RadGrid ID="RadGrid1"
                            runat="server"
                            AutoGenerateColumns="False"
                            BorderStyle="Groove"
                            BorderWidth="2px"                       
                            UseAccessibleHeader="true"                       
                            Width="95%"
                            EnableEmbeddedSkins="false"
                            Skin="Skin1"
                            OnPreRender="RadGrid1_PreRender" GridLines="None" >
                            <itemstyle backcolor="Gainsboro" />
                            <alternatingitemstyle backcolor="WhiteSmoke" />
                            <MasterTableView EditMode="InPlace" DataKeyNames="EKey"
                                CommandItemDisplay="Bottom" AddNewRecordText="New Item" horizontalalign="Center">
                                <CommandItemTemplate>
                                    <asp:LinkButton ID="lnkAddNew" runat="server" CommandName="PerformInsert" ><img style="border:0px;" alt="New Item" src="/Grid/AddRecord.gif" /> Add CPE</asp:LinkButton>
                                </CommandItemTemplate>
                                <rowindicatorcolumn>
                                    <HeaderStyle Width="20px" />
                                </rowindicatorcolumn>
                                <expandcollapsecolumn>
                                    <HeaderStyle Width="20px" />
                                </expandcollapsecolumn>
                                <Columns>                                                       
                               
                                <rad:GridBoundColumn DataField="EKey" ReadOnly="false" Visible="false" UniqueName="ElementCPEKey"/>
                                <%--<rad:GridBoundColumn DataField="CKey" ReadOnly="false" Visible="false" UniqueName="CPEKey"/>--%>                                                                                 
                                                           
                                <rad:GridTemplateColumn HeaderText="Item Name" ItemStyle-Wrap="true" ItemStyle-width="20%" ItemStyle-CssClass="StdFont">
                                    <ItemTemplate><%# Eval("ItemNameText")%></ItemTemplate>                                                  
                                    <EditItemTemplate >
                                        <rad:RadTextBox ID="txtItemName" runat="server" Columns="60" Text='<%# Eval("ItemName") %>' width="99%"  OnTextChanged="txtItemName_OnTextChanged" AutoPostBack="true"></rad:RadTextBox>
                                        <br />                                                              
                                    </EditItemTemplate>                            
                                    <ItemStyle Width="20%" Wrap="True" />
                                </rad:GridTemplateColumn>
    </End Page Snippet>
    <Code Behind Grid Events>
     #region Grid methods
        private void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
            {
                //LoadLookupData(RadGrid1.MasterTableView.Items.Count - 1);
                GridEditableItem editedItem = e.Item as GridEditableItem;
                EDTO gridDTO = e.Item.DataItem as EDTO;

                VMSDropDownList ddl = editedItem.FindControl("ddlList") as VMSDropDownList;
                ddl.DataTextField = "Descrip";
                ddl.DataValueField = "ListKey";
                ddl.DataSource = Manager.RetrieveList(session);
                ddl.DataBind();
                ddl.Items.Insert(0, new ListItem("None"));
                ddl.SelectedValue = 1;

                <... repeated twice with two other lists ...>
                }
        }
        void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
        {
            //if (dsDTO == null)
            //{
            //    dsDTO = new DataSource<EDTO>();
            //    AddBlankRow();
            //}
            //else
            //{
            //    GridDataItem dataItem = RadGrid1.MasterTableView.Items[RadGrid1.MasterTableView.Items.Count - 1];

            //    RadTextBox itemTextBox = dataItem.FindControl("txtItemName") as RadTextBox;
            //    RadTextBox itemIDTextBox = dataItem.FindControl("txtItemID") as RadTextBox;
            //    if (itemTextBox.Text.Length > 0 && itemIDTextBox.Text.Length > 0)
            //    {
            //        //dataItem.Enabled = false;
            //        AddBlankRow();
            //    }
            //    else
            //    {
            //        SetResultText("An item must be selected before adding a new record to this element.");
            //        BindElementGrid();
            //    }
            //}
        }
         void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
        {
            if (dsDTO != null)
            {
                if (dsDTO.DataItems[e.Item.ItemIndex].IsLoadedFlag == 1) //we loaded from database
                    dsDTO.DataItems[e.Item.ItemIndex].DeleteFlag = 1;
                else
                    dsDTO.DataItems.RemoveAt(e.Item.ItemIndex); //This is new, the user just added it so remove it from the list.
                if (e.Item.ItemIndex == 0)
                    dsDTO = null;

                BindElementGrid();
            }
        }
       private void BindElementGrid()
        {
            if (dsDTO != null)
            {
                RadGrid1.DataSource = dsDTO;
                //RadGrid1.DataSource = RetrieveActiveDataSource();
                for (int i = 0; i < RadGrid1.PageSize; i++)
                {
                    RadGrid1.EditIndexes.Add(i);
                }
                this.RadGrid1.DataBind();

                ViewState[this.UniqueID + "dsDTO"] = dsDTO;
            }
        }

    //Tried to use this instead to get rid of the GetInsert() error
        private void RadGrid_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "PerformInsert")
            {
                if (dsDTO == null)
                {
                    dsDTO = new DataSource<EDTO>();
                    AddBlankRow();
                }
                else
                {
                    GridDataItem dataItem = RadGrid1.MasterTableView.Items[RadGrid1.MasterTableView.Items.Count - 1];

                    
                    RadTextBox itemTextBox = dataItem.FindControl("txtItemName") as RadTextBox;
                    RadTextBox itemIDTextBox = dataItem.FindControl("txtItemID") as RadTextBox;
                    if (itemTextBox.Text.Length > 0 && itemIDTextBox.Text.Length > 0)
                    {
                        //dataItem.Enabled = false;
                        AddBlankRow();
                    }
                    else
                    {
                        SetResultText("An item must be selected before adding a new record to this element.");
                        BindElementCPEGrid();
                    }
                }
            }
        }
    #endregion
    </End Code Behind Grid Events>
    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Insert item is available only when grid is in insert mode.
    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: Telerik.Web.UI.GridException: Insert item is available only when grid is in insert mode.

    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:

    [GridException: Insert item is available only when grid is in insert mode.]
       Telerik.Web.UI.GridTableView.GetInsertItem() +211
       Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +2910
       Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +134
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
       Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +38
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
       Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +115
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

     

    Pete
    Top achievements
    Rank 1
     answered on 14 May 2010
    1 answer
    354 views
    Hi...I am trying to have a tooltip display whenever I hover over the items of a radCombo.
    I have done some of the work so far using an Item template, but I only know how to show either the DataTextField or dataValueField , yet the tooltip I want to show is a different field that I pull from the same table as per my query below. I want to show the suburb as my tooltip on hover.
    Below is the SQL Query and binding to radcombo:
    string AreasQuery = "select AreaID as AreaID,AreaName as AreaName,Suburbs as Suburbs from area order by AreaName ";
    dtAreas = dbo.sqldb_select(AreasQuery, 1);
    cmbAreas.DataTextField = "AreaName";
    cmbAreas.DataValueField = "AreaID";

    AreaID is my datavalueField and AreaName is my DataTextField.
    Below is my aspx code , and I have also attached a screen shot of how this currently looks at the moment. I just dont know how to bring the Suburb Field into my ItemTemplate...maybe an attribute, but I am not sure how to use that. Kindly assist.

    <td align="left" class="style11" valign="middle" bgcolor="#CC3300">
      <telerik:RadComboBox ID="cmbAreas"  Runat="server" Height="150px" MarkFirstMatch="True" 
      Skin="Hay" Width="236px" DataTextField="AreaName" DataValueField="AreaID">
      <ItemTemplate> 
            <asp:Label runat="server" ID="Label1" Text='<%# Eval("AreaName")%>' ></asp:Label> 
            <telerik:RadToolTip ID="RadToolTip1" runat="server" Width="100" Height="10" TargetControlID="Label1" Position="BottomRight" Text='<%# Eval("AreaName")%>' >
            </telerik:RadToolTip> 
      </ItemTemplate> 
      </telerik:RadComboBox>
    </td>


    Alex Odago
    Top achievements
    Rank 1
     answered on 14 May 2010
    4 answers
    141 views
    Hi,

    I use stand-alone dialogs. I switched to Q3 2009 and now I get the following ASP.NET error

    The ToolName property must be set!

    Nothing else was changed, I only switched DLL

    Please advice soonest.

    Regards,
    Marc
    Rumen
    Telerik team
     answered on 14 May 2010
    2 answers
    76 views
    I have a page containing four ListBoxes along with several other controls. When the user resizes IE7, the all of the ListBox controls disappear. All other controls are fine - including other Telerik controls. This only occurs in IE7. Everything is fine in FF, Chrome and Safari.

    Anyone else experience this? Any help is appreciated.

    Thanks,
    Brian
    Naresh
    Top achievements
    Rank 1
     answered on 14 May 2010
    3 answers
    98 views
    Hi,

    I have hierarchy grid. On load of the screen detail table does not exists for some rows in the Rad Grid but still Expand image appears. On click of it nothing will be loaded page will be refreshed and expand button wil disappers.

    Expected behaviour:
    On Load itself expand button should not be displayed if no detail table exists.

    Why is this problem in Telerik Version

    Version=2010.1.413.40


    Is there any fix for my problem?
    Pavlina
    Telerik team
     answered on 14 May 2010
    1 answer
    126 views
    I've discovered a bug with RadEditor when copying and pasting a link, where the link's href starts with a slash. In Firefox, the pasted link is preceded by any number of ../ and part of the path removed, and in IE, the link is changed to an absolute path including the domain.

    Steps to reproduce.

    1. Visit: http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx
    2. In the first paragraph, change the Sharepoint link's href to: /products/aspnet-ajax/sharepoint.aspx
    3. Copy the paragraph
    4. Paste the paragraph somewhere else in the editor
    5. View the new href of the Sharepoint link in the pasted paragraph

    Results

    Firefox
    Link href becomes: ../../../../products/aspnet-ajax/sharepoint.aspx

    IE
    Link href becomes: http://demos.telerik.com/products/aspnet-ajax/sharepoint.aspx

    Expected result:

    Link to remain as /products/aspnet-ajax/sharepoint.aspx

    Regards

    Matt

    Rumen
    Telerik team
     answered on 14 May 2010
    1 answer
    68 views
    I have a radgrid with inline editing. All works fine and the database updates server side with each row. I have a submit button that I do not want to validate as true unless all rows in the grid have been completed (i.e. have a value in every column for every row). Is there a way to validate the grid is fully filled out via client side script?

    Thanks in advance!

    -tk
    Radoslav
    Telerik team
     answered on 14 May 2010
    1 answer
    107 views
    I'm attempting to use a .png file for the background image of a drop down in a RadMenu control. It's just a 1px x 1px black square with a small amount of transparency and repeated, but when I view in a browser, the dropdown background is a solid gray color.

    Any ideas? Thanks!

    div.RadMenu_main_nav .rmItem .rmGroup {
        background-image:url('img/nav_hover_bgd.png');
        background-repeat:repeat;
        border: 1px solid #FFF;
    }
    Kamen Bundev
    Telerik team
     answered on 14 May 2010
    2 answers
    98 views
    Hi,

    What would be the server side equivalent for set_currentPageIndex() if there is any ?

    Something like :

    Protected Sub RadListView1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles RadListView1.PreRender 
     
     
            For Each item As RadListViewDataItem In RadListView1.Items 
                Dim customerID As String = item.GetDataKeyValue("id_inscrit").ToString() 
                If customerID = Request.QueryString("id_inscrit") Then 
    'RadListView1.???? -> Go to the choosen page 
                     
                End If 
            Next 
            RadListView1.Rebind() 
     
        End Sub 


    Thank You
    Arnaud
    arnaud
    Top achievements
    Rank 1
     answered on 14 May 2010
    Narrow your results
    Selected tags
    Tags
    +? more
    Top users last month
    Jake
    Top achievements
    Rank 1
    RBarnes
    Top achievements
    Rank 1
    Iron
    Iron
    Rami
    Top achievements
    Rank 1
    Iron
    Veteran
    Nathan
    Top achievements
    Rank 1
    Kumeri
    Top achievements
    Rank 1
    Iron
    Veteran
    Iron
    Want to show your ninja superpower to fellow developers?
    Top users last month
    Jake
    Top achievements
    Rank 1
    RBarnes
    Top achievements
    Rank 1
    Iron
    Iron
    Rami
    Top achievements
    Rank 1
    Iron
    Veteran
    Nathan
    Top achievements
    Rank 1
    Kumeri
    Top achievements
    Rank 1
    Iron
    Veteran
    Iron
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?