下拉选择的索引以填充列表框 [英] Dropdown selected index to populate a listbox

查看:95
本文介绍了下拉选择的索引以填充列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我的列表框位于gridview内,而下拉列表位于gridview之外,我现在想知道如何基于在dropdownlistbox plz上更改的选定索引加载列表框,以帮助我.....提前感谢

Hi all,my listbox which inside the gridview and my dropdown is outside the gridview now i want to know how to load the listbox based on the selected index changed on the dropdownlistbox plz help me .....Thanx in advance

推荐答案

请与您实际使用网格投标数据的代码段共享.
您是否尝试过调试?
您是否可以从数据库中获取数据?

有3个简单的步骤.
1.在"DropDown List SelectedIndex Changed"上,采用选定的值
2.根据为下拉列表选择的值来调用后端数据库.将数据保存在数据集中或任何需要的地方.
3.将其与Grid视图绑定.
Please share your code snippets where you actually biding data with grid.
Have you tried debugging?
Are you able to fetch data from Database?

There are 3 simple step.
1. On DropDown List SelectedIndex Changed, take the selected values
2. Call you back end database based on the selected value for the dropdown list. Save the data in a dataset or where ever you want.
3. Bind it with Grid view.


您可以通过itemtemplate中的控件ID(列表框)访问列表框.

C#代码:

ListBox myListBox =(ListBox)gridviewname.rows.FindControl("ListBox1");

希望这会有所帮助.
谢谢
You can access the listbox through id of the control(listbox) from itemtemplate.

c# code:

ListBox myListBox = (ListBox)gridviewname.rows.FindControl("ListBox1");

hope this will help.
Thanks,


这篇关于下拉选择的索引以填充列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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