从gridview消除一行 [英] Eliminating A row from a gridview

查看:67
本文介绍了从gridview消除一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以为代码提供一些帮助,该代码将从gridview的输入行中消除一行.例如,IT部门的员工不会显示在员工网格视图中.


-

雇员表由管理员和成本中心经理使用.分配必须从Access调用表并在gridview中查看.现在的问题是;该表具有经理信息的信息.我不希望在该经理表单上显示经理信息,而是希望管理员查看所有员工.我使用SQL方法为经理提供服务,仅查看那些在其管理范围内的员工.现在,我想消除他在查看员工时所显示的信息.对不起,我的英语我希望这是有道理的. RSA student

Can some help with a code that will eliminate a row from the enter rows in the gridview. E.g Employee who is at the IT department not be shown on the employee gridview.


--

The table Employee is used by a Administrator and Cost-Centre managers. The assignment has to call the table from Access and be viewed in a gridview. Now the problem is; the table has the information of the manager''s information. I don''t want the managers infor to be showen on that managers form but the Admin to see all employees. I used the SQL approach for the manager to see only those emplyees that are under his span. Now I want to eliminate his infor to be showen as he view his employees. Sorry for my english I hope it make sense. RSA student

推荐答案

您有很多选择:

1)使用数据库中的视图仅返回想要的行
2)使用接受参数的存储过程来选择所需的行
3)使用来自客户端的动态查询来获取所需的数据
4)在将检索到的数据绑定到网格之前对其进行过滤
5)遍历网格并删除有问题的行

你尝试了什么?您想采取什么方法?

干杯.
You have a number of options:

1) Use a view in the database to only return rows you want
2) Use a stored procedure that accepts a parameter to select the rows you want
3) Use a dynamic query from the client to get the data you want
4) Filter the retrieved data before binding it to the grid
5) Iterate through the grid and remove the offending rows

What have you tried? What approach do you want to take?

Cheers.


您的问题有点含糊.我假设您正在谈论Web,因为您将其称为gridview.您是否需要有关基于其他控件过滤数据的帮助?如果是这样,请尝试阅读其中一些内容:
Your question is a little vague. I''m assuming your talking about web since you call it a gridview. Are you asking for help on filtering data based on other controls? If so try reading some of these:
google results[^]

Or are you saying you don''t want to EVER show the IT Dept in the grid? In which case I would suggest that you just not pull the data in the first place. And to help you with that we''d need more information about what database you are using and how your data is setup in the files. If you use SQL it could be something basic like this:
SELECT * FROM tblEmployee WHERE department<>''IT''

If none of these help, could you please add more information to your question.


很抱歉.

雇员表由管理员和成本中心经理使用.分配必须从Access调用表并在gridview中查看.现在的问题是;该表具有经理信息的信息.我不希望在该经理表单上显示经理信息,而是希望管理员查看所有员工.我使用SQL方法为经理提供服务,仅查看那些在其管理范围内的员工.现在,我想消除他在查看员工时要显示的信息.对不起,我的英语我希望这是有道理的. RSA学生
Sorry for that.

The table Employee is used by a Administrator and Cost-Centre managers. The assignment has to call the table from Access and be viewed in a gridview. Now the problem is; the table has the information of the manager''s information. I don''t want the managers infor to be showen on that managers form but the Admin to see all employees. I used the SQL approach for the manager to see only those emplyees that are under his span. Now I want to eliminate his infor to be showen as he view his employees. Sorry for my english I hope it make sense. RSA student


这篇关于从gridview消除一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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