如何使用c#将Listbox项添加到asp.net的ListView中 [英] how to add Listbox items into ListView in asp.net using c#
本文介绍了如何使用c#将Listbox项添加到asp.net的ListView中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行模式如下
在列表框中如下
候选名称
Ashiwn
Baskar
Chandru
Das
Gopal
Listview(控制)
i想要将上面的Listbox项目显示到Listview中。
我怎样才能在asp.net中使用c#。
问候,
Narasiman p。
解决方案
尝试
http:// cplus .about.com / od / learnc / ss / adv_winforms_3.htm [ ^ ]
http://www.dotnetperls.com/listview [ ^ ]
private void Form1_Load ( object sender,EventArgs e)
{
listBox1.Items.Add( 祝你有个美好的一天);
listBox1.Items.Add( 美好的一天);
listBox1.Items.Add( day);
}
private void listBox1_SelectedIndexChanged(< span class =code-keyword> object sender,EventArgs e)
{
foreach ( object item in listBox1.Items)
{
string km = item.ToString();
listView1.Items.Add(km);
}
}
用于任何查询回复。
Happy Coding☺
jsb
Run mode as follows
In Listbox as follows
Candidatename
Ashiwn
Baskar
Chandru
Das
Gopal
Listview (control)
i want to display the above Listbox items into Listview.
for that how can i do in asp.net using c#.
Regards,
Narasiman p.
解决方案
Try
http://cplus.about.com/od/learnc/ss/adv_winforms_3.htm[^]
http://www.dotnetperls.com/listview[^]
I hope you problem is solved. try this code
private void Form1_Load(object sender, EventArgs e) { listBox1.Items.Add("have a nice day"); listBox1.Items.Add("nice day"); listBox1.Items.Add("day"); } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { foreach (object item in listBox1.Items) { string km = item.ToString(); listView1.Items.Add(km); } }
for any query hit to reply.
Happy Coding ☺
jsb
这篇关于如何使用c#将Listbox项添加到asp.net的ListView中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文