DropDown in .NET DataGrid produces OnDataGridUpdate error

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default DropDown in .NET DataGrid produces OnDataGridUpdate error

    I have a DropDownList in a DataGrid EditItemTemplate region. The
    DropDownList is populated by a dataset different than the one specificied as
    the DataSource for the DataGrid. The DataSource for the DataGrid is
    "dsCompanies", while the picklist in the EditItemTemplate region is
    "dsCompanyTypes".

    Whenever I update a row in the DataGrid, I receive the following error:

    System.Exception: Control not found in DataGrid column: typeCode
    at DreamweaverCtrls.DataSet.OnDataGridUpdate(Object Src,
    DataGridCommandEventArgs E)

    The field "typeCode" exists in both datasets. It is the PK for companyTypes
    table and an FK in the companies table.

    How should I go about populating a dropdown in a DataGrid with a dataset
    other than the primary datasource for the DataGrid?

    Thanks


    Les Matthews Guest

  2. Similar Questions and Discussions

    1. Datagrid dropdown
      I have a datagrid with two dropdowns and I can fill the dropdown from stored procedure, that's not a problem. The question is I need the fil the...
    2. How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event.
      How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the...
    3. DataGrid with Dropdown list
      Any Help is appreciated! I have a datagrid with Drop down list and a remove hyperlink as two columns. When I remove the row of the datagrid by...
    4. dropdown in a datagrid
      I can put a dropdown in a grid column, databind it, and it will work but how can I get the itemchanged event so that I can do something with it?...
    5. if mysql_query() produces an error...
      ....is it not true that mysql_error() will persist? I have a case on a site where the admin enters a new user and, for some reason, does it wrong,...
  3. #2

    Default Re: DropDown in .NET DataGrid produces OnDataGridUpdate error

    Load the Company Types Table into the dsCompanies DataSet. I don't see why
    you need to create separate DataSets for the two.


    On 18/4/05 5:06 pm, in article d40lr6$9v6$1@forums.macromedia.com, "Les
    Matthews" <LesAMatthews@yahoo.com> wrote:
    > I have a DropDownList in a DataGrid EditItemTemplate region. The
    > DropDownList is populated by a dataset different than the one specificied as
    > the DataSource for the DataGrid. The DataSource for the DataGrid is
    > "dsCompanies", while the picklist in the EditItemTemplate region is
    > "dsCompanyTypes".
    >
    > Whenever I update a row in the DataGrid, I receive the following error:
    >
    > System.Exception: Control not found in DataGrid column: typeCode
    > at DreamweaverCtrls.DataSet.OnDataGridUpdate(Object Src,
    > DataGridCommandEventArgs E)
    >
    > The field "typeCode" exists in both datasets. It is the PK for companyTypes
    > table and an FK in the companies table.
    >
    > How should I go about populating a dropdown in a DataGrid with a dataset
    > other than the primary datasource for the DataGrid?
    >
    > Thanks
    >
    >
    Calvin Willman Guest

  4. #3

    Default Re: DropDown in .NET DataGrid produces OnDataGridUpdate error

    You can then also Add the DataRelation object passing in the two columns
    try...

    DataRelation dRel = new DataRelation("CompaniesCompanyTypes",
    dsCompanies.Tables["Companies"].Columns["typeCode"],dsCompanies.Tables["dsCo
    mpanies"].Tables["CompanyTypes"].Columns["typeCode"]



    On 18/4/05 5:06 pm, in article d40lr6$9v6$1@forums.macromedia.com, "Les
    Matthews" <LesAMatthews@yahoo.com> wrote:
    > I have a DropDownList in a DataGrid EditItemTemplate region. The
    > DropDownList is populated by a dataset different than the one specificied as
    > the DataSource for the DataGrid. The DataSource for the DataGrid is
    > "dsCompanies", while the picklist in the EditItemTemplate region is
    > "dsCompanyTypes".
    >
    > Whenever I update a row in the DataGrid, I receive the following error:
    >
    > System.Exception: Control not found in DataGrid column: typeCode
    > at DreamweaverCtrls.DataSet.OnDataGridUpdate(Object Src,
    > DataGridCommandEventArgs E)
    >
    > The field "typeCode" exists in both datasets. It is the PK for companyTypes
    > table and an FK in the companies table.
    >
    > How should I go about populating a dropdown in a DataGrid with a dataset
    > other than the primary datasource for the DataGrid?
    >
    > Thanks
    >
    >
    Calvin Willman Guest

  5. #4

    Default Re: DropDown in .NET DataGrid produces OnDataGridUpdate error

    sorry.. Type error seconf line I types 'Tables["dsCompanies"]' which is
    rubbish.

    DataRelation dRel = new DataRelation("CompaniesCompanyTypes",
    dsCompanies.Tables["Companies"].Columns["typeCode"],dsCompanies.Tables["Comp
    anyTypes"].Columns["typeCode"]

    But you probably don't need this anyway... so wouldn't worry about it

    On 18/4/05 5:06 pm, in article d40lr6$9v6$1@forums.macromedia.com, "Les
    Matthews" <LesAMatthews@yahoo.com> wrote:
    > I have a DropDownList in a DataGrid EditItemTemplate region. The
    > DropDownList is populated by a dataset different than the one specificied as
    > the DataSource for the DataGrid. The DataSource for the DataGrid is
    > "dsCompanies", while the picklist in the EditItemTemplate region is
    > "dsCompanyTypes".
    >
    > Whenever I update a row in the DataGrid, I receive the following error:
    >
    > System.Exception: Control not found in DataGrid column: typeCode
    > at DreamweaverCtrls.DataSet.OnDataGridUpdate(Object Src,
    > DataGridCommandEventArgs E)
    >
    > The field "typeCode" exists in both datasets. It is the PK for companyTypes
    > table and an FK in the companies table.
    >
    > How should I go about populating a dropdown in a DataGrid with a dataset
    > other than the primary datasource for the DataGrid?
    >
    > Thanks
    >
    >
    Calvin Willman Guest

  6. #5

    Default Re: DropDown in .NET DataGrid produces OnDataGridUpdate error

    I have it worked out now.
    Thanks for your help, Calvin.
    I'm not familiar with the DataRelation object - I'll have to look into it.

    "Calvin Willman" <calvinwillman@orange.net> wrote in message
    news:BE89A82D.86E%calvinwillman@orange.net...
    > You can then also Add the DataRelation object passing in the two columns
    > try...
    >
    > DataRelation dRel = new DataRelation("CompaniesCompanyTypes",
    > dsCompanies.Tables["Companies"].Columns["typeCode"],dsCompanies.Tables["dsCo
    > mpanies"].Tables["CompanyTypes"].Columns["typeCode"]
    >
    >
    >
    > On 18/4/05 5:06 pm, in article d40lr6$9v6$1@forums.macromedia.com, "Les
    > Matthews" <LesAMatthews@yahoo.com> wrote:
    >
    >> I have a DropDownList in a DataGrid EditItemTemplate region. The
    >> DropDownList is populated by a dataset different than the one specificied
    >> as
    >> the DataSource for the DataGrid. The DataSource for the DataGrid is
    >> "dsCompanies", while the picklist in the EditItemTemplate region is
    >> "dsCompanyTypes".
    >>
    >> Whenever I update a row in the DataGrid, I receive the following error:
    >>
    >> System.Exception: Control not found in DataGrid column: typeCode
    >> at DreamweaverCtrls.DataSet.OnDataGridUpdate(Object Src,
    >> DataGridCommandEventArgs E)
    >>
    >> The field "typeCode" exists in both datasets. It is the PK for
    >> companyTypes
    >> table and an FK in the companies table.
    >>
    >> How should I go about populating a dropdown in a DataGrid with a dataset
    >> other than the primary datasource for the DataGrid?
    >>
    >> Thanks
    >>
    >>
    >

    Les Matthews Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139