deleting item form drop down

Posted by Snvrk1985 under ASP.NET on 6/28/2012 | Points: 10 | Views : 861 | Status : [Member] | Replies : 5
I have basically class drop down. under class drop down change event in am binding data to subject dropdown.
i want to delete the item which is selected from subject dropdown next cahnge event of class drop down




Responses

Posted by: Ajay.Kalol on: 6/28/2012 [Member] Starter | Points: 25

Up
0
Down
You have to implement Data Manipulation operation on Subject DDL selectindexchanged event

Ajay
ajaypatelfromsanthal.blogspot.in

Snvrk1985, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 6/28/2012 [Member] Starter | Points: 25

Up
0
Down


you could grab the first element and store it in a local variable, then remove all items (Clear method) and finally add the first element again.



<script type="text/javascript">
function AddItem(Text,Value)
{
// Create an Option object for adding item to dropdownlist
var opt = document.createElement("option");

// Add an Option object to Drop Down/List Box
document.getElementById("DropDownList").options.add(opt);
// Assign text and value to Option object
opt.text = Text;
opt.value = Value;

}<script />


Premalatha
Software Engineer

Snvrk1985, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jeffie on: 6/29/2012 [Member] Starter | Points: 25

Up
0
Down
You can store the selected subject in a viewstate or a hidden variable.. for the ext changed event
you can delete that value from the dropdown if the value is not null

Thanks
http://www.alacraft.com.au/

Snvrk1985, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 7/10/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Refer this URL

http://www.plus2net.com/javascript_tutorial/list-remove.php




Snvrk1985, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

refer this link

http://forums.asp.net/t/1060744.aspx/1

R D Patel

Snvrk1985, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response