J
Joe Reiss
Hi all,
I'm using a gridview with a embedded dropdownlist and a objectDatasource as
its DataSource. The objectDatasource uses a DataObjectType for its data
instead of the parameter collections for Select,Update,Insert and Delete
methods.
In this Gridview I have a dropDownList which displays a value from another
table via a Foreign Key. So far so good. When the user changes this value
I need to update the FK, so, in the grid's RowUpdating event is where I
would update the FK, correct? So, what I need to know is how to update this
value which is in the underlying dataset of the objectDataSourrce. The
psuedo code below is where I'm stuck:
(ddlRole.Items[ddlRole.SelectedIndex].Value) represents my new value from
the dropdownlist. Now I need to assign this to the datasource represented
by the objectDatasource? If this is the correct strategy, then how do I get
at the current row of data that's in the objectDatasource, something like
the code below: RoleID is my FK. ddlRole is my embedded dropdown in my
gridview.
MyObjectDataSource.CurrentRow.RoleID.Value =
ddlRole.Items[ddlRole.SelectedIndex].Value;
Thanx,
Joe
I'm using a gridview with a embedded dropdownlist and a objectDatasource as
its DataSource. The objectDatasource uses a DataObjectType for its data
instead of the parameter collections for Select,Update,Insert and Delete
methods.
In this Gridview I have a dropDownList which displays a value from another
table via a Foreign Key. So far so good. When the user changes this value
I need to update the FK, so, in the grid's RowUpdating event is where I
would update the FK, correct? So, what I need to know is how to update this
value which is in the underlying dataset of the objectDataSourrce. The
psuedo code below is where I'm stuck:
(ddlRole.Items[ddlRole.SelectedIndex].Value) represents my new value from
the dropdownlist. Now I need to assign this to the datasource represented
by the objectDatasource? If this is the correct strategy, then how do I get
at the current row of data that's in the objectDatasource, something like
the code below: RoleID is my FK. ddlRole is my embedded dropdown in my
gridview.
MyObjectDataSource.CurrentRow.RoleID.Value =
ddlRole.Items[ddlRole.SelectedIndex].Value;
Thanx,
Joe