datagridview控件容易过滤? [英] datagridview control easy filtering ?

查看:60
本文介绍了datagridview控件容易过滤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置我的datagridview,以便第一行留空

并将其用作datagridview的过滤字段。到目前为止,我使用2个datagridview使用2个datagridview,其中一个带有一个标题排序,一行用于

过滤,而较低的一个没有标题用于数据。只有它非常非常难以工作这种方式导致例如当用户点击上面的数据格栅视图上的排序

我需要对下部网格进行排序等等

用户更改上面datagridview列的大小我需要更改

相应的下限。关于如何做到这一点的任何建议??

I''m trying to set my datagridview so that the first row will be left blank
and to use it as a filtering filed for the datagridview. Until now I was
using 2 datagridview the upper one with a header that sort and one row for
filtering and the lower one with no header for the data. Only it is very
complicated to work this way cause for example when the user click on sort
on the upper datagridview I need to sort the lower grid and so on when the
user change the size of column on the upper datagridview I need to change
the lower one accordingly. Any advice on how to do this ??

推荐答案

嗨牛奶果酱,


欢迎来到MSDN新闻组。

关于在DataGridView / DataGrid中显示额外的过滤行

问题,我们将看看并做一些研究并将更新为

尽快。感谢您的理解。


Steven Cheng

Microsoft在线支持


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)


------------ --------

|来自:牛奶果酱 < mi ****** @ newsgroups.nospam>

|主题:datagridview控件易于过滤?

|日期:2005年8月27日星期六12:48:28 +0200

|行数:10

| X-Priority:3

| X-MSMail-Priority:正常

| X-Newsreader:Microsoft Outlook Express 6.00.2900.2527

| X-MimeOLE:微软MimeOLE制作V6.00.2900.2527

| X-RFC2646:格式=流动;原价

|消息ID:< #t ************* @ tk2msftngp13.phx.gbl>

|新闻组:microsoft.public.dotnet.languages.csharp

| NNTP-Posting-Host:hfa62-0-138-26.bb.netvision.net.il 62.0.138.26

|路径:TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl

|外翻:TK2MSFTNGXA01.phx.gbl

microsoft.public.dotnet.languages.csharp:118718

| X-Tomcat-NG:microsoft.public.dotnet.languages.csharp

|

|我正在尝试设置我的datagridview,以便第一行将被留下

空白

|并将其用作datagridview的过滤字段。到现在为止我是

|使用2 datagridview上面的一个带有一个排序和一行的标题

for

|过滤和较低的一个没有标题的数据。只有它非常好

|以这种方式工作很复杂导致例如当用户点击

排序

|在datagridview上面我需要对下面的网格进行排序等等



|用户更改上部datagridview列的大小我需要更改

|较低的一个。关于如何做的任何建议??

|

|

|

Hi Milk-jam,

Welcome to MSDN newsgroup.
Regarding on the displaying additional filter row in DataGridView/DataGrid
question, we''ll have a look and do some research and will update you as
soon as possible. Thanks for your understanding.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "milk-jam" <mi******@newsgroups.nospam>
| Subject: datagridview control easy filtering ?
| Date: Sat, 27 Aug 2005 12:48:28 +0200
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#t*************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: hfa62-0-138-26.bb.netvision.net.il 62.0.138.26
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.languages.csharp:118718
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I''m trying to set my datagridview so that the first row will be left
blank
| and to use it as a filtering filed for the datagridview. Until now I was
| using 2 datagridview the upper one with a header that sort and one row
for
| filtering and the lower one with no header for the data. Only it is very
| complicated to work this way cause for example when the user click on
sort
| on the upper datagridview I need to sort the lower grid and so on when
the
| user change the size of column on the upper datagridview I need to change
| the lower one accordingly. Any advice on how to do this ??
|
|
|


嗨牛奶果酱,


首先,我想确认一下我对你的问题的理解。从

您的描述中,我了解您需要根据较高的数据排序对较低的datagridview

控件进行排序。如果有任何

的误解,请随时告诉我。


在这种情况下,您可以尝试处理DataGridView.Sorted事件。在这个

事件中,您可以使用DataGridView.SortedColumn获取排序列,然后

然后相应地设置较低的DataGridView的排序列。


Kevin Yu

=======

此帖子已提供按原样没有保证,并且没有赋予

权利。

Hi milk-jam,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to sort the lower datagridview
control according the the upper one''s sort. If there is any
misunderstanding, please feel free to let me know.

In this case, you can try to handle the DataGridView.Sorted event. In this
event, you can get the sorted column using DataGridView.SortedColumn, and
then set the lower DataGridView''s sorted column accordingly.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Nop,这不是我想要实现的,这就是我在

时刻做的事情。

我想要实现的是使用1 datagridview并跳过第一行

当我填充datagridview,我想使用第一行进行

过滤。因为我找不到这样做的方法我使用了2 datagridview

但是我的解决方案使evrything变得复杂,我想找到一种方法来做1

datagridview。


Kevin Yu [MSFT]" <,V - **** @ online.microsoft.com>写在消息

新闻:ir ************* @ TK2MSFTNGXA01.phx.gbl ...
Nop, thats not what im trying to achive at all, thats what im doing at the
moment.
What im trying to achive is to use 1 datagridview and to skip the first row
when i populate the datagridview and i wanna use the first row for
filtering. because i couldnot find the way to do it i used 2 datagridview
but my solution complicate evrything and i wanna find a way to do it with 1
datagridview.

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:ir*************@TK2MSFTNGXA01.phx.gbl...
嗨牛奶果酱,

首先,我想确认一下我对你的问题的理解。从您的描述中,我了解到您需要根据上层的排序对较低的数据视图进行排序。如果有任何误解,请随时告诉我。

在这种情况下,您可以尝试处理DataGridView.Sorted事件。在这个
事件中,您可以使用DataGridView.SortedColumn获取已排序的列,然后
然后相应地设置较低的DataGridView的已排序列。

Kevin Yu
=======
此帖子是按原样提供的没有保证,也没有赋予
权利。
Hi milk-jam,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to sort the lower
datagridview
control according the the upper one''s sort. If there is any
misunderstanding, please feel free to let me know.

In this case, you can try to handle the DataGridView.Sorted event. In this
event, you can get the sorted column using DataGridView.SortedColumn, and
then set the lower DataGridView''s sorted column accordingly.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."



这篇关于datagridview控件容易过滤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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