This is a migrated thread and some comments may be shown as answers.

[Solved] Grid with Slider Paging, Throws exception while moving paging slider.

2 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 2
Avinash asked on 28 Apr 2009, 06:01 AM
Hi,

I am doing POC on RADGrid with Slider paging.
But I am getting an exception as "Input string was not in a correct format."  when I move / drags slider for paging. It's not working for me. I am attaching my ASPX and VB.Net code along I will appreciate if I can get feedback as early as possible.

We are planning to incorporate Telerik controls in our application for rich feel and high performance but only if I get rid of these kind of minor error which eats lots of head.

Actual Exception
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) +2755599  
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112  
   Telerik.WebControls.GridClientChangesLoader.LoadAJAXScrolledControl(String scrolledControl) +155  
   Telerik.WebControls.GridClientChangesLoader.LoadChanges(String argument, NameValueCollection collection) +946  
   Telerik.WebControls.RadGrid.LoadPostData(String postDataKey, NameValueCollection postCollection) +582  
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +673  
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2970  
 
   
 
 
--------------------------------------------------------------------------------  
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433  

ASPX File (Default.aspx)
<%@ Page Language="VB" %> 
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 
<%@ Register TagPrefix="radG" Namespace="Telerik.WebControls" Assembly="RadGrid.Net2" %> 
<%@ Register TagPrefix="radC" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<script runat="server">  
 
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>POC Page</title> 
</head> 
<body> 
    <form id="frmPOC" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" EnablePartialRendering="True">  
            <scripts> 
                <asp:ScriptReference Path="~/ScriptLibrary/Atlas.js" /> 
            </scripts> 
        </asp:ScriptManager> 
        <radC:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <ajaxsettings> 
                <radC:AjaxSetting AjaxControlID="grdSliderPOC">  
                    <UpdatedControls> 
                        <radC:AjaxUpdatedControl ControlID="grdSliderPOC" /> 
                    </UpdatedControls> 
                </radC:AjaxSetting> 
            </ajaxsettings> 
        </radC:RadAjaxManager> 
        <h1> 
            POC for Telerik Grid</h1> 
        <h2> 
            Grid with Slider paging</h2> 
        <table cellpadding="0" cellspacing="0" border="0" width="100%">  
            <tr> 
                <td> 
                    <radG:RadGrid ID="grdSliderPOC" EnableAJAX="True" runat="server" Width="100%" AutoGenerateColumns="False" 
                        GridLines="None" AllowSorting="true" AllowPaging="true" PageSize="5">  
                        <mastertableview> 
                            <Columns> 
                                <radG:GridBoundColumn UniqueName="DueDate" ReadOnly="True" DataField="DueDate" HeaderText="Due Date">  
                                </radG:GridBoundColumn> 
                                <radG:GridBoundColumn UniqueName="Action" ReadOnly="True" DataField="Action" HeaderText="Action">  
                                </radG:GridBoundColumn> 
                                <radG:GridBoundColumn UniqueName="Description" ReadOnly="True" DataField="Description" 
                                    HeaderText="Description">  
                                </radG:GridBoundColumn> 
                                <radG:GridBoundColumn UniqueName="Customer" ReadOnly="True" DataField="Customer" 
                                    HeaderText="Customer">  
                                </radG:GridBoundColumn> 
                                <radG:GridBoundColumn UniqueName="Contact" ReadOnly="True" DataField="Contact" HeaderText="Contact">  
                                </radG:GridBoundColumn> 
                                <radG:GridBoundColumn UniqueName="SalesRep" ReadOnly="True" DataField="SalesRep" 
                                    HeaderText="Sales Rep">  
                                </radG:GridBoundColumn> 
                                <radG:GridBoundColumn UniqueName="Status" ReadOnly="True" DataField="Status" HeaderText="Status">  
                                </radG:GridBoundColumn> 
                            </Columns> 
                            <RowIndicatorColumn Visible="False">  
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Visible="False">  
                            </ExpandCollapseColumn> 
                        </mastertableview> 
                        <pagerstyle cssclass="pagingControls" mode="Slider" /> 
                    </radG:RadGrid> 
                </td> 
            </tr> 
        </table> 
    </form> 
</body> 
</html> 

VB File (Default.aspx.vb)
Imports System.Data  
 
Partial Class _Default  
    Inherits Web.UI.Page  
 
    ''' <summary>  
    '''   
    ''' </summary>  
    ''' <param name="sender"></param>  
    ''' <param name="e"></param>  
    ''' <remarks></remarks>  
    Protected Sub grdSliderPOC_NeedDataSource(ByVal sender As ObjectByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles grdSliderPOC.NeedDataSource  
 
        PopulateSliderGrid()  
 
    End Sub 
 
    ''' <summary>  
    '''   
    ''' </summary>  
    ''' <remarks></remarks>  
    Private Sub PopulateSliderGrid()  
 
        Dim dtSource As New DataTable()  
        Dim drNew As DataRow  
 
        dtSource.Columns.Add("DueDate")  
        dtSource.Columns.Add("Action")  
        dtSource.Columns.Add("Description")  
        dtSource.Columns.Add("Customer")  
        dtSource.Columns.Add("Contact")  
        dtSource.Columns.Add("SalesRep")  
        dtSource.Columns.Add("Status")  
 
        For iCount As Integer = 1 To 20  
 
            drNew = dtSource.NewRow()  
            drNew("DueDate") = "10/21/2009" 
            drNew("Action") = "Submit Proposal" 
            drNew("Description") = "Contact / Contract follow up" 
            drNew("Customer") = "Customer Name Two" 
            drNew("Contact") = "Contact Name" 
            drNew("SalesRep") = "Sales Rep Name" 
            drNew("Status") = "Message Left" 
            dtSource.Rows.Add(drNew)  
 
        Next 
 
        grdSliderPOC.MasterTableView.DataSource = dtSource.DefaultView  
 
    End Sub 
 
 
End Class 

Thanks,
Avi

2 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 30 Apr 2009, 11:40 AM
Hello Avinash,

I tested the setup in question, and the control behaved as expected.
Attached to this message, is the code, which I used for testing. Take a look at it and let me know if this is the expected behavior.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Avinash
Top achievements
Rank 2
answered on 30 Apr 2009, 11:52 AM
Hi,

Gr8, it worked fine!
Please close the issue.

Thanks,
Avi
Tags
Grid
Asked by
Avinash
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Avinash
Top achievements
Rank 2
Share this question
or