Click here to Skip to main content
15,896,557 members
Everything / SelectedIndexChanged

SelectedIndexChanged

SelectedIndexChanged

Great Reads

by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Why DropDownList SelectedValue Does Not Work Inside SelectedIndexChanged Event?

Latest Articles

by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Why DropDownList SelectedValue Does Not Work Inside SelectedIndexChanged Event?

All Articles

Sort by Score

SelectedIndexChanged 

22 May 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Why DropDownList SelectedValue Does Not Work Inside SelectedIndexChanged Event?
7 Feb 2018 by Maciej Los
If you would like to split listbox item into parts, use ListBox.SelectedIndexChanged Event (System.Windows.Forms)[^] Then, inside that event, paste below code: Dim curItem As String = ListBox1.SelectedItem.ToString() Dim parts As String() = curItem.Split(New String(){","},...
17 Dec 2013 by An@nd Rajan10
7 Feb 2018 by faiqaa
I should be able to amend the data displayed in the list box, so I've planned that when selecting each row of data, this row of data would be split and copied into text boxes (txtBox1,txtBox2 and so on) I have used the code below to do so, at first it did the job however lately an error keeps...
1 Aug 2013 by wyy20006
There is a listbox control in my Webform, I want to get the listitem by trigger the SelectedIndexChanged event of listbox, and display the item in a textbox control. but when I chang the selecteditem in the listbox, I cann't get the listitem and nothing displayed in the textbox, anyone can help...
1 Aug 2013 by ridoy
You can get selected items fromvar selectedQuery = listBox.Items.Cast().Where(item => item.Selected);And then put this in your textbox using String.Join().Hope you can understand what you need to do.EDIT:Alternately you can try..string values = String.Join(" ",...
29 Aug 2013 by Gerald Maale
Hi,Please I have trying to code this scenario. I have designed a datagridview which loads data from a database (SQL server). Now I want to always click on a row in the datagridview to show the content in pop-up form. For instance I click on a row and an update form shows. I do this easily in...
29 Aug 2013 by Boipelo
You will need a DataGrid click event (DoubleClick or maybe CellClick) and show your popup as a dialog > ShowDialog()private void DataGrid_DoubleClick(object sender, EventArgs e){ PopUpForm popupform = new PopUpForm(Pass Parameter); popupform.ShowDialog(); //Reload you DataGrid...
16 Dec 2013 by Adam Zgagacz
Here is full code. I added some comments, please read them and try to inderstand what's happening in the code:private void SelectEmployeeInfo(){ if (!string.IsNullOrEmpty(cboSelectEmp.Text.Trim())) { string input = cboSelectEmp.Text.Trim(); //Assuming your...
23 Dec 2013 by Ben Oats
Hi guys im trying to write a statement to insert selected data into a users profileSo a user can select a dvd then when they click rent it will show in there profile what they have rented.Code so farprotected void Button3_Click(object sender, EventArgs e) { OleDbConnection...
18 Feb 2014 by V5709
Set auto post back property to true. & in selected index changed event again show same model pop up using 'show' method
10 Jul 2014 by karthik mushyam
on dropdownselected change i tried to findcontrol of radnumeric textbox and make it visible=true..Here is my .ascx' Visible="false">
25 Apr 2015 by Abhinav79
option value="--Select--" selected>Select @foreach (string s in res.allTables) { @s } function getTable1Columns() { ...
26 Apr 2015 by Abhinav79
string cs = ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString; SqlConnection con = new SqlConnection(cs); SqlDataAdapter da = new SqlDataAdapter("spGetAllTables", con); DataTable dataTable = new DataTable(); ...
16 May 2015 by partha143
I have a ModalPopupExtender on one my pages which I am using to render a form to the user, the form contains several fields including a DropDownList with its AutoPostBack property set to true. When the user changes the selected item in the DropDownList POSTBACK occurs and then the modal popup is...
16 May 2015 by DamithSL
check : Solution: ASP.Net AJAX Modal Popup Auto Closes on PostBack[^]you can re-open the ASP.Net AJAX Modal Popup by calling its Show method.
6 Jul 2015 by Rojalin Sahoo
All thing's look good to run but you missed AutoGenerateSelectButton="True" in gridview control, so make a change in your gridview control as:
9 Jul 2015 by Jones Aaron
The above suggestion doesn't fetches Row.Cells[3] from database. Thank you for your suggestions.The below code worked. As per my understanding, while using Link property, it redirects to the newpage and hence the current page doesn't incurs a postback. So, I cant use...
1 Sep 2015 by Pavan Kumar
I am using three DropDownLists in a page. And I am binding data to DDL1(DropDownList1) on pageload using if(!Page.IsPostBack) condition too. And on DDL1 selectedIndexChanged Event I am binding data to DDL2 and its working fine. But when I try to do the same to DDL3 & DDL2 (Like binding data to...
1 Sep 2015 by Schatak
You need to see this article for Cascading DropDownLists in ASP.Net. You will clear idea how to work with Multiple DDlists in ASP.NETCreating Cascading DropDownLists in ASP.Net[^]
26 Nov 2015 by Member 12170139
HiI am displaying data with edit option [last column] in grid view control and that's working fine in visual studio IDE.But after deploying the same code in IIS and if i try to browse the website i can't see anything (neither data nor empty grid control ).databind: ...
29 Nov 2016 by Richard MacCutchan
txtEditor.Text = File.ReadAllText(openFileDialog.FileName);You are opening the file from the openFileDialog instead of the one in the selected item of the ListBox.[edit]The code should be something like:private void lbFiles_SelectionChanged(object sender, SelectionChangedEventArgs...
20 Oct 2017 by Member 13475705
private void combopop() { using (connection = new SqlConnection(connectionString)) using (SqlDataAdapter adapter = new SqlDataAdapter("Select * FROM BiludstyrTABEL", connection)) { DataTable dt3 = new DataTable(); ...
30 Nov 2018 by TheBigBearNow
Hello all, I have a question with C# WPF I have a window that passes a User object into the next window and in the constructor I am setting a default combobox value to what the users property is. In the combobox_Selection() I have it so when this specific property is selected a...
1 Dec 2018 by TheBigBearNow
Hello all, I have a C# WPF application that I log into and I pass the user to the next screen. Then I click to go to a profile screen and if the user already has profile data I autopopulate all the fields. In my profile screen I have it so when you set the combobox to ‘Yes’ it creates the...
30 Nov 2018 by Graeme_Grant
The code is doing exactly what you have asked it to do. When the selection changes, default is no selection, the SelectionChanged is fired from the ctor method. IF you set a breakpoint on the line CboCustomer.SelectedIndex = 2; then step through the execution line by line, you will see this...
1 Dec 2018 by #realJSOP
I know - it's unfortunate that you have to actually write some code, but that's how it goes. Put a try/catch block around the code that's attempting to insert the new user, and in the catch part, show a message box that shows "User name already exists.", and let that be that. At the same time.
28 Dec 2021 by User 13045643
Hi all, I have a question, how can I make during a selectedindexchanged of a combobox make the other one the same index? Because I have to make sure that when selected a index it became the same (not value but index). I was thinking of an if...
28 Dec 2021 by User 13045643
I found out a solution that seem working it's this, if anyone needed or may give some help. Thanks anyways rivate Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged For i = 0 To...
28 Dec 2021 by Luc Pattyn
How about ComboBox2.SelectedIndex = ComboBox1.SelectedIndex instead of your for loop?
6 Jul 2015 by Jones Aaron
I have a gridview to populate data from DB with the last column elements either hyperlinked to a different page or just a text display (without hyperlink). I have stored the TransactionId in a cookie at GridView1_SelectedIndexChanged() event for each record in that gridview. But this event is...
16 Dec 2013 by User 9512297
Hi, I am trying to take a string, seperate it into 3 parts and parse one of them into a combobox only if it has that value in it. So... The values are stored in an Enum and are displayed in the combobox. on selected index changed the first combobox's text is taken into 3 parts....
17 Dec 2013 by User 9512297
Hi,I have a combobox that contains column names from a database. He're the code that gets it: private void SelectColumn() { const string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=EmployeeInformation.accdb"; var conn = new...
17 Dec 2013 by User 9512297
Fixed it by changing the query to exclude the columns that I don't want
23 Dec 2013 by OriginalGriff
You can't use a WHERE clause with INSERT.INSERT always create a new record, it can't change existing ones.Probably you want an UPDATE command instead:UPDATE UserProfile SET Rented=@Rented WHERE [UserName]=@UserBut, I wouldn't do it like that - I'd have a separate table for rented, which...
17 Feb 2014 by BeastMode10
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList1.SelectedValue == "Installment") { RadioButtonList1.Visible = true; Label11.Visible = true; txtInsAmount.Visible = true; } ...
29 Nov 2016 by Member 11893772
I NEED IT WHEN THE LISTBOX SELECTED ITEM TO DISPLAY IT ON TEXTBOX AND ITS MULTISELECT TXT MY CODE BELOW THE RESULT WAS IT REAPETS THE FILE PLEASE HELP!!!What I have tried:OpenFileDialog openFileDialog = new OpenFileDialog(); private void btnOpenFiles_Click(object sender,...
16 Dec 2013 by User 9512297
The enum with the values:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace EmployeeTracker.DataTypes{ public enum EmployeePosition { Owner, Manager, SalesClerk, ...