FormView Questions

Q

Q. John Chen

I have a table T with following columns for example
ID, ParentID, ApptDateTime, UpdatedBy

On formView I want display the ApptDate and Time seperately with two
textBoxes.

In itemTemplate, I can do this:
Text='<%# Eval("ApptDateTime", "{0:MM/dd/yyyy}") %>' (for date
part)
Text='<%# Eval("ApptDateTime", "{0:HH:mm}") %>' (for
time part)
I set the textboxes Readonly so user can not change the values.

In insertTemplate, I can do this:
Text='<%# Bind("ApptDate") %>' (for date part)
Text='<%# Bind("ApptTime") %>' (for time part)

I am using ObjectDataSource. I can add code to combine the values in
the InsertMethod.
But how can bind the
ParentID with is key in GridView
and
UpdateBy which I can get from the user credential.

In editTemplate, What do I do in this situation? Do I have to change
the SQL so the date and time is already seperated,
i.e. "Selete ApptDateTime as ApptDate, ApptDateTime as ApptTime ..." in
SQL

Thanks

John

display the apptDate and Time seperatly like "11/9/2006 at 10:00".

in editTemplate and insertTemplate, I want show two textboxes,
ApptDateTextBox and ApptTimeTextBox.
 
Q

Q. John Chen

For ParentID and UpdatedBy, I figured out:
in ItemInserting event, add them to the e.Values collection.
 

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

Similar Threads

FormView 3
FormView 1
FormView 0
GridView/FormView (master/details) questions 2
DataSource and FormView questions 2
FormView 0
FormView and Master Page 0
Hello from beginner with some questions! 3

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top