Variable number of categories/checkboxes - asp.net

I am building a form for parents to enter health information for their students. Our nurses want to build it similar to what you fill out when you see a new doctor where they have categories and then conditions within the category that you would check if they apply to you. They want the number of categories and conditions to be variable so they can change them willy nilly as desired.
I need some ideas as to how to approach the UI side. My initial thought is a parent gridview with a row for each category and then inside that, a child gridview for each condition with its own checkbox. I already do a bit of work with gridviews and know how to access the nested objects so I'm not terribly worried about how to get the data back.
My question is this: Is there a better way and what suggestions would the community make that might be different or more efficient than using nested gridviews?

+1 for asking is there a better way?
What I'm about to suggest may end up being a little more complicated at first, but rest assured it will be worth it in the end.
There is a JavaScript framework named Knockout.js that is perfect for situations like these. Knockout vastly simplifies situations that where a variable amount of UI controls are needed.
http://knockoutjs.com/
Here is a tutorial on the website that has a similar situation to yours:
http://learn.knockoutjs.com/#/?tutorial=collections

Related

OpenUI5: Grid: Does it support Groupings?

I am looking at various widget libraries, and ran across OpenUI5. It appears to be reasonably complete. The one thing I can't seem to find is any grouping functionalities for Grids. For example, in other grids, I can grab a column, and drag/drop it into the header portion of the grid, and now my data is grouped by that column. I can do this for multiple levels. After doing this, the data is laid out almost like a combination tree/grid control. I find this very valuable. Does OpenUI5 support this? If not, is it in the plans? Here is an example
OpenUI5 has two main Table controls, one for it's Mobile-oriented library (sap.m), and one for it's Desktop-oriented library (sap.ui.table).
These table's do support drag-and-drop of columns, but for re-ordering not for grouping.
The merging feature of the sap.m table may be of interest, though it's not really the same as grouping. Also note the multi-header feature.
Another control similar to your use-case could be the TreeTable.
But, in short, it does not look like out-of-the-box OpenUI5 has a control that exactly matches your use-case.
I will say that it is pretty easy to extend OpenUI5 controls as they have a nice OO-flavored jQuery extension approach.
You could also open an issue on their GitHub page to make this a priority for a future release.

Best component to show three columns

I am struggling myself thinking about which component to use in my new app.
The first screen I am using Collection View with big images. Once the user touches one cell, it goes to the second screen ... and here is the problem.
I have three columns, similar to a dictionary with first language, second and third. The user will be able to choose which column he wants to search, and according to his criteria it will show the result that matches. I am not sure how to implement this, which component gives the best experience to the user. Any idea is more than welcome. Thank you in advance. Alex
If your data is several rows each with 3 columns, I would recommend customizing a UITableView. I followed this tutorial when I was trying to set up something similar.
The Table View will also give you efficiency if you have a lot of data, and you can build the custom table cells in the interface builder so that makes life a little easier.
-Ken

To bind or do not to bind

What's the difference between these code samples? Which approach is right?
<asp:Label ID="lblShorName" runat="server" Text="<%#Customer.ShorName%>" />
lblShorName.DataBind();
and
lblShorName.Text = Customer.ShorName;
There isn't much of a difference that I know of (though I'll be interested in other people's answers to correct me if I'm wrong on that). It's just a matter of coding style and preference.
Personally, I prefer the latter. I feel that it's cleaner and separates the markup from the functionality which drives the markup. But that's just me.
(I also tend to prefer not using data binding where I don't feel I need to. But, again, it's a preference of how you want to use the tooling that's provided. For example, in an ASP.NET MVC view I'm more likely to write a loop and output HTML within that loop than I am to use any kind of repeater or grid control and bind data to it. Just personal preference.)
A lot of it also comes down to where in your application you want to perform these actions. The former example keeps it on the page, whereas the latter example can be wrapped in conditionals, re-factored into another method, etc. If it's possible that the value in question isn't always going to come from Customer.ShortName then I'd go with the latter example to add that additional logic around it.
The approach depends when you want to set the label. lblShorName.Text = Customer.ShorName; Can be used in different methods, events, timers. If you want to set it only at the beginning you can use the first one.
Not much really, when you use databinding your value is set at the time of databinding, however if you set it in the code-behind you can set it any stage of the pages lifecycle.
You may have some logic behind the value too and this is more readable/maintainable in the code-behind.

Is it possible to create a table with a multi-level row using ASP.NET GridView or other control

I'm not sure if I'm using the correct terminology to describe my questions so I created a few mock ups to try to show what I am trying to do.
I have an existing table listing order detail information that looks something like this:
I have some additional attributes I want to add columns for, but I would like it to appear on a separate line as part of the same row sort of like this:
The reason I want to add these columns but have them appear on the second line of each row is that I want to display more data in each row but I don't want to make the row/page wider.
I did some googling for this problem, but I'm not even sure what the standard name for this type of display is so I wasn't able to come up with anything. The closest I found was [this code project link](http://www.codeproject.com/KB/webforms/MasterDetail.aspx
) which is close to, but not the same thing I am trying to do.
Not sure what to call it either (multiline gridview?) but it should be possible. I would suggest looking at making a grid with a template column and a formview inside the template. In the rowdatabound event of the grid you write code to bind your form to the row's data. I have used this technique before on nested grids, it should work with other controls as well. Might be simpler ways to do it too, not something I have had a need to work out before.
EDIT:
I just saw a similar question where someone provided a link to this article. Not quite what we were talking about here, but very similar. Thought I would include it here as well for future reference. To bad it was written 5 months after this question was asked...

Good way to allow people to select a lot of things?

I'm using jQuery, ASP.NET, SQL Server, and the other usual suspects to design a company CRM. After they put in contact info, notes, dates, places and so forth they have to be able to select many different people to be "CC'ed." A group of people will be required to be one either "CC'ed" or "ToDo." The rest of the people can be nothing or "CC" or "ToDo." Currently we have it set up as a huge databind to templates with radio buttons for each option. Looks like shit. Anyone have any suggestions? I'd like to use a template with a datasource and have a good way to retrieve their answers and use them.
I'm leaning jQuery direction but like I said I'll need there to be up to 3 possible options for the people. This is going to be all opinion so I'm just looking for options.
Just to re-clarify, this concept is similar to email but I don't want them to have to type anything in as it is a set group of names that they're allowed to select from.
Looking for quick simple and pretty. somewhere in the range of 120 names.
If you intend to look down the jQuery route, I suggest that this widget could possibly help you out (even if only for inspiration sakes). http://quasipartikel.at/multiselect/
I'm struggling to "visualize" your form for terms of "real-estate expendature" etc.
Not directly what you are looking for, but this plugin may help
http://devgrow.com/slidernav-jquery-plugin/
Typing with intellisense. Sorry - any graphical thing will look overloaded.
Or: A table with filter options on top (again, typing). THere simply is no other way.
What I would most likely do to achieve this is implement the auto filter pattern that you type in a text box a few letters of the name and then it would filter down all of the overall results to those containing that pattern. Then have a select all button that will let you check all of them, and then the user can manually uncheck a few instead of having to check all.
The other thing to do would be to offer some type of categorization of the data so that they could filter by category that would put people in probable groups that would want all them all together. Like IT, HR, Executive or something similar.

Resources