如何检查gridview中的哪些单元格?

时间:2012-03-06 14:20:58

标签: c# asp.net sql

  

可能重复:
  gridview on edit event , on update event?

我需要这个:

GridView name = GridView
Table name = info
Collumns = Name|SubName|Age|Address|Code
Gridview options : edit,delete,select ( so I can edit values from rows ).

我想知道如何制作一些东西来检查编辑哪个celss。 例如:

If cell1 ( Name ) was edited then : textbox1.text = Name "oldvalue" was changed to "newvalue" SubName=the actual value Age=actual value Address=Actual value etc...
or
If cell1 ( Name ) and cell2 (SubName) were edited then :
textbox1.text = Name "oldvalue" was changed to "newvalue" and SubName "oldvalue" was changed to "newvalue" Age = actual value etc...
or
If cell1 ( Name ) and cell 4(Address) were edited then :
textbox1.text= cell1 ( name )  "value" was changed to "newValue" and cell4 ( address) "oldvalue" was changed to "New Value" SubName = current value Age = Current value etc...

我知道如何获取值,但我不知道如何自动检查,因为我可以使用if条件手动执行此操作,但需要很长时间才能为每个值添加条件。

因此,每次编辑单元格时,它都会将已编辑的单元格和未编辑的单元格添加到文本框中。就像编辑过的历史一样。

0 个答案:

没有答案