(C#/SQL/Approach-question)
This has to be one of the hardest nuts I've ever had to crack. So I sincerely hope one of you smart people out there have tried to solve this before! :)
I have a much of categories (A,B,C) with pictures.
For each picture I need to ascribe some information, based on some controls that have either no- or predefined options. For instance in category A I have a textbox where you can enter anything you want, and a dropdownbox where you can choose between 3 options.
Now, for each category I would like to be able to design (decide) which controls (text, select, checkbox, radio, etc.) I want to ascribe to a category, and I want also to be able to decide what values apply to that control. Let's say I have a select-control, and I want to be able to decide if multiple select are allowed, and which values are available.
So the end product would be:
I can administrate what categories have which controls in them, and which options are available (i.e. single or multiple select) as well as which values are ascribed or allowed.
I need to be able to store this information in a persistable fashion.
I need to be able to "easily" parse the return-data from the page where the controls are rendered.
I realize this is a complicated question, and I will be happy to answer any questions you might have to help clarify the problem.
Thank you in advance!
You could separate the render part (dynamically generated) apart from what to render(based on categories).
Assuming you will use winform controls.. you could have a config file or a simple SQL table that follows schema below:
Table_Category (CategoryName, nickNameOfControl, NotNull, OtherAttributes)
Table_Control (nickNameOfControl, ControlType, Values)
Based on your actual table design, you will be able to CRUD on the tables design time for administration, your render part of the program can read the ControlType information (TextBox, ComboBox etc) and dynamically generate the controls at run time.
Hope this helps.
Related
Is it possible to add a field or a group of fields in a content type in Orchard that acts like a list?
Specific example:
Event content type has a text field speaker. But since we can have multiple speakers in an event we can add more text fields dynamically through, preferably, a plus (+) sign icon. An alternate could then go through the list and display them accordingly.
Is this possible?
I'm trying to create a content type Guide which can have varying number of steps. A step can have multiple fields (title, html, thumbnail, etc).
Thanks!
Any piece of advise or information would be highly appreciated.
There is an Enumeration field that allows you to choose one/more from the list of provided string values.
How about a ContentPickerField? Or maybe using Taxonomy?
In case anyone needs it, the best one for this scenario is building a 1-n relationship yourself: http://docs.orchardproject.net/Documentation/Creating-1-n-and-n-n-relations
The Content Picker field as suggested by Tanooki also works, but you have more control when using 1-n relationships.
I have a bit of a 'what is it' question.
Currently, I am trying to create a page that will create teams, and allow the user to select the member for those teams.
So far, dynamically render ListBoxes (amount based on teams selected) to the page, then the user selects a member, and adds them to the team.
I want to allow for an x amount of teams added, but this will get messy with the amount of list boxers that could possibly be added.
I would like to know if there is a view that could represent that in once clean environment. I would like do display the team name, in the header, and its member beneath - with editing options on them. I've looked up the GridView and ListView, but I cant see how they could do exactly as i wanted. I have provided a highly refined picture to help elaborate.
Edit: This is not a 'how do I do this - gimmie code question. I would just like to know IF it could be done, and if so, what control I could use. Mayb even a reference to a page with something similar to give me a quick tutorial ^^
Have a look at the Repeater web forms control. You can nest them.
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
Currently, I'm in the process of making a custom solution for invoicing. I have created multiple ways for customers to create their template (HTML, Word, LaTex) and get invoices according to their template. However, these invoices are party manually generated.
So, the process is:
Request to create a new invoice
An preliminary invoice is created
The user gets a chance to make changes (i.e. add, remove, change rows)
Create a pdf
Just to be clear, the preliminary invoice does not need to be formatted as the template is, but you should be able to add/remove/change rows and for every cell, indicate whether the value should be visible in the final result.
My problem is that i cannot find a suitable way to display the preliminary invoices. I tried a datagrid (default, telerik, devexpress), but it's too messy. Besides a datagrid, i have no idea what i can use.
What controls can i use best to have a nice and usable UI.
Please don't be like this:
alt text http://bitsandpieces.us/wp-content/uploads/2008/03/imagesapple-20google-20and-20you.png
A typical UI paradigm for this kind of thing is to view it as two separate problems: giving the user a way of viewing the elements that he can modify, and giving him the ability to modify any specific element. You use a list control (ListBox, ListView, maybe TreeView if the elements are organized hierarchically or need to be grouped into categories) to present the elements, and then when the user selects an element the program presents a tabular presentation of field names and editable value controls.
Basically, you're dividing the program's functionality into two categories: stuff that the user wants to do to rows (add, remove, re-order, select) and stuff that the user wants to do to the selected row's elements.
You can mush these two sets of functionality into one if you use a DataGridView, but as you've seen that gets pretty ugly if there's any complexity to the elements you're editing.
Two possible approaches to this: the property-sheet paradigm (select object, right-click, select "Properties", edit values in a modal dialog), or a paradigm where the window's split into two panels, with one being the rows and the other being the details of the currently selected row. There are lots of others.
What is your platform? Winforms? WPF?
What exactly did you dislike about using a datagrid for this? Part of the problem is that whether you like it or not, you're going to be coding a datagrid - you essentially described features of one. If at all possible try to use someone else's datagrid because it will save you a lot of work. Typically, 3rd party datagrids should be fairly customizable, and you should be able to make it look however you want - and take advantage of the built in sorting, editing, grouping, etc. Creating a datagrid-like control from scratch isn't easy and should be avoided if possible.
You don't have to have a plain giant datagrid - you can crate a custom control that displays the invoice formatted however you like, with a live datagrid appearing only where the invoice shows tabular data, formatted to appear as an integral part of the invoice itself.
I'm doing something similar, where the client can edit or even remove the line items for the invoice prior to sending it to the client.
The current app they run their business on is a WebForms Intranet application, so this is an extension to that. So they can add/remove/edit rows fairly easily.
But Egor is right. You're essentially talking about a datagrid no matter what you do. I take it you want something 'cleaner' and more intuitive?
Simplicity is difficult.
I would take a look at what is already out there, especially for invoices, and see how they are doing it.
Not sure how big your company is, but it never hurts to take advantage of the large company applications and user interfaces, the pour thousands/millions of dollars into user interface design and testing.
I would take a look at any of the following (most offer a free trial, or just try searching for screenshots):
www.freshbooks.com
www.invoicera.com
www.getcashboard.com
www.simplifythis.com
Just some ideas ... hope this helps!