前一行的日期以反映网格视图中的下一行 [英] date of previous row to reflect next row in grid view

查看:69
本文介绍了前一行的日期以反映网格视图中的下一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格视图,其中包含开始日期,结束日期和价格.当我插入记录时,应将结束日期的下一个日期分配给新行.

示例
开始日期 结束日期 价格 操作
2011年1月1日2011年1月15日200插入
2011年1月16日插入->当我点击插入"时,此新行应自动显示下一个日期

我该怎么做?

非常感谢您的帮助.

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.

推荐答案

在插入行之前,请使用Identity字段或SNo字段获取上一行的Enddate列.
然后将1天(使用DateAdd()函数)添加到结果值(上一行的Enddate列)中,然后将值插入当前行的Startdate列.
为此编写一个通用函数.
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.


这篇关于前一行的日期以反映网格视图中的下一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆