如何使用2形式对datagridview中的数据进行排序 [英] how to sort data in datagridview using 2 form
本文介绍了如何使用2形式对datagridview中的数据进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新学习.net的人,请帮助我.我有带文本框的form1,键入从另一表单datagridview搜索的文本,并且datagridview数据显示在form1文本框中,搜索/排序/过滤器是使用c#的字母键入过程.
I am new to learn .net please someone help me. i have form1 with textbox,type some text that search from another forms datagridview & that datagridview data shows in form1 textbox,the search/sort/filtter is alphabetical typeing process using c#.
推荐答案
在另一个form2的属性选项卡中,必须将datagridview的修饰符更改为public,而不是必须将form2类型的对象添加到form1:
或者也许从主类中必须添加from2对象以供使用
in the property tab of the another form2 you must change the modifier of the datagridview to public, than you must add an object of type form2 to form1:
or maybe from the main class you must add the from2 object an use it
(form2 f = new form() use f.show() and f.hide() or anything)
class form1:form //....
{
form2 F = new form2();
//...
"in the event" textbox.text_changed(...)
{
...use you search code using F.datagridview2. ...( datagridview2 must be public...)
}
}
这篇关于如何使用2形式对datagridview中的数据进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文