Dropdown box with condition on Gridview in C#?

Posted by Raghuldrag under ASP.NET on 4/25/2013 | Points: 10 | Views : 1192 | Status : [Member] | Replies : 1
Hai Friends,

I am creating One site i need the details Travel details of sales ppl.
i ve Two column like "Mode of Travel"(drop down box) 4 values there if choose any one these another drop show seat type automatically.
1)Train
2)Bus
3)auto
4)Air

"Seat Type"(drop Down)
Train====2nd AC
3rd AC
SL
Semi Sl
Bus=====SL
Semi SL

Air=====Economy
Business

Auto=====Auto

I make code for c#:


protected void DDL_ModeOfTravel_SelectedIndexChanged(object sender, EventArgs e)
{
DDL_SeatType.Items.Clear();
DDL_SeatType.Items.Add("-select-");
if (DDL_ModeOfTravel.SelectedItem.Text == "Train")
{
DDL_SeatType.Items.Add("II AC");
DDL_SeatType.Items.Add("III AC");
DDL_SeatType.Items.Add("Sleeper Class");
DDL_SeatType.Items.Add("2nd SL");
}
else if (DDL_ModeOfTravel.SelectedItem.Text == "Air")
{
DDL_SeatType.Items.Add("Business");
DDL_SeatType.Items.Add("Economy");
}
else if (DDL_ModeOfTravel.SelectedItem.Text == "Car")
{
DDL_SeatType.Items.Add("Car");
}
else if (DDL_ModeOfTravel.SelectedItem.Text == "Bus")
{
DDL_SeatType.Items.Add("Semi Sleeper");
DDL_SeatType.Items.Add("Sleeper Class");
}
else if (DDL_ModeOfTravel.SelectedItem.Text == "Auto")
{
DDL_SeatType.Items.Add("Auto");
}
else if (DDL_ModeOfTravel.SelectedItem.Text == "Local")
{
DDL_SeatType.Items.Add("Local Travel");
}
else if (DDL_ModeOfTravel.SelectedItem.Text == "Mode of Travel")
{
DDL_SeatType.Items.Add("Seat Type");
}
}
its working fine.

after adding the dropdown ll shown my grid view. when I m trying to edit the drop down not wroking the condition .
How to do that?




Responses

Posted by: aswinialuri-19361 on: 4/25/2013 [Member] Starter | Points: 25

Up
0
Down
hi Raghu ,

Please send your source code
in sorce code you will mention edit item template

ThankYou

Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

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

Login to post response