如何在一个gridview中随机删除,更新和编辑两个表 [英] how to delete, update and edit two tables in one gridview randomly

查看:63
本文介绍了如何在一个gridview中随机删除,更新和编辑两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库中有两个表.
我有两个单选按钮和一个带有设计的编辑,删除和更新选项的gridview ..
在每次单击单选按钮时,我必须在gridview中显示该表,并且应该可以对其进行编辑,删除和更新.

I have two tables in database..
I have two radio buttons and a gridview with edit, delete and update options with my design ..
In each radio button click, I have to display the table in the gridview and should possible to edit, delete and update.

推荐答案

如果我没有记错,则需要根据单选按钮单击将表格加载到GridView上.

例如-
如果您有两个单选按钮,例如-
.学生
.老师.

你想说,
-如果您选择学生"单选按钮,则学生"表将被加载到
GridView,您就可以编辑,删除和更新.
-如果您选择单选按钮教师",则教师"表将被加载到
GridView,您就可以编辑,删除和更新.

要实现此目标
-将单选按钮包含在一个单选按钮列表中.
-然后,必须将GridView绑定到由单选按钮列表的事件"OnSelectedIndexChanged"调用的函数中,该函数在选择单选按钮列表的任何值时都会调用.

现在,您需要检查单选按钮列表中选定的项目,并相应地绑定所需的表.

请参阅此博客 [
If I am not wrong, you want to load the tables on GridView according to the radio button click.

For Example -
If you have two radio buttons like -
. Students
. Teachers.

You want to say,
- if you select radio button "Students", then "Students" table gets loaded in
GridView and you can be able to edit, delete and update.
- if you select radio button "Teachers", then "Teachers" table gets loaded in
GridView and you can be able to edit, delete and update.

To achieve this
- Include the radio buttons inside one radio button list.
- Then you have to bind the GridView in a function called by the event "OnSelectedIndexChanged" of Radio Button List, which is called when we select any value of Radio button List.

Now you need to check the selected Item of the radio button list and bind the required table accordingly.

Refer this blog[^] to know thw usage.


这篇关于如何在一个gridview中随机删除,更新和编辑两个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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