several <ItemTemplate> in one ListView - asp.net

I saw a lot of examples of using ListView,but couldn't found simple,understandable example of using two (or more) ItemTemplates in one ListView (if it possible).I want to define them on .aspx page or to make programmatically,and,depending on my needs choose one of them (different templates for different binding data).Any idea? Thanks.

I hope this would help you achieve what you want?
http://blogs.msdn.com/b/mikeormond/archive/2008/07/26/dynamically-loading-listview-templates.aspx
Also go through this post to have some insight as well
http://forums.asp.net/t/1699218.aspx/1?ListView+ItemCommand+event+not+working+with+Dynamic+Templates

You can make one <ItemTemplate>with several panels inside, and then in code beind you make only one of them visible.

Related

Situations when you can need a Webusercontrol?

I'm making a small application where you can add and delete movies etc. Now i'm supposed to add a Webusercontrol to my webpage (yes this is schoolwork). Do you have any smart situations where you need a webusercontrol? Not a menu because I have made that in my masterpage alreay.
Thanks in advance!
Anywhere you need to reuse the same UI logic over and over again, is one good reason to do so. Or if you just need to break up the length of the page so it isn't so large from a visual perspective, that can sometimes be a reason to do so too.
A user control is a container, so you can contain grouped logic together. A menu can be a user control so the logic around it is grouped together, but doesn't have to be.
There is no hard and fast rule.

MVC3 - Multiple select process for a large list of items

Whats the best way to do the following in MVC3 (razor). User needs to pick one more more items from a List and click on button. The list can run into 40 to 100 items. Thats where my problem is, I am looking to see if there is any other solution (other than a list box) to do this more efficiently. Right now, I think I can do this by using a combination(or only one of) of an Auto complete text box and a list box in MVC3. Also how can I use list box in MVC3 with hard coded list tems.Any suggestions/ideas? Thanks in advance for your feedback.
You might want to take a look at using a list search functionality as described in this post it uses a jQuery plug in and you could always hook it up through an jquery ajax to get further data back from an MVC action method.
If this doesn't help then let me know and I'll try and put together an example in the morning.
Hope this helps.
Check out "jQuery UI Multiselect" http://www.quasipartikel.at/multiselect/

How to make an entire jqGrid disabled/readonly

How can I make an entire jqGrid disabled/readonly?
I have a page with a logical "edit section" which I show when the user selects something to edit, and hide when the user is done editing (save or cancel). While the edit section is shown, I disable several other elements on the page. I would like to disable their ability to click in the jqGrid, so they can't change selected rows, re-sort, etc. But I cannot find a way to disable/enable the grid as a whole.
Apologies if this has been answered already - other questions seemed to focus on disabling only certain behaviors within the jqGrid.
Edit: Preferably, I'd like an approach that isn't dependent on yet another 3rd-party addon. Nothing wrong with them, of course! But my client has a degree of reluctance with them, so my life would be a little easier with a purely jQuery/jQueryUI/jqGrid solution. :)
You could use blockUI to block the grid.
Try using $("#lui_" + myGridId).show().
The grid has created this overlay internally an uses it as one part of the loader message.
You can just show it or hide it and it will disable/enable the grid for you.

How to Customize ListView in QT

HI..
i am new to QT,i want to know how to customize the listview in QT i.e i want to add multiple icon in single row.. etc.. i tried lot i am not getting how to do that..
i tried with Qlistwidget, in tat i can only insert single row with one image.. i am not able to place multiple icon with desired locations..
please assist me, which control is good listview or listwidget.
and how to customize the same according to my view
if you have any sample examples. please provide me the link.
Thanks
You can implement a delegate to customize the rendering of the items in your view.
From the model/view programming docs: delegates are responsible for rendering individual items in the views.
See the pixelator sample for example usage.
Take a look at QTableView or QTableWidget. You can insert the icons in the first two columns and the text in the third column. Or any other way you like it.
I guess you can use some delegates.
Have a look at http://qt.nokia.com/doc/4.6/model-view-delegate.html
Hope it helps !

Flex collapsible field group control

I am trying to make a side panel in a Flex application that would hold a bunch of properties of a selected object. The number of properties may become huge, but they all fall into some certain categories.
For that, I am looking for a flex control that would be like a collapsible field group. Or like an accordion that can have multiple open panels at a time. Do you know, where can I get one?
UPDATE: I want something like the second example on the following page: http://extjs.com/deploy/dev/examples/form/dynamic.html
Thanks,
Artem.
http://www.flexdownloads.com/#view=detail;vstr1=19
is what you are looking for.
It sounds to me like you are looking for some sort of tree component. Flex actually has one of those and you should probably take a look at it.
This is a good link to see what controls are included in flex http://examples.adobe.com/flex3/componentexplorer/explorer.html

Resources