Click here to Skip to main content
15,891,657 members
Everything / Selection

Selection

selection

Great Reads

by Jawahar Suresh Babu
The article describes how to implement Rubberband behavior for WPF Listbox. Also it describes how to add the behavior using Expression Blend.
by Vahe Karamian
This article will cover the basics of Leap Motion integration into your Unity 3D project. We will look at the basic setup and implementation of the basics to get you started. In order for you to try the code, you will need to have the Leap Motion hardware.
by ASP.NET Community
The ListBox control is used to create a list control that allows single or multiple item selection. Use the Rows property to specify the height of
by Greg Dennis
How to implement a single selection set across as many ItemsControls as your app needs.

Latest Articles

by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
How to select all text in a textbox on focus
by Vahe Karamian
This article will cover the basics of Leap Motion integration into your Unity 3D project. We will look at the basic setup and implementation of the basics to get you started. In order for you to try the code, you will need to have the Leap Motion hardware.
by Jamie Highfield
WinForms .NET Time Chooser grid control.
by Menci Lucio
This is a control that lets you select an item from a list with a single gesture

All Articles

Sort by Score

Selection 

16 Jun 2012 by Jawahar Suresh Babu
The article describes how to implement Rubberband behavior for WPF Listbox. Also it describes how to add the behavior using Expression Blend.
8 Jul 2015 by Vahe Karamian
This article will cover the basics of Leap Motion integration into your Unity 3D project. We will look at the basic setup and implementation of the basics to get you started. In order for you to try the code, you will need to have the Leap Motion hardware.
4 Sep 2014 by Wendelius
This sounds a bit like a homework....Anyhow, there are quite a few differences. To name some from the top of my head:the amount of columns is differentthe order of the same columns returned may be differentthe second one may fail because of wrongly typed column namethe second one may...
19 Jul 2012 by JF2015
The "Remove" function lets you only remove one object at a time, but the "SelectedItems" function returns a collection of the selected items (since you may have multiple selected items). You could also use this code:while(listBox1.SelectedItems.Count > 0){ ...
2 Nov 2012 by fjdiewornncalwe
A really quick google search turned up this article: Search and Highlight Text in RichTextBox[^]. Maybe you can get a starting point from here.
4 Sep 2014 by Gihan Liyanage
Say google first.. When you have an issue or doubt Your solution is here.Select * Vs Select Column Name[^]
17 Jun 2020 by #realJSOP
try this: select max(case when isnumeric(roll_no)=0 then 0 else roll_no end) as max_roll if there's a chance your data will not always have a simple numeric value (in other words: 1 2 3b you probably want to try this SELECT...
7 Apr 2021 by CHill60
In theory it is possible - try searching using your favourite search engine with Quote: MS Access Split string into multiple records You will need to write some VBA to do this. However, that would not be a good solution. A better solution is for...
12 Jun 2011 by Sandeep Mewara
Yes, very much possible. For example, if you select 'Others' as an option in the select then a textbox needs to be shown where one can fill any description of other if needed. You need to do:1. Attach a Javascript 'onchange' handler for the select2. Whenever anything is selected the...
2 May 2012 by Maciej Los
Sandeep Mewara was trying to tell you to use selecteditem object, not ListBox1.SelectedItems(LBitmCounter). In my example i replaced it with oItemFor Each oItem As [Object] In ListBox1.SelectedItems If oItem.ToString = "Text 1" Then Action 1 ElseIf oItem.ToString = "Text 2"...
24 May 2012 by Maciej Los
SELECT F1 FROM Table1UNION ALLSELECT F2 AS F1 FROM Table2More at MSDN: UNION[^][EDIT]Analogically, if data comes from the same table:SELECT F1 FROM Table1UNION ALLSELECT F2 AS F1 FROM Table1[/EDIT]
29 Dec 2012 by Wendelius
Ok, so if I understood your question correctly, then you could use dynamic sql, something like following:declare @name nvarchar(50)set @name = (select Name from Lookups where Lookups.ID = 4)execute ('select * from ' + @name)For more information, see EXECUTE[^]
24 Jul 2013 by Thomas Daniels
Hi,Have a look here:http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx[^]http://msdn.microsoft.com/en-us/library/ms171921%28v=vs.110%29.aspx[^]I see that you use string concatenation to build a query. NEVER use string concatenation to build SQL queries! If you use it,...
17 Jun 2020 by Gregory Gadow
This is a bit clunk but should work: SELECT MAX( CASE WHEN T.roll_no NOT LIKE '%[^0-9]%' THEN CAST(T.roll_no AS INT) ELSE NULL END ) FROM Table AS T This will look at each entry: if there are non-numeric characters in it, it will return...
18 Mar 2011 by walterhevedeich
You can get the selected cells values using the DataGrid.SelectedCells property and GetCellContent method of the DataGridColumn. For example:for (int i = 0; i
18 May 2011 by Not Active
It is better to specify the columns rather than using *. One reason is the query engine can optimize the query better knowing what the columns and types are rather than having to take a guess with a broad *. This can be particularly important when using tables that are broad, or when using...
23 May 2012 by Mohamed Mitwalli
Hi , If you need to select the First Value you have to set SelectedIndex ListBox1.SelectedIndex = 0;Best RegardsM.Mitwalli
24 May 2012 by ujju.1
you can use union all for thise.g.select column_Name1 from tbl_1 union all select column_Name2 from tbl_2
27 May 2012 by OriginalGriff
If you are using C#, then the code is going to be pretty much the same: just use a parametrized query. using (SqlConnection con = new SqlConnection(strConnect)) { con.Open(); using (SqlCommand com = new SqlCommand("SELECT iD,...
27 May 2012 by vangapally Naveen Kumar
see this it may help youda = New SqlDataAdapter("select distinct( name) from sample", con) ds = New DataSet() da.Fill(ds) CheckBox1.Text = ds.Tables(0).Rows(0)(0).ToString()
19 Jul 2012 by johannesnestler
Why is the second btnDelete_Click not working:Because the Remove method expects the element to remove but the SelectedItems property returns a collection of items.I mean I select a line on my listBox1 with my mouse and then press the button. Doesn't the .Remove function recognize which...
11 Feb 2013 by srikanth pachava
you can query the data set DataTable tblMEN = dsView.Tables["MEN"];DataRow[] results = tblMen.Select("SensorValue
11 Feb 2013 by OPees
You can use Select statement like this. DataTable dtSensor = feb12DataSet.Tables[0].Select("SensorValue
16 Jan 2020 by Avik B.
I want to add a column to gridview in ASP.NET, this column should contain Hyperlink and i want to navigate to a particular page with the clicked cell value to be passed using the get method.How to do this in asp.net(C#)?I can make the element hyperlink, buut how to pass the selected...
12 May 2013 by neteroxv
My mistake. I should have used."Select count(*) from [users] where [userid]=@uid and [password]=@pword"since I used Convert.ToInt32(cmd.ExecuteScalar())>= 1 which requires numeric result.1, 2 and 3 worked after I fixed my error in my select query.
17 Jul 2013 by Maciej Los
First of all, i would suggest you to NOT use insert/update/delete statements in code. Have you ever heard about SQL injection[^]? Better way is to use stored procedures[^].Second, you need to declare variable (for example) oCell, type: DataGridViewCheckBoxCell. Then you need to cast...
26 Aug 2013 by Sergey Alexandrovich Kryukov
You can do it without using the said method, but other approaches (using selection properties) will be equivalent. Like it or not, the concept of selection is bound with the caret position, you cannot operate them independently.And this is how all text editors and word processors work these...
26 Aug 2013 by BillWoodruff
I don't see any conceptual barrier to your getting this done: here's a simple demonstration that requires a RichTextBox, and a Button on a Form.Wire-up the RichTextBox's SelectionChanged EventHandler as shown here, and the Button's Click EventHandler as shown here://keep track of the...
11 Oct 2013 by ASP.NET Community
The ListBox control is used to create a list control that allows single or multiple item selection. Use the Rows property to specify the height of
22 Jan 2014 by hypermellow
Hello,It's been a while since I've had a play with php.Looking at the code you posted, you might want to try escaping those double quote characters that wrap the textarea size parameters.while($row = mysql_fetch_array($result_reviews)) { echo "" .$row['username']....
8 Mar 2014 by Abhinav S
This is one of the more standard approaches and is ok...
8 Mar 2014 by Maciej Los
The speed of fetching data depends on many things, for example:1) server efficiency (processor, HD and RAM capacity, etc),2) query performance (one of the most bad practice is to use SELECT * instead SELECT ),3) code execution...etc.Plese, see these to improve sql query...
7 Apr 2015 by Sergey Alexandrovich Kryukov
ChrisCreateBoss asked:…What else can I use to play several video and audio formats? Formats such as mkv, mpeg, mov, avi, m2ts; wav, mp3. Oh and that is because my project is about a quick file preview app just like on mac os x computers, you select a file, press space, and a nice window...
10 Jan 2016 by chainerlt
Hey guys,I can't figure out if it is possible to programmatically select text in TextBox with also setting caret position? It always sets caret position to the end of selection:http://i.imgur.com/VS8rKsK.png[^]Can I get caret at the beginning of selection? (any other...
29 Apr 2016 by Kevin Marois
First, I have to say, if you're loading 50000+ items into a ListView, you have serious design issues. You might want to consider some kind of paging.Ok, so, try adding each item in your collection to the listView's SelectItem collection.. Something likeforeach(var item in myItems){ ...
7 May 2016 by Patrice T
You should learn about RegEx (regular Expressions)Regex Class (System.Text.RegularExpressions)[^]Regular Expression Language - Quick Reference[^]Google for more
29 Jan 2018 by CPallini
If you need just a single row, why don't you use LIMIT 1 in your query? By the way, your query looks correct, however you failed to report here the exact error message as well the table structure.
26 Apr 2019 by Gerry Schmitz
Then it NOT "working fine" with 1000+ records. There's usually no issue getting the "first page" up; it's "scrolling" that shows what what a performance hog was created. It never makes sense to retrieve more than 1 page at a time in a web app. How To Implement Paging in GridView Control in...
24 Dec 2019 by MadMyche
The reason that you are getting this error is that EmployeeNumber is declared as an array of strings (string[]) and you are attempting to populate it from a single string directly. I believe that you want this just to be a string, and not an array of them.OverTimeRequest.cs[Required]...
18 Jun 2020 by Maciej Los
If you would like to get the highest number from c# code, check this out: DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("roll_no", typeof(string))); dt.Rows.Add("1"); dt.Rows.Add("2"); dt.Rows.Add("3"); dt.Rows.Add("3a");...
8 Apr 2010 by kishore Rajendran
Hai,i cant execute SELECT query in my program...the INSERT query is working,bt wen i called SELECT query,it showing an error "no data/column exists"but it contains values and i can take the value using query analyser,bt its not working through the program,my db is ms accesskindly help...
8 Apr 2010 by Luc Pattyn
You should tell us more. Show the connection string, the INSERT SQL statement that works, and the SELECT code that doesn't. Plus maybe the table definition, at least the field names and types you are using.:)
24 May 2010 by ImNAM
Hello,I am not a PRO with SQL, so guys.. I need you help.I might be laking in basic knowledge here.. but plz help..I have 2 tables, Master(users) and Transaction(logEntries).Linked with usrSrNo (index for Users). Log Entries have Transaction logs.Now I want to Display Distinct...
24 May 2010 by Christian Graus
I think you need to select the top date, to make it return one date per user. I dont know if max works for dates ? A group by clause is tge other thing, select the highest date Nd group by user.
24 May 2010 by Abhinav S
You are setting DISTINCT on username and then on logDateTime.You can group by username and then put a distinct on logDateTime.
4 Jun 2010 by HugeHugh
I'm having a real problem with WPF not maintaining the current Selected Item when I create a data-bound user control dynamically. The easiest way to explain it is to show you a stripped-down example.In this simple example I have a WPF window that contains a TabControl named OuterTabs in the...
4 Jun 2010 by #realJSOP
The problem I think is that your tiNew variable is being reallocated, so the program has the same tab twice. You sholud write a method that creates a new TabItem and sets all the appropriate properties, and returns the TabItem to be added to the TabControl.Items collection.
4 Jun 2010 by HugeHugh
I have developed a workaround for this issue.Using a DataTemplate and letting Binding automatically instantiate the User Control seems to be the problem.I was able to get it to work by:A) Do not use a DataTemplateB) Set the Content of the TabItem to be a new InnerTabs usercontrol,...
19 Aug 2010 by uuilliam
HiI hope someone can help me here.I have set my page up with a dynamic background (using PHP)but when I change page, the background disappears.I need to know, how to create a cookie (IN PHP) that will target the background and keep the background active as you change page.I...
19 Aug 2010 by Nyarost
In PHP5 this can be done with the help of $_COOKIE superglobal.
20 Aug 2010 by uuilliam
I know about $_COOKIE but I have only been learning coding for about... 20 - 30 weeks. (learning mostly css and html, then just used some basic php now i need to go a little more advance.)its the fact of, I do not know how to target the background.I know thatsetcookie(name, value,...
4 Oct 2010 by Jojy Kuriakose
I am looking for an interface .C#.Net which on selecting a report provides its selection criteria fields and then on selecting run displays the report.Any sample code??
4 Oct 2010 by Jojy Kuriakose
nothing so far, as i am using C#.Net 2010 .net 4 and Oracle 9. I am looking for a good sample "run report" screen.The user needs to select a report from a number of reports provided and based on his selection, the selection criteria changes, and based on the selection criteria selected i...
12 Jun 2011 by RossIV
Hello!I have a basic form setup in an html file. What I want to do is if a user selects a specific option in a dropdown box, then display an additional field on the page. Is this possible?Thanks!Ross
17 Aug 2011 by liz9677
HiI'm new to posting on this site, but have found it quite useful for finding information. I have a problem however, and am not able to find a solution anywhere. i have a masterpage with a navigation menu. The menu items open different pages, and i am able to highlight the selected menu...
17 Aug 2011 by liz9677
I think i solved my own problem. Without sessions and the lot. Was quite easy in the end, but thanx for your reply. In MasterPage Load, loop through menu items and do some checks. Since the page being loaded accesses the masterpage, you just need to set the specific menuitems selected...
15 Feb 2012 by Varun Sareen
Dear Friend,This link will work for you:-http://www.daniweb.com/software-development/vbnet/threads/142298[^]Thanks
26 Feb 2012 by Ahmed Abu Aziz
Im seeking to make application that archiving word documents I face a problem in searching the content of those files on aspecefic text , so i decieded to insert the files in database , where each page will be arecord in atable have the name of the decument.i can read from the document file,...
15 Apr 2012 by nagiub2007
SELECT Diw_Tb_Court.Fd_CourtCode,Diw_Tb_Court.Fd_CourtName + ' '+ Diw_Tb_CourtType.Fd_CourtType AS Court from table1 one inner join table2 to etc.....i want when he found Diw_Tb_CourtType.Fd_CourtType =null get Diw_Tb_Court.Fd_CourtName as Court but in sql server when he find...
15 Apr 2012 by Herman<T>.Instance
select isnull(Diw_Tb_CourtType.Fd_CourtType, Diw_Tb_Court.Fd_CourtName) as Court from table1orselect coalesce(Diw_Tb_CourtType.Fd_CourtType, Diw_Tb_Court.Fd_CourtName) as Court from table1
2 May 2012 by Saufkumpel
Hi there,I've got a Listbox where SelectionMode = MultiSimple and I'd like to check the strings they contain to follow up with according actions (see Snippet) for each.What I've tried so far:For Each selecteditem As [Object] In ListBox1.SelectedItems If...
2 May 2012 by Saufkumpel
For LBitmCounter = 0 To ListBox1.SelectedItems.Count - 1 If ListBox1.SelectedItems(LBitmCounter).ToString = "Text 1" Then Action 1 ElseIf ListBox1.SelectedItems(LBitmCounter).ToString = "Text 2" Then Action 2 ElseIf ListBox1.SelectedItems(LBitmCounter).ToString =...
23 May 2012 by Member 8956437
Hello,I was wondering if someone could give me a hand in this project that im working on, right now i need to auto-select the first item on a listbox after i click an item on a diferent listbox.Im working in Aspx , thank you.Best Regards
23 May 2012 by Technoses
ListBox1.Sel...
24 May 2012 by Member 8956437
Hello,I wanted to know if it is possible to select 1 value from 2 diferent Columns in the same table and display them in the same column.Heres an Example.Total Free Space | Total Space10 3020 1040 ...
24 May 2012 by Wendelius
You haven't mentioned the exact logic you're trying to use since the answer may vary depending on the needs. But if you want for example pick a value from some column in your query then you can use CASE[^]An exampleSELECT CASE WHEN column1 = 10 THEN column1 WHEN...
27 May 2012 by Member 8956437
Hello,Is there a way, in aspx.cs, to read data from a database? I doesnt seem to be exactly the same as in C#.I need to use the select command to read from the database and put the value i just read in a variable, just a simple SQL Select command, i think i might be missing some...
27 May 2012 by Sandeep Mewara
Read about ADO.NET here and it will help you.Look at these:MSDN: ADO.NET[^]MSDN: Accessing Data with ADO.NET[^]The C# Station ADO.NET Tutorial[^]Using ADO.NET for beginners[^]Simple ADO.NET Database Read, Insert, Update and Delete using C#.[^]
29 May 2012 by Sandeep Mewara
OP and Ed resolved the issue with comments! Posting this to pop this one out of unanswered list.
30 May 2012 by Member 8956437
Hello,I have the code to auto select the first item in a listbox, and when i start the web page , the first item is selected, but the other code that i have after the selection has been made its not firing.When i select the second item and then the first one again, everything works...
13 Jun 2012 by WajihaAhmed
I have got a canvas, with a layout of a Checkers board. At the position of pieces, I have placed images. The point at which I got stuck is, how to select/highlite a piece's image for a move. I can't figure out the appropriate commandListener and how to handle this keyPressedEvent.Any suggestions?
25 Jun 2012 by Prashant Trambake
Try this code. Will help you.$(document).ready(function(){ $('.check:button').toggle(function(){ $('input:checkbox').attr('checked','checked'); $(this).val('uncheck all') },function(){ $('input:checkbox').removeAttr('checked'); $(this).val('check...
27 Jun 2012 by Vikram Bhatt
Just give class to asp.net check boxes and it must work.
29 Jun 2012 by Member 8491154
When I select some text in the , I want that highlighted text to appear in the textbox which is just below the div. How can I do it?My text goes here............
29 Jun 2012 by Member 8491154
I got the answer at:Get highlighted text from div
9 Jul 2012 by Wyrdathru
It looks like the only way to resolve this I could come up with was to use the OnTexTInput event and have it manually change every letter when typed. I fear for the issues of speed, but so far it seems to work.(I'll get used to this solution thing one day, maybe!)
19 Jul 2012 by y.baris
Hello to everybody.This works fineprivate void btnDelete_Click(object sender, EventArgs e){ for (int i = 0; i
24 Jul 2012 by EddieMurphy
Hello,I need help with the WPF dataGrid Selection.When I select a row in the dataGrid I'm executing a stored procedure. This makes the row selection very slow.Now I want to execute the stored procedure only if I do not select an other row during 300ms.How can I do this?I tried...
30 Jul 2012 by FoxRoot
Hello everyone. I am developing my project. I am using checkboxes, combobox and a button. I select an item from combobox let me say it is Prof DR JOHN NHOJ and I am clicking more than one check boxes. For example barcelona, apple, NYC and bus are ticked for Prof DR JOHN NHOJ. I am clicking save...
30 Jul 2012 by FoxRoot
if(checkboxnam...
30 Jul 2012 by Sandeep Mewara
Yes, possible. Just filter the previous already selected items from the datasource itself. Two ways:1. If you are fetching data for every person then you can do the filtration at query level.2. If you are fetching data once and using again & again, you need to write your own logic for...
11 Aug 2012 by Wendelius
You didn't mention if you want to do this with a SQL query or in code or something else, but if you want to use SQL and you have SQL Server then one way to select a random row isSELECT TOP 1 * FROM YourTable ORDER BY NEWID()
27 Sep 2012 by kk2014
hi,when i tab from one control to another(textbox), then i want to select all text within that textbox?thanks,kk
26 Oct 2012 by Greg Dennis
How to implement a single selection set across as many ItemsControls as your app needs.
26 Oct 2012 by Greg Dennis
Another approach to implementing single selection across multiple ItemsControls
1 Nov 2012 by MR. AngelMendez
Hi, I have a richtexbox with some text in it and a timer. I want to make the richtexbox start from the begining of the text and select the first word and as the timer resets change the selection to the next word and so forth until it is finished with the final word. Its kind of like leap frog to...
3 Nov 2012 by ancientrd
i have 2 tablespuf : id_farm,dataora,cod,nume,tip,id(key)iep : id_farm,dataora,cod,nume,tip,id(key)in puf i have...
3 Nov 2012 by Abhishek Pant
Firstly, your question is uncomplete about primary key and foreign key(You did'nt mentioned it which one is primary and which one is foreign).If you didn't built a foreign key for the table just build a new FK for the 2nd table then on behalf of that call what you want by using select...
19 Nov 2012 by engmebeed
I want to load the select (drop down list) with data from xml file.this code is to load xml file: x = xmlDoc.getElementsByTagName("User");"User" is the tag i want to catch if i found it, then update inter subTages like:"UserName","Password","Type".After catch "User" update...
11 Feb 2013 by ontheline89
Hello, I am inserting Records in a Database. I need my records to be shown in a Datagridview, when a button is pressed. Datagridview should show records only with SensorValue is
26 Feb 2013 by zabamkd
Hi,I created dataGridView with 3 column connected using Linq to Sql. The all 3 columns are defined like dataGridViewTextColumn. - - - - - - - - - - - - - - - - - - - - - - -' First Name ' Last Name ' ---Date----' - Headers-----------'-----------'--------------'---John---...
31 Mar 2013 by Deependra Khangarot
Hi Avik,I think the code will work with a little change.Update NavigateUrl property :NavigateUrl='' For more information you follow below links:Using Hyperlinks in GridViewUsing...
12 May 2013 by neteroxv
Hi I'm new to vb.net.I'm having error input string is not in the correct format. I already used different codes for adding a parameter in sql select query.I would like to ask what is the best way of adding a parameter in a VB.net select query?Thanks in advance. Dim strsql As String...
26 May 2013 by shery_l
here is the solution select distinct a.EMPNBR AS "Emp Number", a.EMPNAM AS "Emp. Name",SUBSTR(b.VSTDTE,1,9) AS "Visite",CASE when b.CLINTYP = 1 then 'Gen. Clinic' when b.CLINTYP = 3 then 'both Clinic'else 'Dent. Clinic' end from MAINFRAME.EMPBAS a inner join CLINIC.CLNCVST b ON...
8 Jun 2013 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You need to bind the DropDown if Page.IsPostBack Property[^] is false. So, Page_Load should be like below.Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack GetCompanyDetails() End IfEnd Sub
26 Jun 2013 by RaviRanjanDOTNET
We are handling two scenarios in grid:1) Doing below in row created event for firing selectIndexChanged event on row click of the grid e.Row.Attributes.Add(AttributeOnClick, Page.ClientScript.GetPostBackEventReference(grid.Id, "Select$" + e.Row.RowIndex.ToString()));2) Also Setting...
17 Jul 2013 by mareksip
Hello guys I have got these SqlCommands which inserts and selects. I need to add to prikaz2 (which inserts) condition it would INSERT INTO only these rows wich were selected by checkbox. I have wondered about this for quiet long time but none of my codes were able to do that. Do you guys would...
17 Jul 2013 by leonardodamato
Hello, U can try it:for (int i = 0; i
27 Jul 2013 by kumar.selva.c
I want to show the listbox selected item (image) in any other control but in larger sizei have tried with two listboxes andalso by setting IsSynchronizedWithCurrentItem="True" but it is not working, please find the code below.