根据gridview操作设置DB列值 [英] Setting DB column value as per gridview actions

查看:64
本文介绍了根据gridview操作设置DB列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个主要的girdview,有两个colums作为复选框。在第二个gridview(子gridview)中,显示两列中主gridview的所有未检查行。



现在,我在第二个gridview中有一个Approve按钮页。并且在DB表中有一个名为approve的列,其中正在加载主网格。



如果单击批准按钮,则此列的值必须为对于子网格中的所有行设置为Y,下次加载主网格时,如果批准列的值为Y,则相应的行应为禁用或着色。



我该如何处理?谢谢。

解决方案

你好,

我们走了,



1首先为每个网格视图制作两个数据表

2.将行/数据填充到数据表中,无论你需要什么。

3.并且在任何特定操作时标记为需要更改数据表

4.一旦获得数据表中所需的行,现在分别在网格数据源上分配它们。

5.绑定网格后,写入读取网格记录及其值的循环,并根据您的需要更改控件的颜色和属性。



希望对您有用...

Hi,

I have one main girdview, with two colums as checkbox. In the second gridview(child gridview), all the unchecked rows from main gridview of both the columns are displayed.

Now,I have a Approve button in the second gridview page. And there is one column named approve in the DB table from where main grid is being loaded.

If the Approve button is clicked, the value of this column need to be set as 'Y' for all the rows in the child grid and next time when the main grid loads, if the value of Approve Column is 'Y', corresponding row should come as disabled or colored.

How should I proceed with that? Thanks.

解决方案

Hello,
Here we go,

1. First make two data tables for each grid view
2. Populate rows/data into data table what ever you required.
3. and at the time of any particular operation marked that required changes into data tables
4. Once you get required rows in data tables now assign them on grid data source respectively.
5. after binding of grid, write a loop to read grid records & their values and based on your need change the colours and properties of the controls.

Hope will work for you ...


这篇关于根据gridview操作设置DB列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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