I need to create an option at work to use mega menus, basically the designer should be able to set the level per columns for the mega menus so if there are 10 items under one category and the designer sets the level to 2 then the megamenu for that category should split into two columns of 5 items. What would be the best way to implement this using Asp.net C# and JQuery so it looks nice?.
Also, how can i do it so that if there are 10 items I can break it into columns of 5?
Relevant information:
- The data for the menu is comming from a table.
- The menu will be horizontal
I am not asking for the code but for the best approach and also the best way to go about this.
Thank you!
jQuery can certainly handle all the interactions.
If you're asking the best way to split out the links, I think the answer is do it whichever way is easier for your team. The client-side processing to split the list won't be that much, though it's nice to do it client side if you can.
Related
In my project I have the need to create a Form with 16 identical replicas of the same controls. So far I've managed to do this by just copying and pasting the controls and renaming them one by one, however this is becoming really inefficient and I feel like there must be a better method to handle this situation.
Down below there is an example of what I'm talking about: every line has the same controls that are handled exactly the same, have the same Items and only interact with each other within the same line.
Is there a way to create a modular group of controls that I can replicate and handle with a simple incremental index? The best would be if modifiying the original one would affect every copy of it!
I'm using Visual Studio Express 2013 for Windows Desktop and C# as programming language.
This kind of data calls for a DataGridView Control. It supports text, checkbox and combobox "out of the box", and you can add support for Numeric Up/Down Cell as described here: https://msdn.microsoft.com/en-us/library/aa730881%28v=vs.80%29.aspx
Creating a custom control as Johnny Mopp suggested (in the comments) was the best solution for my problem.
I want to display a dictionary on a form in an Outlook 2013 AddIn with VSTO in C#.
Actually I want to display two dictionaries, maybe a large dialog with 2 listbox or something to list the key value pairs, or two tabs each with a listbox or something to display one dict and one tab to display the other dict.
Anyone know the best way to accomplish this? I've tried all the methods I found online and none seem to work. I'm a bit stuck. Anyone know a good way to take achieve this? The dictionaries are created during the AddIn startup within the OutlookRibbon class. I can make them accessible from the outside if need be by making public properties if needed or just make the variables public.
This isn't part of my question, but I want to eventually perform CRUD operations on the dictionaries. If there is a better way to accomplish this than a form with buttons that will manually perform the operatins, I'm all ears. I am not using a database, this is a small addin and I need these dicts to be stored somewhere local and small. They have about 15-25 entries each so they are not big.
Any advice and short examples would be much appreciated and a huge help.
Thanks
I want to display a dictionary on a form in an Outlook 2013 AddIn with VSTO in C#.
I'd suggest using Outlook form regions in that case. See Creating Outlook Form Regions in MSDN for more information. It is up to you which controls to use on the form (depends on the business logic). .Net framework allows to use a lot of third party controls.
They have about 15-25 entries each so they are not big.
If you don't plan to store a huge amount of entries you may consider storing them in JSON or XML files.
We need a "dashboard" view for a trading application on a C# .Net WinForms application.
Currently the application pops up additional forms with price charts for each symbol (MSFT, GOOG, EUR/USD) for which the user has defined automated trading rules. But some users want to trade dozens or hundreds of symbols simultaneously. The application handles this performance-wise but this creates far too many separate charts on the desktop.
So the need is for a form with a list of information and controls for each of the symbols.
Please offer advice on selecting which controls to use for this.
Okay so here's some requirements:
The list needs to be scrollable.
On Each Row:
a) a button to maximize/minimize the chart for that symbol.
b) a button to pause or resume trading on a symbol as well as show current status.
c) A few columns of information like symbol, equity, position.
Future version: Rows sortable by the information columns.
Future version: Make each row "explandable" maybe with a plus/minus sign to
show additional detail like list of active orders or perhaps a mini "inline" chart
rather than separate popup.
One or more rows will be "portfolio" rows with similar columns to display combined
equity for its nested symbols and portfolios.
We need to implement this as quickly as possible so this rules out designing custom
controls (at least in this version)--So we want to use only the .Net standard controls.
We want to avoid 3rd party solutions unless it's open source.
Trickiest design question:
How to represent the relationships between the strategies and portfolios.
These relationships can be sophisticated with nested portfolios and a single portfolios
instance can be assigned to multiple parent portfolios. Note. The user can't
alter these relationship at run time...but it will be nice to represent this
visually. Can that be integrated into this control--like a tree view? The problem
is that a single portfolio or symbol can be nested inside multiple other portfolios.
So that doesn't seem to make sense for a tree view.
Another idea will be to pop up separate list views for each portfolio--yuck.
The best will be some clever idea to represent the relationships visually on the
same dashboard. Maybe not in this first version but perhaps a custom drawing
control that actually shows a column per portfolio with a vertical line showing
symbols or portfolio contained with tick marks? We'd like a simple yet
elegant solution.
The plan is to get something up and working with the minimum needs but also some forethought into how to get the portfolio relationship and other features in a next version w/o rewriting the whole thing.
if you know winform better then I think you can try to use some tab control ,nested tab control,resizable panel,etc for your dashboard with backgrounds workers thread control .
Is it possible to dynamically create an ItemTemplate for a repeater somehow?
I am trying to use a repeater since it allows the most control, but one of my requirements is making me reconsider.
I basically have a number of SQL queries that I do through a web service. Rather than having users type in the entire query I want them to be able to select "parts", "products", or "packages" via radio buttons, enter a search term in a text box, and some other info, and the page returns the results they want. I have this mostly done, the RadioButtons control logic, and I have the query set up to accept the input from the text box as a search term with wildcards. The only probelm is I am struggling with the repeater control. The problem is each one of the tables has a different number of columns and they have different names, so doing a
<td><%# DataBinder.Eval(Container,\"DataItem.Description\") %></td>
within the ItemTemplate is not possible(I don't know until bind time which one of the 3(possibly more in the future)templates to use)
I tried using a literal to pass in what I wanted based on logic in the codebehind, but I couldn't pass the inline functions, and I have been unable to put together how to do this based on an earlier question.
I have been reading the MSDN reference and it seems like if I learn the DataList control it will make things easier, but I'd rather not waste time on that if there's an easy way to do it with a repeater(which will also allow me more control)
Thank you
I may be off track here but I think an easy solution to the problem you're having would be to create multiple repeater controls with different items templates inside them and wrap them up in panels. That way depending on the user parameters you could simply databind your result to the proper repeater and set the other panels to invisible.
I was looking back through some old code for you to see how I've handled similar situations. Then I saw Jesse's answer right before I wrote my reply. Basically, I would tend to agree with Jesse there - that seems the most straightforward solution from what you've outlined.
So I don't know how much this helps, but one possibility would be to use MVC Templates. MVC is handy in that it can actually be used in a very limited sense (your entire app doesn't need to implement it, just the applicable page) and it's also pretty straightforward.
An introduction on how to do different templates within MVC: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html
It might be possible to modify the template so that it changes based on the object that it's bound to - like how a WPF DataTemplateSelector works.
I thought I remember seeing something in MVC3 or MVC4 that you could create a Template based on a datatype (like you can in Silverlight) and it would automatically pick that Template, but I'm having trouble finding that now.
I am working in a Visual Studio 2010 environment and I am looking for the most effective way to build a multicolumn list that will be displayed inside a jQuery Menu like:
I actually use a serverside DataList control that renders me a table with a RepeatColumns="3" attribute.
I would like to know the most efficient, frequently, most common technique to use for this purpose. I just look for guidelines :)
Thanks
You just need to render the content as show - it makes no difference whether it's inside a jQuery dropdown menu, or straight on a static page.
You can do this using a table or using CSS, depending on which you're more comfortable with. The DataList control renders - as you say - to a table, which presumably works fine. A lot of people will say that you should use straight CSS rather than a table, but for this example the content is fairly 'tabular' in nature so I don't see a problem with using a table.