如何使用多个控件进行搜索,我想在gridview中显示数据 [英] how to search using multiple controls and i want to display data in gridview

查看:87
本文介绍了如何使用多个控件进行搜索,我想在gridview中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨........

我在该应用程序中有一个应用程序,我有下拉列表,文本框等...

我想搜索gridview数据.当我输入texboxes文本并同时选择下拉列表时,当我单击搜索按钮时一次搜索两个r控件.


我正在使用MySql数据库.


我该如何搜索,请给我任何想法.

Hi........

I have one application in that app i have dropdownlists,text boxes,...etc

i want to search in gridview data.when i entered texboxes text and at the same time i selected dropdownlist then at a time search for two r more controls when i click search button.


i m using MySql database.


how i can search please give me any idea.

推荐答案

HI,

每个网格都有一个RowCommand事件.在RowCommand事件中找到控件.


Every grid have a RowCommand event. In RowCommand event you find the controls.


尝试类似的方法:
Try something like:
//Something similar to this
protected void Gridview_RowDataBound(object sender, DataGridItemEventArgs e)
{
     Textbox tbx = (TextBox)e.Row.FindControl("IWantedToGetThisTextbox");
     if (tbx != null)
     {
         // you got tbx.Text  value here. Do any calculation desired.
        
     }
}


这篇关于如何使用多个控件进行搜索,我想在gridview中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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