selectedindexchanged

ListView returns InvalidArgument=Value of '0' - Out of Range Exception

I am attempting to scroll through a database of Album Names using ListView. When I initially select an album, _SelectedIndexChanged returns the appropriate album; however in subsequent attempts to select an album, ListView returns a System.ArgumentOutOfRangeException - InvalidArgument=Value of '0' is not valid for 'index'. Could someon...

Something like oEvent.cancelPostBack for DropDownList in asp.net server side code

Hi, I am having the code for selectedIndexChanged event of a DropDownList in Asp.Net that looks somewhat like this protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { //Get the value of Base category on the basis of the new index selected. if(BaseCategory belongs to (SomeValues)) { //do some actio...

MsgBox is not displaying the right value

Hey, I have a DropDownList, and when SelectedIndex is changed any event is triggered. I'm putting on it for exemple msgbox, but it's not working. What's the problem ? EDIT; now that's working after doing AutoPostBack = True. I did this, but i't giving me always '0' as result Protected Sub VD_SelectedIndexChanged(ByVal sender As O...

Difference between DropDownList.SelectedItem.Value And DropDownList.SelectedValue (ASP.NET)

Hey, I'm getting an error when SelctedIndexChanged, When the value change he gives me the previous selected value and not the new selected value. What's the problem here. And what's the difference between DropDownList.SelectedItem.Value DropDownList.SelectedValue ...

Dropdown OnSelectedIndexChanged not firing

The OnSelectedIndexChanged event is not firing for my dropdown box. All forums I have looked at told me to add the AutoPostBack="true", but that didn't change the results. HTML: <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <a...

ListBox.SelectedIndexChanged - can you determine if it was user intiated?

My question is similar to this: http://stackoverflow.com/questions/905447/how-to-prevent-listbox-selectedindexchanged-event, but I want to ask it a different way. Is there a simple way to determine if the 'SelectedIndexChanged' is coming from the user as opposed to initiated through code (e.g. ListBox.SelectedIndex = x)? ...

How can I make a TextBox in a GridView not fire TextChanged when SelectedIndexChanged is fired?

Pretty much the title says it all. I have a TextBox in a TemplateField in a GridView that is supposed to show a checkmark after its TextChanged event. I also made the GridView row selectable. If I select a row, the entire GridView rebinds and fires the TextChanged event for all TextBoxes in the GridView. This, of course, displays all ...

ListView SelectedIndexChanged Event no Selected Items problem

I have a small C# 3.5 WinForms app I am working on that grabs the event log names from a server into a listview. When one of those items is selected, another listview is populated with the event log entries from the selected event log using the SelectedIndexChanged event by grabbing the text property of the 1st item in the SelectedItems...

Set textbox visibility based on dropdownlist value in gridview

I have a gridview that i would like to show or hide a text box based on the selected value of a dropdownlist on the same row. My gridview: <asp:GridView ID="GridViewUsers" runat="server" AutoGenerateColumns="False" CssClass="TableFramed"> <Columns> <asp:TemplateField HeaderText="Type"...

Does not exist in current context c#

Hi, In my win forms app i have a listbox and a textbox the app gets email from a server and displays the subject etc in the listbox and when i click the listbox the body is shown in the textbox. The problem is i have to repeat the enitre code below in the selected index changed event to get it to work otherwise i get "does not exists ...

DropDownList.SelectedIndexChanged renders a code generated GridView incorrectly (doubles, triples, etc...)

Hi Guys, I have a dropdownlist that controls the contents of 3 gridview controls. These are used in a webpart. However, every time the selectedindexchanged method of the dropdownlist fires an event, the contents of the dependent gridviews adds another rendering of a gridview. Hence, it doubles and even triples the contents of those grid...

Does the ListBox SelectedIndexChanged event require postback in ASP.NET?

I'm trying to add a JavaScript function to show all selected items from a ListBox as concatentated strings in a Label on the page. It's needed because AutoPostBack="true" will cause the ListBox to scroll all the way back to the first selected item. So this code works: <script type="text/javascript"> function Updatelist() { ...