如何仅在下拉列表中查看所选iterm的列表 [英] how to view only the list of the selected iterm in a dropdownlist

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

问题描述

我有两个下拉列表第一个下拉列表在同一列表上列出了R-12和ECD的成绩列表.第二个下拉列表中列出了R至12年级和ECD-School Uniond的学校.因此,我希望当您选择R-12年级时必须仅显示R-12年级的学校列表,而当您选择ECD时必须显示ECD-Schools的列表

i have two dropdownlist 1st dropdownlist has the list of Grades from R-12 and ECD on the same list. and the 2nd dropdownlist has list of schools for Grades R to 12 and ECD-School Uniond. so i want when you select Grade R-12 must show only the list of school for Grade R-12 and when you select ECD must show the list of ECD-Schools

推荐答案

Add ECD dropdown values in ispostback,then try below code,  

<pre lang="c#">protected void ECDdd_SelectedIndexChanged(object sender, EventArgs e)
    {
try
{

if (ds.Tables[0].Rows.Count > 0)
            {
                ECDschooldd.Items.Clear();
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    
                     ECDschooldd.Items.Add(ds.Tables[0].Rows[i].ItemArray[0].ToString());
  }


}                

  }


请参阅以下链接,这些链接将使您有所了解.
http://forums.asp.net/t/1431726.aspx/1 [ ^ ]
http://msdn.microsoft.com/en-us/library/aa581792.aspx [ ^ ]
Refer the below links which will give you an idea.
http://forums.asp.net/t/1431726.aspx/1[^]
http://msdn.microsoft.com/en-us/library/aa581792.aspx[^]


这篇关于如何仅在下拉列表中查看所选iterm的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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