Code example:
private void comboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if(some condition)
{
comboBox.Text = "new string"
}
}
My problem is that the comboBox text always shows the selected index's string value and…
How can one programmatically fire the SelectedIndexChanged event of a ListView?
I've intended for the first item in my ListView to automatically become selected after the user completes a certain action. Code already exists within the…
I have written a selectedIndexChanged event for combo on a web page in ASP.NET (C#).
This event is not called. When in debug, the control does not go into the code this event. What can be the reason?
Hi there
What is the correct way of assigning the selected index's value from a listbox to a variable? The user selects an item in a listbox and then the output changes depending on their selection.
I use:
variablename = listbox.text
in the…
I am generating a dropdown list in codebehind and cannot get the selectedindexchanged event to fire automatically. It works fine when put directly into the ASPX page, but I need it to be in the codebehind.
This doesn't work:
var deptList = new…
I have a listbox that needs to be populated by directories.
i have successfully filled the listbox with the Directories but my problem is i can't get the selected item's value. i placed a breakpoint on the SelectedIndexChanged event but my web…
I got a ComboBox with a couple of items. I want to put SelectedIndex of the ComboBox to 0, so when the user starts it, the first item is already selected (as default).
However, doing this (combobox.SelectedIndex = 0;) interferes with my event…
I've got a checkboxlist on my asp.net page. I'm populating it with countries. I've added a "SelectedIndexChanged" event that is supposed to check that if one of the selected countries is Africa, it should make a textbox visible, otherwise…
I'm developing in VB.NET with Visual Studio 2005.
I have a ComboBox (myCombo) on a form that gets populated within the Load method.
I also have handled myCombo.SelectedIndexChanged to change a label on the form.
Edit: The way I added the event…
I'm trying to refresh page when an item of the drop down list is selected.
DropDownList never gets last selected item, it always restores the one which is saved in ViewState. ViewState doesn't want to remember new stuff, it always keeps one and the…
I have this code
private void FrmNovedadMedidas_SelectionChangeCommitted(object sender, EventArgs e)
{
ComboBox c = (ComboBox)sender;
CargarMedidasPorIdTipoMedida(Convert.ToInt16(c.SelectedValue));
…
My selectedindexchanged event is not firing when I select values in my dropdown lists. These dropdown lists are implemented dynamically in the following code. I have tried changing autopostback and enableviewstate settings to no avail. I am using…
I am developing my first asp.net website, my requirement is to refresh DropDownListB at SelectedIndexChanged event of DropDownListA, I have set AutoPostBack="True" for DropDownListA. Now the problem is whole web page gets refreshed, its…
In my ASP.NET 4.0 website, which uses master pages, I've disabled viewstate sitewide in web.config:
and am trying to enable it only when absolutely necessary.
I've run into an issue with a DropDownList control (no…
I'm writing some code to detect toggling of selections in a WindForms ListBox with MultiSelect turned on. Since SelectedIndexChanged only lets me see what is selected after the click, I was looking for a way to detect what was selected before the…