C#Win App中的DataGridView中的AutoFilter [英] AutoFilter in DataGridView in C# Win App

查看:530
本文介绍了C#Win App中的DataGridView中的AutoFilter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Team,



我在Windows窗体上有DataGridView,它会在Button Click事件上刷新。

我想添加过滤功能到这个GridView。

我从

Hello Team,

I have DataGridView on Windows Form which get refreshed on Button Click Event.
I want to add Filter Capability to this GridView.
I have downloaded

DataGridViewAutoFilter

.dll .aspx?id = 23459> http://www.microsoft.com/en-us/download/details.aspx?id=23459 [ ^ ]



但是如何将列类型更改为

.dll from http://www.microsoft.com/en-us/download/details.aspx?id=23459[^]

But How do change column type to

DataGridViewAutoFilterTextBoxColumn

而不是默认

DataGridViewTextBoxColumn





我在Button Click上有以下代码。

.

I have Below code on Button Click.

private void button1_Click(object sender, EventArgs e)
        {
            SqlConString = "Data Source=MyMachin-PC\\;Initial Catalog=MyDataBase;Persist Security Info=True;User ID=sa;Password=123456";
            MySqlCon.ConnectionString = SqlConString;
            MySqlCon.Open();
            SqlDataAdapter da = new SqlDataAdapter("Select * from Activity_Master", MySqlCon);
            DataTable dt = new DataTable();
            da.Fill(dt);
            bs.DataSource = dt;
            dataGridView1.DataSource = bs;            
        }



请帮助!!!!!


Please help!!!!!

推荐答案

我已添加参考。但我不知道如何使用它?如何设置过滤器的长度?或者我如何在筛选器列表上设置复选框?请帮帮我
Hi, I already add reference. but I do not know how to use it? How I can set lenghth of filter? Or how I can set checkboxes on filter list? Please help me


您好,



以编程方式将AutoFilter功能添加到您的应用程序



在Windows应用程序项目中,添加对DataGridViewAutoFilter.dll程序集的引用。所以从以下链接下载这个dll:



http://www.microsoft.com/en-us/download/details.aspx?id=23459 [ ^ ]



工作就是我的获取更多信息的经验:



http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/53270637-9b01-46e2-9966-a2d9e03e8844 [ ^ ]





使用DataGridViewAutoFilter;





问候,

Saurabh
Hi,

To add the AutoFilter feature to your application programmatically

In your Windows Application project, add a reference to the "DataGridViewAutoFilter.dll" assembly. So download this dll from following link:

http://www.microsoft.com/en-us/download/details.aspx?id=23459[^]

It is working that's my experience for more information :

http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/53270637-9b01-46e2-9966-a2d9e03e8844[^]


using DataGridViewAutoFilter;


Regards,
Saurabh


这篇关于C#Win App中的DataGridView中的AutoFilter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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