Click here to Skip to main content
16,012,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a grid view which has a start date, end date and price. When I insert record next date of end date should be assigned to new row.

Example
startdate enddate Price Action
1/1/2011 15/1/2011 200 Insert
16/1/2011 Insert ->this new row should automatically display next date when i click on insert

How do I accomplish this?

Any help is greatly appreciated.
Posted
Updated 2-Aug-11 1:22am
v2

1 solution

Before Inserting the row get the Enddate column of the previous row using Identity field or SNo field.
Then Add 1 day(using DateAdd() function) to the result value(Enddate column of previous row) & then Insert the value to the Startdate column of current row.
Write a general function for that, that's all.
 
Share this answer
 
Comments
Mythri_8 2-Aug-11 9:59am    
Where should i do this in rowcommand or rowcreated or rowbind

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900