E
Elmo Watson
OK here's the scenario -
GridView - populated with Object DataSource - technically no problem there
(except what will be shown later in the post)
Edit/Delete - first column - 'JobTypeID' - in the Main Table, it just uses
the PK (int) from the JobTypes table - -
DropDownList - inside one column's EditTemplate of the GridView - populated
by another (db table) ObjectDataSource control. DataValueField=JobTypeID and
DataTextField=JobType
The problem is that, the Gridview's population uses a Stored procedure which
innerjoins these two tables, so that in the GridView, the actual JobType
shows, instead of the PK - the actual JobType
What I need to do is - when it switches to the EditTemplate, I need for the
Selected Item to be the same Item that showed up in the ItemTemplate - -
but, when I choose
SelectedValue='<%# Bind("JobType") %>'
- I get the dreaded error:
'DropDownList1' has a SelectedValue which is invalid because it does not
exist in the list of items.
I've seen a lot of posts here and there on how to fix particular problems,
when I Googled the error, but none of them were specific enough and didn't
tell me where to put code....I'm just lost here - I just need this one
little piece
Any help please?
GridView - populated with Object DataSource - technically no problem there
(except what will be shown later in the post)
Edit/Delete - first column - 'JobTypeID' - in the Main Table, it just uses
the PK (int) from the JobTypes table - -
DropDownList - inside one column's EditTemplate of the GridView - populated
by another (db table) ObjectDataSource control. DataValueField=JobTypeID and
DataTextField=JobType
The problem is that, the Gridview's population uses a Stored procedure which
innerjoins these two tables, so that in the GridView, the actual JobType
shows, instead of the PK - the actual JobType
What I need to do is - when it switches to the EditTemplate, I need for the
Selected Item to be the same Item that showed up in the ItemTemplate - -
but, when I choose
SelectedValue='<%# Bind("JobType") %>'
- I get the dreaded error:
'DropDownList1' has a SelectedValue which is invalid because it does not
exist in the list of items.
I've seen a lot of posts here and there on how to fix particular problems,
when I Googled the error, but none of them were specific enough and didn't
tell me where to put code....I'm just lost here - I just need this one
little piece
Any help please?