dropdownlis selectedindexchanged event

Posted by Sekar.c under C# on 2/15/2012 | Points: 10 | Views : 1902 | Status : [Member] | Replies : 6
sir,
I'm using 3 dropdown list if I select 1 dropdown list( book name) display relevant author name in the 2 dropdown list. If dropdown list have one value that time selected index changed event not fire how to solve this problem in c#. Please tell me a solution.

Regards
Sekar.c



Responses

Posted by: Pradeepkumar417 on: 2/15/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

You can also add this below code when binding to 1st dropdown list.

DropDownList1.Items.Insert(0,"--Select Book name--");




Thanks & Regards,
Software Engineer,
Pradeep Kumar

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

Posted by: Sksamantaray on: 2/15/2012 [Member] Silver | Points: 25

Up
0
Down
1.when you fill dropdownlist1 in Page_Load , check the no of items , if 1 then then and there call the fill method of 2nd dropdownlist
2.or
if you call stored procedure to fill the first dropdownlist then in the stored procedure add a valuefield value=0 and textfield value='Select an Item'


Thanks,
Sanjay

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

Posted by: Sekar.c on: 2/15/2012 [Member] Starter | Points: 25

Up
0
Down
Sir,
I'm getting book name from db that time display one value in drop down list so ddl selected index change event not fire. What I do sir


Regards
Sekar.c

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

Posted by: Pradeepkumar417 on: 2/15/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

After binding data from db to dropdownlist,later you have to write below code. then event will fire.

DropDownList1.Items.Insert(0,"--Select Book name--");

Thanks & Regards,
Software Engineer,
Pradeep Kumar

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

Posted by: Sksamantaray on: 2/15/2012 [Member] Silver | Points: 25

Up
0
Down
Hi , can use following procedure

create procedure [dbo].[getBooksComboData]      

as
begin

select BookID,BookName into #temp from BooksMaster
insert into #temp
select BookID=0',BookName='-Select-'


select * from #temp order by BookID
drop table #temp

end


let me know if it works for you.

Thanks,
Sanjay

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

Posted by: Sekar.c on: 2/16/2012 [Member] Starter | Points: 25

Up
0
Down
sir,
Thanks for your information; I got the solution for ddl selected index change.

Thanks,
sekar

Regards
Sekar.c

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

Login to post response