About ListBox limit item [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Hello everyone,I am new here, can I ask a question:
Let's say I have a ListBox (with more than 5k items of all English words ). and a richTextBox.
And a ListBox usually load every items, right? How can I change my ListBox to just load/pick a few (maybe 10 items) from the data?
EXAMPLE:
**When a user type a word, I dont want my ListBox to load every thing starting with the word my user input. I just want my ListBox to load just a few item.(More to like a word prediction software) **
Please give an answer that is not too complicated, since I am a beginner.
Thanks, Teik Fai.

From your question, it looks like you need to implement virtualization on the listbox.
You can either use a VirtualizingStackPanel inside a Listbox as ItemsPanel Template or you use - ItemsControl and set its property VirtualizingStackPanel.IsVirtualizing="True"
This should help.

Related

How I can make an Autocomplete TextField in WPF? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How I can make an Autocomplete Text Field in WPF?
How I can include multiple value in text field.
Actually I'm trying to make an search bar in which Products are fetched from database and include in text field then.When i type a keyword it should be display an suggestion.
Re-template ComboBox to make it looks like TextBox.
Extend ComboBoxItem so that we can hightlight the already entered part in the dropdown list.
Get reference to the TextBox part of the ComboBox, and hook up TextBox.TextChanged event.
In the TextBox.TextChanged event handler, we filter the underlying datasource and create new list source with our customized ComboBox Items.
Hope this will be helpful.
Thank you

How to make empty grid cell clickable in Asp.net Grid? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have an Empty Grid View. When I click on each grid cell I want to add a pop to add items.Kindly give some idea to make my grid cell clickable.My grid view is
please help me
A little bird told me you already have labels inside. SO instead of these you can put Buttons or even better LinkButtons, and depending on how your GridView is created (from the Toolbox or code behind) you can set your Buttons to be clickable like so
LinkButton.Click += new EventHandler(LinkButton_Click);
Set their ID or CommanArgument to be something meaningful to you, and have everything done only trough C#.
BUT since you want to execute a POP (up ?) maybe the best case scenario for you is to workout how to call fancybox and then have
yourLabel.Attributes.Add("onClick", "Fancybox(this.id");
to open a pop-up.

How can I achieve this layout in WPF C#? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
As you can see in this image:
It's a table containing different controls(e.g. button, list, text) on the columns that can be sorted and each row is unique to each other. Any help or starting point would be greatly appreciated.
You would typically have an Observable Collection which holds the objects of interest (i.e. in your screenshot you have a person with a name, age, etc), so it could potentially be an ObservableCollection of Person objects.
Once you have that, you can build up your view in XAML. Typically you'd have some sort of list control (list view, list box, etc) that binds to the collection, and you create a data template in order to customise the look and feel of the control to match how it looks in the screenshot.

Make a clickable menu using longlist selector [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to make a list of a menu and I want it to be clickable. When a user taps on it, it will change page (to another XAML). I am a beginner in Windows Phone programming, so, as now, I only use selectionChanged, but it only works for 1 string of the list.
So lets say I want to make a list of home, login, forum in the menu, I only could use selectionChanged for the first one.
I have searched for a solution over and over again on every site, but none of the sites share a full tutorial to make it.
If anybody knows how to make it, please help.
This has been discussed multiple times on StackOverflow. What you're trying to achieve is to get some data associated with the LongListSelector's item been tapped. That data lives in the DataContext property of the item. When you handle the Tap event on the list item, you can retrieve your item's DataContext, cast it to required type, and use it as you wish, for example to navigate to some specific page, or whatever you want to achieve.
See this answer as an exampe.
you should check the templated application that are provided with the sdk.
Create a new project of type Databound App.

How to add property to a ListBox? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
VB6 had a fileListBox with .path property and I am trying to add that property to regular listbox.
ListBox myfilelistbox = new ListBox();
and the one generated with XAML.
I think what you want is Attached Properties
ListBox is a generic control which displays list of items in a linear manner. What you wish to do is to display a hierarchy of items, not a list of them.
There are no such built in controls and you will have to build one for yourself or find some that others have implemented.
Check more information on this other Stack Overflow thread Is there a WPF control which will show a list of files in an Explorer-like view?.
The following article on CodeProject could help you: A WPF File ListView and ComboBox

Categories