Gridview - Inner Joins, DDL, SelectedValue problem

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top