Bind a GridView to a Tree View node selection

Discussion in 'ASP .Net' started by JN, Jan 17, 2006.

  1. JN

    JN Guest

    Hi All,

    I have a tree view which has parent nodes of each letter of the alphabet. The root node will be the customers name that relate to the parent node letter.

    I also have a gridview which is binded to the treeview control to display all customer records of the selected alphabetical letter.

    When I click expand the tree view and click on the customer's name, I get this error.:

    Please bear in mind that I have only been using ASP.net for a week.

    Thanks for your help.
    JN

    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) +2753507
    System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
    System.String.System.IConvertible.ToInt32(IFormatProvider provider) +43
    System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +293
    System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +257
    System.Web.UI.WebControls.Parameter.get_ParameterValue() +92
    System.Web.UI.WebControls.ParameterCollection.GetValues(HttpContext context, Control control) +282
    System.Web.UI.WebControls.SqlDataSourceView.InitializeParameters(DbCommand command, ParameterCollection parameters, IDictionary exclusionList) +344
    System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1250
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +84
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +154
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99
    System.Web.UI.WebControls.GridView.DataBind() +24
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +92
    System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +33
    System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +74
    System.Web.UI.Control.PreRenderRecursiveInternal() +148
    System.Web.UI.Control.PreRenderRecursiveInternal() +233
    System.Web.UI.Control.PreRenderRecursiveInternal() +233
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4435
     
    JN, Jan 17, 2006
    #1
    1. Advertising

  2. JN maybe try posting some snippet code.
    Patrick

    "JN" <> wrote in message news:u0os$...
    Hi All,

    I have a tree view which has parent nodes of each letter of the alphabet. The root node will be the customers name that relate to the parent node letter.

    I also have a gridview which is binded to the treeview control to display all customer records of the selected alphabetical letter.

    When I click expand the tree view and click on the customer's name, I get this error.:

    Please bear in mind that I have only been using ASP.net for a week.

    Thanks for your help.
    JN

    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) +2753507
    System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
    System.String.System.IConvertible.ToInt32(IFormatProvider provider) +43
    System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +293
    System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +257
    System.Web.UI.WebControls.Parameter.get_ParameterValue() +92
    System.Web.UI.WebControls.ParameterCollection.GetValues(HttpContext context, Control control) +282
    System.Web.UI.WebControls.SqlDataSourceView.InitializeParameters(DbCommand command, ParameterCollection parameters, IDictionary exclusionList) +344
    System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1250
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +84
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +154
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99
    System.Web.UI.WebControls.GridView.DataBind() +24
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +92
    System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +33
    System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +74
    System.Web.UI.Control.PreRenderRecursiveInternal() +148
    System.Web.UI.Control.PreRenderRecursiveInternal() +233
    System.Web.UI.Control.PreRenderRecursiveInternal() +233
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4435
     
    Patrick.O.Ige, Jan 17, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,495
  2. Tjerk Wolterink
    Replies:
    2
    Views:
    1,443
    Dimitre Novatchev
    Aug 24, 2006
  3. Peter Mueller
    Replies:
    6
    Views:
    4,586
    Stefan Ram
    Jan 13, 2008
  4. Santosh

    How to bind data to asp.net tree view control

    Santosh, Jun 14, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    135
    Bhuva
    Jun 19, 2006
  5. John Bankhead

    Null parent node on custom tree node after populate on demand

    John Bankhead, Dec 4, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    286
    John Bankhead
    Dec 4, 2006
Loading...

Share This Page