Menu
  • HOME
  • TAGS

ASP.NET Select item from ListView not being called

c#,asp.net,listview,selectedindexchanged

You need to set AutoPostBack property to true <asp:ListView ID="LeftsideMessageList" runat="server" AutoPostBack="true" ItemPlaceholderID="itemPlaceHolder1" DataKeyNames="id" OnSelectedIndexChanged="LeftsideMessageList_SelectedIndexChanged" > ...

ComboBox.SelectedIndexChanged does not fire when programatically changing the index

c#,winforms,combobox,selectedindexchanged

The event handler is just a method so you can just call it. If your handler is named ComboBox2_SelectedIndexChanged you can do: ... else {//this should be action that is initiated, which should definitely change the selected index ComboBox2.SelectedIndex = -1; ComboBox2_SelectedIndexChanged(ComboBox2, new EventArgs()); } ... ...

SelectedIndexChanged event also firing for wrong datagridviewcomboboxcell

c#,datagridview,selectedindexchanged,datagridviewcomboboxcell

This is expected as the editing control type is cached and if the types are the same, then the control is reused. In your case the same ComboBox control is reused in both the DataGridViewComboBoxColumn. Thatswhy it is fired for the second DataGridViewComboBoxColumn. See the Do ComboBox controls get reused...

Dropdown's SelectedIndexChanged event is not fired when its populated from client side

javascript,c#,jquery,asp.net,selectedindexchanged

The short answer is don't do this. This is not how ASP.NET Server Controls were designed to work and you will end up creating a Rube Goldburg making it work. Details below: ASP.NET has a security feature (Event Validation) built in to prevent data being posted that was not present...

remove all collection items in collection when selected index of another collection changes

vb.net,collections,items,selectedindexchanged

Answer from NDJ, posted as comment. why not just use cboxCategory.Items.Clear() ? if you really want to do this in a while loop removing them one by one, don't rely on an exception (they are expensive) - it'd be better to While cboxCategory.Items.Count > 0 – NDJ Dec 17 '14...

RadListView SelectedIndexChanged is firing each time a new item is added

c#,selectedindexchanged,radlistview

Instead of adding them one at a time, you can bind directly to an IEnumerable using the DataSource property.

SelectedIndexChanged event does not get fired on Index change

asp.net,vb.net,cascadingdropdown,selectedindexchanged

The compiler doesn't know that you have a method to do something when this event occurs. You can invoke this method by either defining it in the aspx markup: <asp:dropdownlist id="ddlMerchantCity" runat="server" OnSelectedIndexChanged="ddlMerchantCity_SelectedIndexChanged" AutoPostBack="true"></asp:dropdownlist> Or you can set in your code behind: AddHandler ddlMerchantCity.SelectedIndexChanged, AddressOf Me.ddlMerchantcity_SelectedIndexChanged I'd rather do it...

Using Index in If statement for SlecetedIndexChanged Event VB.NET

vb.net,if-statement,selectedindexchanged

The problem was that I needed to set the AutoPostBack property for the dropdown list to True.

Index change event C#

c#,listbox,selectedindexchanged

You can rewrite your IndexChanged handlers in this manner (same for all handlers): private bool _IgnoreIndexChange; private void cboxEvent_IndexChange(object sender, EventArgs e) { if (_IgnoreIndexChange) return; _IgnoreIndexChange = true; try { int value; value = cboxEvent.SelectedIndex; resetListBoxes(); cboxEvent.SelectedIndex = value; csvExport(); } finally { _IgnoreIndexChange = false; } } So...