I am facing weird kinda situation. I have form which consists of 6 Fields among which 1 is drop down list. Now i have filled that drop down from another table but problem is that the Drop Down consists loads many items (ComplaintID) and can extent further. So what can be the solution instead of using Drop down or trimming it or anything.
have you tried a listbox? that lets you scroll so doesn't matter how many items really
Have a look at
Chosen
Autocomplete
Also have a look at
Why drop-down lists are bad for the user experience?
What are the alternatives to a very long dropdown?
Alternatives to huge drop down lists
Related
For the last few weeks I've been building a product demo for work which includes a winform to enter new customer enquiry information. One of the form elements is a text box which, for the sake of ease, I haven't imposed any validation on so far. However, I now need to make it so that the user can only enter a valid location from an sql database table (containing around 15k streets).
I'm still quite new to C# programming. My first thought was that I should change my text box to a combobox but I seem to remember that when you click on a combobox all the options in the list appear before you've typed anything. Since our computers are slow and there's so many options, I don't really want to flood the screen so I was wondering if there was a way I could continue using my text box and onkeypress (probably the tab key) a dialogue pops up with all the closest matches from the list, prompting the user to select a valid option?
If not, is there a way to stop my combobox from showing the option list until prompted?
I would not think a combobox is not well suited for that many items.
The way I have approach this is to use a separate list view to show matches. You could probably put matches in a drop-down style borderless window, but I find that more complex and may be difficult to make the interaction work well.
I would just have the streets in a separate list view control and apply a filter to that.
Make sure the view is resizable, I find it very frustrating when working with old window controls where the list is tiny due to it being written for 640x480 screens, and does not allow resizeing.
Keep performance in mind, when searching with each key-press you might want to fetch all records and do the search in memory rather than making a sql query for each key.
I have a listbox in a winforms application that I would like to give a selection behavior that is different than the built in options for the control.If I choose multi-extended, I get what we are accustomed to - ability to use shift or control to select multiple items in the list. The multi-simple option lets you select individually and leave the item selected until you delect it. I'm trying to deal with a slightly different problem that could be solved by a combination of the two options. My users want to be able to use the shift key to highligh a long list and they don't want to accidentally lose their selection if they mistakenly click on one other item in the list. My thought was to keep everything hightlighted until they click a clear button. I kind of think they are asking for something that is not what Windows is meant to do and should not be allowed to do but I thought would post the question so see if anyone has done this before.
I'm a bit stuck on the approach for this task. I want to be able to provide 2 separate lists for one combobox based on a radio button selection.
I'm not looking for the exact code, but rather the approach.
Do I create two lists and make them visible/invisilble based on radio button selection
Do I create 2 arrays and based on radio button selection populate combobox items
Another implementation?
Without showing me the code, what approach would be seen as standard?
Thanks!
The recommended solution is to create 2 arrays and based on the user selection (radio button) populate the list with the appropriate data/items.
Well it's not playing actually.
I have a database with about 200 list of items in it. I've used DataTable to fetch all the data in single connection.
Then created a windows button that creates new button for all the items.
It is OK and I was able to do it easily.
But I stuck over two things..
First is, I have limited space in my windows form, that's why I want to load only 30 buttons at first and then upon second click event, I want to load buttons for remaining 30 items and so on..
Second problem is, even if i managed to solve the first problem? How to arrange them in proper row/column?
Please help.
Grab an ordered list of records, split it to a list of "pages" (which is also a list of records) and use navigation buttons to change the context of current page.
Why don't you take a DataGridView with a BindingSource and a DataGridViewButtonColumn? With this as a starting point you can simply glue them together by calling:
myDataGridView.DataSource = myBindingSource;
myBindingSource.DataSource = myDataTable;
Update
Surely you can try to do the whole visualization on yourself by using a TableLayoutControl. But the DataGridView is a control that is specialized to visualize data in a data grid (hence the name of it).
The grid view is a very complex control, but it has a lot of nice features which make your results looking more professional by simply configuring some properties of it. For example simply set the property AutoSizeColumnsMode to Fill to simply avoid horizontal scroll bars and set the Column.AutoSizeMode of some columns to e.g. DisplayedCells to enforce which columns should be wrapped, etc.
Also there are a lot of features regarding to data validation, formatting, etc. So i think even if the step-in hurdle is a little higher you got a much better visualization then trying to do all this stuff manually by taking a TableLayoutPanel. Last but not least there are lots of examples about how to use the specific properties within the MSDN and if you get really stuck just search for the problem here on SO or on the web and if you don't find a proper solution just ask a question here on SO.
I am a beginner in asp.net(C#) and stuck in an important point.
I have a dropdown list on my homepage which users select a category.
After selecting the category, user will fill a form which has related controls to that category in it.
As I have many categories, I just want to have single ascx page and adding controls to it dynamically according to the user choice.
For example: One chose Telephone category, he will face a form having drop down lists asking, what brand? what color?
And one chose, book category, he will face drop down lists asking which type? howmany pages?
So 1 ascx must do my work at runtime done as I have alot of categories.
I am going to take these criterias from a database table which has CategoryID and Criteria colomns.
And if I can do that, will it be possible to add field validators to these dynamically created controls.
Nearly all controls are drop down list, if this helps.
Any help would be highly appreciated..
Thanks alot
You can add an asp:placeholder Or literal control to your page and then populate all the controls programatically. Altough you will have to take special care to make sure the control state and view state are correct at all times.
Here's an example on how to do it
https://web.archive.org/web/20211020131055/https://www.4guysfromrolla.com/articles/081402-1.aspx