i am using a gridviw to display values from database
and using formview to insert values to gridview
i have the following fields in formview during insert mode like
Name :
StartDate:
EndDate:
now when i enter the startdate
the Enddate should automatically add 7 days to startdate and get inserted
if its textbox i know we can add like
DateTime.Now.Add(7);
but for a field in formview is it possible to do that
plz help me on this regard
Shruthi

you already know about the end date will be 7 day after startdate. you can call a store procedure when you need to insert the data to database, in the store procedure you can make it automatic add 7 day on the end date. this is another way to insert but the result will be same.

i also have another idea, that is using javascript or ajax to add it automatic. after u key in the startdate, you add in a event on start date and when you key in the start date. it will call up js and javascript to assign a new value to end date.

hope it can help you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.