H
H5N1
Hi there
First of all excuse me posting such simple (I guess) question, but I
didn't find the answer in tutorials.
I have a formView presenting records from some table. one of the fields
is a Category ID, which is a foreign key. in edit template I replace it
with dropdownlist, which is gets this ID, and displays corresponding
name, by getting information from other datasource.
it's possible, since we have 3 properties in ddlist:
( DataSourceID="odsCourseCategories" )
DataTextField="Name"
DataValueField="CourseCategoryID"
SelectedValue='<%# Bind("CourseCategoryID") %>'
DataTextField, and DataValueField which are connected to 'foreign'
dataSource, and SelectedValue which is bound to current dataSource
(inherited from parent FormView).
Now, my problem is simple - how can I achieve the same with simple
label control, on the same field, in ItemTemplate (when I'm not
editing), which doesn't (I guess) have those properties?
Label is bound to Category ID, and I want it to display corresponding
Name.
I know that I could tweak my formview datasource (tableAdapter) to
provide Name also, but I'd like to do it using 2 plain single-table
CRUD datasources.
thanks a lot
greets
Hapiec
First of all excuse me posting such simple (I guess) question, but I
didn't find the answer in tutorials.
I have a formView presenting records from some table. one of the fields
is a Category ID, which is a foreign key. in edit template I replace it
with dropdownlist, which is gets this ID, and displays corresponding
name, by getting information from other datasource.
it's possible, since we have 3 properties in ddlist:
( DataSourceID="odsCourseCategories" )
DataTextField="Name"
DataValueField="CourseCategoryID"
SelectedValue='<%# Bind("CourseCategoryID") %>'
DataTextField, and DataValueField which are connected to 'foreign'
dataSource, and SelectedValue which is bound to current dataSource
(inherited from parent FormView).
Now, my problem is simple - how can I achieve the same with simple
label control, on the same field, in ItemTemplate (when I'm not
editing), which doesn't (I guess) have those properties?
Label is bound to Category ID, and I want it to display corresponding
Name.
I know that I could tweak my formview datasource (tableAdapter) to
provide Name also, but I'd like to do it using 2 plain single-table
CRUD datasources.
thanks a lot
greets
Hapiec