GridView中的绑定下拉列表 [英] Binding dropdown inside a gridview

查看:70
本文介绍了GridView中的绑定下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从表中获取数据并绑定到标签,然后在gridview中下拉菜单,但是我想从表中过滤重复的名称并将相应的日期分配给DDL,这怎么办?否则还有其他选择吗?

I am fetching data from a table and binding to a label and Drop down in a gridview but i want to filter the duplicate names from the table and assign the corresponding dates to the DDL how can do this? or else is there any other alternative?

private DataSet get()
    {
        string sql = "select Id,Name,RunDate from Historytable";
        SqlDataAdapter da=new SqlDataAdapter(sql,con);
        DataSet ds=new DataSet();
        da.Fill(ds);
        return ds;
    }

推荐答案

到目前为止,您在此问题中分享的内容基于:
What you have shared in your question so far, based on that:
string sql = "select DISTINCT Id,Name,RunDate from Historytable";


这篇关于GridView中的绑定下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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