先说1.0的DataGrid,添加DataGrid的ItemDataBound事件并添加以下类似代码
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
注意: " SName "确认中要添加确认数据的列名,此例中用的是ImageButton其它按钮与此类似。
再说2.0的GridView,添加GridView的RowDataBound事件并添加以下类似代码
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
注意:Cells[10]为删除按钮所在的列,删除按钮要在一个单独的列中,可以转化为模板列。
最后说DetailsView,直接利用.Net控件的OnClientClick如下:
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://lei123.cnblogs.com/Images/OutliningIndicators/None.gif)
好啦,到此结束。