在下拉列表中输入新的textvalue [英] Enter new textvalue in dropdownlist

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

问题描述


我已经选择了dropdownlist,并且已经绑定了它,我想输入新的文本值,而不是要输入的绑定数据.
并将新的文本值插入数据库.还有一件事我带了一个RadioButtonSist.当我们在下拉列表中输入新文本时,应选择单选按钮.
请帮助我.

Hi,
I have taken dropdownlist and I have binded this and I want enter new text value not binded data should enter.
and new text value should be insert into database. and one more thing i have taken one RadioButtonSist . when we enter new text in dropdownlist then radiobutton should be selected .
plz help me .

推荐答案

您需要对RadComboBox使用AllowCustomText="true"属性.这将允许用户在RadComboBox中输入自定义文本.喜欢:
You need to use AllowCustomText="true" property to the RadComboBox. This will allow the user to enter custom text into RadComboBox. Like:
<telerik:radcombobox id="ddlProposerName" runat="server" xmlns:telerik="#unknown">
                    EmptyMessage="Select" AllowCustomText="false">
</telerik:radcombobox>


在代码中,请使用以下代码:


In code, use this:

string s = ddlProposerName.Text;




祝一切顺利.
--Amit




All the best.
--Amit


然后您拥有以下控件:-
1)一个单选按钮
2)一个下拉列表
3)一个文本框
4)一键

逻辑应为:-

(i)选择单选按钮,提供所需的字段验证器或放置一些验证逻辑,以便用户在提交前必须选择单选按钮.

(ii)dropdownlist更新,当用户在文本框中输入一些文本时,将textbox的值与dropdownlist值进行比较.如果该值存在于下拉列表中,则避免在数据库中进行更新并向用户发送消息.如果这是新值,则第1次将该值插入数据库,然后再次从数据库中获取数据g并绑定到下拉列表.

有趣的编码,亲爱的......
Then u have these controls :-
1) one radio button
2) one dropdownlist
3) one textbox
4) one button

logic should be:-

(i) for selecting radio button, give required field validator or put some validation logic so that user has to select radio button before submiting.

(ii) dropdownlist updation, when user inputs some text in textbox compare textbox value to dropdownlist value. If that value is present in dropdownlist then avoid to update in database and give a message to user. If that is new value then 1st insert that value to database and then fetch data from database againg and bind to the dropdownlist.

Fun coding dear....




检查以下链接.

http://www.telerik.com/community/论坛/aspnet-ajax/combobox/add-new-records-within-radcombobox.aspx [


check the below link.

http://www.telerik.com/community/forums/aspnet-ajax/combobox/add-new-records-within-radcombobox.aspx[^]

hope it helps.


这篇关于在下拉列表中输入新的textvalue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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