Click here to Skip to main content
15,903,012 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Set Font color Pin
netJP12L2-Dec-08 11:44
netJP12L2-Dec-08 11:44 
GeneralRe: Set Font color Pin
Christian Graus2-Dec-08 12:15
protectorChristian Graus2-Dec-08 12:15 
GeneralRe: Set Font color Pin
netJP12L3-Dec-08 4:11
netJP12L3-Dec-08 4:11 
QuestionZero index won't fire change SelectedIndexChanged event Pin
Glacier63272-Dec-08 4:14
Glacier63272-Dec-08 4:14 
Hello,

I have a DropDownList that is used above a gridview to filter the results of the gridview when the user selects a "package" in the DDL.

I am programitically adding a zero index item "All Packages" to the list on page load.

Selection of any item in the list fires the SelectedIndexChanged event and successfully runs the code need to filter the results.

However when I select the zero index "All Packages" item, SelectedIndexChanged event does not fire.

Any help is greatly appreciated.

VS 2008 C#
Inside an Update Panel

FrontEnd Code:
<asp:dropdownlist id="ddlPackageSelect" visible="true" runat="server" autopostback="true" xmlns:asp="#unknown"></asp:dropdownlist>


Backend Code:

private void PopulatePackageDropDown()
		{
			using (StoredProcedure sp = new StoredProcedure("GetPackageDropDown", "celebro"))
			{
				try
				{
					DataSet gh = sp.GetDataSet();

					ddlPackageSelect.DataSource = gh;
					ddlPackageSelect.DataTextField = "Name";
					ddlPackageSelect.DataValueField = "Id";
					ddlPackageSelect.DataBind();


					if (sp.RC == (int)ReturnCode.SUCCESS)
					{
						ddlPackageSelect.Items.Insert(0, new ListItem("All Packages", "0"));
					}
				}
				catch (Exception e)
				{
					lblMessage.Text = e.Message;
				}
			}
		}


private void InitializeComponent()
{			
this.ddlPackageSelect.SelectedIndexChanged += new EventHandler(ddlPackageSelect_SelectedIndexChanged);			
}	


protected void ddlPackageSelect_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (ddlPackageSelect.SelectedIndex == 0)
			{
				BuildGlobalStylesheetList();
			}
			else
			{
				BuildPackageStylesheetList(int.Parse(ddlPackageSelect.SelectedValue.ToString()));
			}
			StylesheetDetail.Visible = false;

		}

AnswerRe: Zero index won't fire change SelectedIndexChanged event -- Fixed Pin
Glacier63272-Dec-08 6:40
Glacier63272-Dec-08 6:40 
QuestionDynamacially populate a web treeviewcontrol Pin
vkumar092-Dec-08 2:30
vkumar092-Dec-08 2:30 
AnswerRe: Dynamacially populate a web treeviewcontrol Pin
Paddy Boyd2-Dec-08 4:27
Paddy Boyd2-Dec-08 4:27 
Questionsend excel attachment the second time Pin
samerh2-Dec-08 2:15
samerh2-Dec-08 2:15 
AnswerRe: send excel attachment the second time Pin
Paddy Boyd2-Dec-08 4:25
Paddy Boyd2-Dec-08 4:25 
GeneralRe: send excel attachment the second time Pin
samerh2-Dec-08 19:14
samerh2-Dec-08 19:14 
QuestionCustom Properties Pin
Dirso2-Dec-08 1:56
Dirso2-Dec-08 1:56 
AnswerRe: Custom Properties Pin
Dirso2-Dec-08 2:51
Dirso2-Dec-08 2:51 
GeneralRe: Custom Properties Pin
Dirso2-Dec-08 6:52
Dirso2-Dec-08 6:52 
Questionhow to Align Code in aspx file?? Pin
mr_muskurahat2-Dec-08 1:23
mr_muskurahat2-Dec-08 1:23 
AnswerRe: how to Align Code in aspx file?? Pin
Ashfield2-Dec-08 1:51
Ashfield2-Dec-08 1:51 
AnswerRe: how to Align Code in aspx file?? Pin
firozu2-Dec-08 3:02
firozu2-Dec-08 3:02 
AnswerRe: how to Align Code in aspx file?? Pin
Glacier63272-Dec-08 4:50
Glacier63272-Dec-08 4:50 
AnswerRe: how to Align Code in aspx file?? Pin
Samer Aburabie2-Dec-08 11:25
Samer Aburabie2-Dec-08 11:25 
Questiondropdownlist Pin
Kissy162-Dec-08 0:40
Kissy162-Dec-08 0:40 
AnswerRe: dropdownlist Pin
Brij2-Dec-08 2:37
mentorBrij2-Dec-08 2:37 
QuestionControl radiobutton selection with keyboard down/up arrow Pin
Vinay Dornala1-Dec-08 23:54
Vinay Dornala1-Dec-08 23:54 
AnswerRe: Control radiobutton selection with keyboard down/up arrow Pin
Christian Graus1-Dec-08 23:58
protectorChristian Graus1-Dec-08 23:58 
Question[Message Deleted] Pin
Vinay Babu1-Dec-08 23:23
Vinay Babu1-Dec-08 23:23 
AnswerRe: code to implement WS-Transaction in WCF Pin
Abhijit Jana2-Dec-08 0:02
professionalAbhijit Jana2-Dec-08 0:02 
QuestionMerging Xml in word document Pin
papy-boom1-Dec-08 22:46
papy-boom1-Dec-08 22:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.