本文介绍了在下拉列表中被另一个过滤掉的findbytext?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我有两个下拉列表,一个列表是根据另一个列表过滤的,它的工作很好,我想按文本搜索两个下拉列表,所以我使用以下代码:
Hi every body , I have two drop down list one is filtrated based on the other its work fine , i want to search in my two dropdowns by text so im using this code :
ddlsociete.SelectedIndex = ddlsociete.Items.IndexOf(ddlsociete.Items.FindByText("sapmleofSociete"));
ddlba.SelectedIndex = ddlba.Items.IndexOf(ddlba.Items.FindByText(("sampleOFba")));
ddlba是根据ddlsoc的selecteditem筛选的,当我运行以下代码时,我的ddlsoc的selectedindex带有"sampleofsociete",但ddlba始终为空?我知道,因为它的药网有任何物品,所以如何获取
ddlba is filtred based on selecteditem of ddlsoc , when i run the code below i have ddlsoc with selectedindex with "sampleofsociete" but ddlba its always empty ? i understand because it dosenet have any items so how to get
selected item from selected index ??
推荐答案
ddlsociete.SelectedIndex = ddlsociete.Items.IndexOf(ddlsociete.Items.FindByText("sapmleofSociete"));
Fillddlba();
ddlba.SelectedIndex = ddlba.Items.IndexOf(ddlba.Items.FindByText(("sampleOFba")));
void Fillddlba()
{
// write here code to fill items on second dropdown base on selected value of first dropdown
}
希望对您有用,否则让我知道.
hope this will work for you otherwise let me know.
这篇关于在下拉列表中被另一个过滤掉的findbytext?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!