填写formview插入项目模板的下拉列表时出现问题 [英] Problem with filling the dropdownlist of a formview insert item template

查看:92
本文介绍了填写formview插入项目模板的下拉列表时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在使用C#ASP.NET进行项目.在插入项目模板的formview1处,我有一个控件jobTitleDropdownlist.我通过某种方法编辑过项目的地方.

Hello,

I am doing my project using C# ASP.NET. At the formview1 at the insert item template I have a control jobTitleDropdownlist. Where I have edited it''s item by a method.

DropDownList ddl = (DropDownList)FormView1.FindControl("jobTitleDropDownList");
ddl.Items.Clear();
ddl.Items.AddRange(modelObj.getMiscStatusItem("Job Title"));



在这里modelObj.getMiscStatusItem("Job Title")返回一个列表项的数组.我把所有物品都放到了我的下拉列表中.
但是在插入后,供应商表仅插入jobTitle下拉列表"SalesManager"的第一个元素.
我应该在这里改变什么.

有人可以给我另一个好主意吗?



Here modelObj.getMiscStatusItem("Job Title") returns an array of a list item. I got all the item to my dropdown list.
But after insertion the suppliers table is only inserting with the first element of the jobTitle dropdownlist ''SalesManager''.
What should I change here.

Can anybody give me another good idea to do this?

推荐答案

我认为您打算在上表"中存储职位",如果正确的话! />
使用ddl的SelectedValue属性插入您选择的职位".
I think ur going to store "job title " in suplier table , if am right !!!

use SelectedValue property of ddl to insert ur selected "job title".


这篇关于填写formview插入项目模板的下拉列表时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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