Search Results

Search found 13450 results on 538 pages for 'recent items'.

Page 51/538 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • WPF: "Items collection must be empty before using ItemsSource."

    - by Zack Peterson
    I'm trying to get images to display in a WPF ListView styled like a WrapPanel as described in this old ATC Avalon Team article: How to Create a Custom View. When I try to populate the ListView with a LINQ-to-Entities queried collection of ADO.NET Entity Framework objects I get the following exception: Exception Items collection must be empty before using ItemsSource. My code… Visual Basic Private Sub Window1_Loaded(...) Handles MyBase.Loaded ListViewImages.ItemsSource = From g In db.Graphic _ Order By g.DateAdded Ascending _ Select g End Sub XAML <ListView Name="ListViewImages" SelectionMode="Single" ItemsSource="{Binding}"> <local:ImageView /> </ListView> I put a breakpoint on that line. ListViewImages.ItemsSource is Nothing just before the LINQ assignment.

    Read the article

  • How to build C# object from a FormCollection with complex keys

    - by ob
    i have a javascript object, obj, that gets passed to an mvc action via a $.post() like so: var obj = { Items: [{ Text: "", Value: { Property1: "", Property2: "" }, { Text: "", Value: { Property1: "", Property2: "" }] }; $.post('MyAction', obj, function() {}); the action signature looks like this: public ActionResult MyAction(FormCollection collection) { } i need to be able to build an object from the FormCollection, however i'm running into an issue where the keys are in the form: "Items[0][Text]" "Items[0][Value][Property1]" "Items[0][Value][Property2]" "Items[1][Text]" "Items[1][Value][Property1]" "Items[1][Value][Property2]" i'm wondering if there's a clean way to build the desired C# object from the given FormCollection. i understand that i could change the action method signature to take in the type of object i'm interested in, but that was presenting its own issues.

    Read the article

  • Adding links to full change forms for inline items in django admin?

    - by David Eyk
    I have a standard admin change form for an object, with the usual StackedInline forms for a ForeignKey relationship. I would like to be able to link each inline item to its corresponding full-sized change form, as the inline item has inlined items of its own, and I can't nest them. I've tried everything from custom widgets to custom templates, and can't make anything work. So far, the "solutions" I've seen in the form of snippets just plain don't seem to work for inlines. I'm getting ready to try some DOM hacking with jQuery just to get it working and move on. I hope I must be missing something very simple, as this seems like such a simple task! Using Django 1.2.

    Read the article

  • Liqn to sql null-able value in query

    - by msony
    I need get all items what have no categories int? categoryId = null; var items=db.Items.Where(x=>x.CategoryId==categoryId); this code generate in where: where CategoryId=null instead of where CategoryId is null ok, when i write var items=db.Items.Where(x=>x.CategoryId==null); in my sql profiler it works: where CategoryId is null BUT when i do this HACK it doesn't: var items=db.Items.Where(x=>x.CategoryId==(categoryId.HasValue ? categoryId : null)); so what's the problem? is there by in L2S?

    Read the article

  • How do I echo the number of items in an array?

    - by Joel
    A total newbie question I know. I'm sing Zend framework, and sending an array from the controller: $this->view->googleArray = $viewFeedArray; In the view, I have a foreach loop that is populating a table with the array contents. <?php foreach($this->googleArray as $row) { ?> <tr> <td><?php echo $row['when']; ?></td> ... ... </tr> <?php } ?> It all works fine. At the top of the table, I want to list the number of items in the array. Something like (which doesn't work): <?php echo $this->googleArray->totalResults; ?> event(s) found How would I do that? Thanks!

    Read the article

  • SQL: many-to-many relationship, IN condition

    - by Maarten
    I have a table called transactions with a many-to-many relationship to items through the items_transactions table. I want to do something like this: SELECT "transactions".* FROM "transactions" INNER JOIN "items_transactions" ON "items_transactions".transaction_id = "transactions".id INNER JOIN "items" ON "items".id = "items_transactions".item_id WHERE (items.id IN (<list of items>)) But this gives me all transactions that have one or more of the items in the list associated with it and I only want it to give me the transactions that are associated with all of those items. Any help would be appreciated.

    Read the article

  • Searchbar to search array items and displays them on a tableview?

    - by skiria
    I want to build an app that shows a empty tableview. Then users can write a text on a searchbar and when they click on Search button the tableview will be written with array items founded. I've see this tutorial: link text, but I only need to search when user click SearchButton. How can I do this? What methods do i have to use? I've tried with this method, but it doesn't works. - (void) searchBarSearchButtonClicked:(UISearchBar *)theSearchBar { NSInteger nVideos = [appDelegate.allVideos count]; NSLog(@"number of videos: %i", nVideos);

    Read the article

  • Django Grouping Query

    - by Matt
    I have the following (simplified) models: class Donation(models.Model): entry_date = models.DateTimeField() class Category(models.Model): name = models.CharField() class Item(models.Model): donation = models.ForeignKey(Donation) category = models.ForeignKey(Category) I'm trying to display the total number of items, per category, grouped by the donation year. I've tried this: Donation.objects.extra(select={'year': "django_date_trunc('year', %s.entry_date)" % Donation._meta.db_table}).values('year', 'item__category__name').annotate(items=Sum('item__quantity')) But I get a Field Error on item__category__name. I've also tried: Item.objects.extra(select={"year": "django_date_trunc('year', entry_date)"}, tables=["donations_donation"]).values("year", "category__name").annotate(items=Sum("quantity")).order_by() Which generally gets me what I want, but the item quantity count is multiplied by the number of donation records. Any ideas? Basically I want to display this: 2010 - Category 1: 10 items - Category 2: 17 items 2009 - Category 1: 5 items - Category 3: 8 items

    Read the article

  • jQuery Validate - Require at least one from group, plus additional items.

    - by Kevin Pullin
    I'm attempting to use 'jQuery Validate' on a form that requires an email address plus either all items of a shipping address completed or none at all. Using the sample provided by the solution to this question: jQuery Validate - “Either skip these fields, or fill at least X of them”, I have been able to successfully solve the validation of the address group. The problem, however, is that the logic for validating the email address field does not work. From debugging the Validate scripts, the "re-entrant" validation code triggered by calling 'fields.data('being_validated', true).valid();' in the linked example results in a reset of all previously validated errors (i.e. the email validation error is cleared). I have modified some existing samples, the first in which removes the offending line and the second with it included. Email Validation Working Email Validation Fails Any tips or suggestions on how to properly solve this or work around the failure?

    Read the article

  • Pure CSS Dropline Menu - second level menu items sit below their parent - but sometimes extend off s

    - by Simon
    Hi, I'm working on a pure css menu that consists of four levels Level 1 and 2 are a dropline menu in style Levels 3+ are dropdown menus When you hover over a level 1 menu item, the level 2 menu displays directly below menu item you are currently hovering over. However if there are lots of menu items on level 2 then the level 2 menu goes off the screen and you see a horizontal scroll bar. What I want to happen is that if the menu is going to go off the screen I want it to get pushed to the left. For example, if the menu was 300px long, but there was only 250px between the level 1 menu item and the edge of the page, then the level 2 menu should not be placed directly under the level 1 parent, instead it should be 50px to the left. I use a nested unordered list for the menu.

    Read the article

  • ASP.NET ListView: how to insert "particular" item each N items ?

    - by stighy
    Hi at all, i would like to do a "weird" thing with the asp.net listview control. I would like to insert advertising each 8-10 item of the listview (databounded with a database table) : for example each 8-10 item insert the google adwords jscript code. I've googoled but i haven't found anything. Someone know if it's possible to "tell the listview: each 8 items, show this item (google jscript code). Excuse me for my poor english. Hope to be explained, thanks!

    Read the article

  • JSF: attach rich:toggleControl to radio buttons or select items.

    - by arw
    Has anyone had any success attaching a rich:toggleControl component to a radio button component (h:selectOneRadio) or alternatively any of its children select items (in this case s:enumItem). Basic code example: <h:selectOneRadio value="#{backingValue}"> <s:enumItem enumValue="VAL_1" itemLabel="Value One" /> <s:enumItem enumValue="VAL_2" itemLabel="Value Two" /> <s:convertEnum /> </h:selectOneRadio> The ideal thing would be to attach the toggle control to the enumItems so I could have it switch to a particular state. However at this point I'd be happy if the toggle control can just be attached to the selectOneRadio. I've tried the toggle control as a child of the selectOneRadio and enumItems; neither works. I've also tried wrapping the toggleControl around the selectOneRadio, the toggle control works in this case but the radio buttons don't :(

    Read the article

  • Can you explain this odd behavior with dragging items into nested sortables?

    - by RDL
    I have the following setup: A sortable list where one of the <li> has a table with lists in each cell. All of the lists are sortable with each other. Draggable items that can be added to any of the sortables Issue: When adding a draggable item ('drag 1', 'drag 2', 'drag 3') to one of the lists in the horizontal lists (table of lists) it duplicates the draggable when dropped. Sometimes it will create both copies in the same list or one in the item list and one in the column list. Here is a demo: http://jsfiddle.net/MQTgA/ Question: How do I prevent the second item being created when dropping the draggable?

    Read the article

  • Adding a searchbar to display array items on a tableview?

    - by skiria
    I want to build an app that shows a empty tableview. Then users can write a text on a searchbar and when they click on Search button the tableview will be written with array items founded. I've see this tutorial: link text, but I only need to search when user click SearchButton. How can I do this? What methods do i have to use? I've tried with this method, but it doesn't works. - (void) searchBarSearchButtonClicked:(UISearchBar *)theSearchBar { NSInteger nVideos = [appDelegate.allVideos count]; NSLog(@"number of videos: %i", nVideos);

    Read the article

  • How do I manage permissions on multiple items in SharePoint 2007?

    - by mk
    I'm relatively new to SharePoint and am trying to put a bunch of Word files (that were on our network file server) into SharePoint. We have set up a document library that, by default, gives everyone access to everything. This is the desired top-level permission set because most items will work well this way. The problem is that I have a bunch of documents I want to add and apply some specific permissions to. I can do this, but...please tell me there is some way I can do this for multiple documents at the same time. Attempting to do this one-by-one is a pain and I'm hoping for a better solution here. Thanks very much in advance.

    Read the article

  • Getting repeat values after copying 2-3 items to clipboard in android?

    - by Gurpreet singh
    I am using clipboard code like below in my app.Everything is working fine if i copy one item at a time.But when we copy 2-3 items one after other and paste somewhere it starts retrieving repeated past value from clipboard rather than the current value.After googling a lot i came to know that its a problem with Samsung phones and i need to clear clipboard history for that.But i could not find any way to clear clipboard history. Public void CopyToClipboard { int pos = (Integer) v.getTag(); StatusEntity obj=getItem(pos); ClipboardManager clipmanager= (ClipboardManager)getContext().getSystemService(getContext().CLIPBOARD_SERVICE); ClipData clip=ClipData.newPlainText("data",obj.getStatus()); clipmanager.setPrimaryClip(clip); Toast.makeText(getContext(), "Copied to clipboard", 1000).show(); } Hoping that anyone of you can help me regarding this .Any help would be appreciated.

    Read the article

  • jquery: adding class on to list-items only on mouseover-remove on mouse-out?

    - by user239831
    hey guys, what's the best way to do that: i have a list <ul> <li>hello</li> <li>good bye</li> <li>arrivederci</li> <li class="selected">dude</li> <li>whatever</li> </ul> Initially one item already has a class of .selected applied. When i hover over one of the list-items i want this one to have the .selected class. So every item should only have the class applied when im over, as soon as i leave the item the class get's removed and the next one has the class.

    Read the article

  • Drupal 6: pre-defined variable for amount [count] of custom type items...

    - by artmania
    Hi friends, I'm a drupal newbie... I researched but couldnot find :/ is there any predefined variable that gives my CCK field value count? for example; I have field_logo_sponsor and I need to display all logo items. Now I have 5 item <?php print $node->field_logo_sponsor[0]['view'] ?> <?php print $node->field_logo_sponsor[1]['view'] ?> <?php print $node->field_logo_sponsor[2]['view'] ?> <?php print $node->field_logo_sponsor[3]['view'] ?> <?php print $node->field_logo_sponsor[4]['view'] ?> it is stupid to use it that way :/ if there is any count variable for that, I will just create a loop for that and display them in a for or while loop Appreciate helps! thanks a lot!

    Read the article

  • When marking an item (changing background color) in ListView it's repeating for other items.

    - by Adi
    If I want to mark the second item I'm doing the following code: This code is from my Adapter that extends ArrayAdapter : if (convertView == null) { LayoutInflater mInflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(R.layout.channel_list, null); } MyContent o = items.get(position); if (o != null) { TextView tt = (TextView) convertView.findViewById(R.id.toptext); TextView bt = (TextView) convertView.findViewById(R.id.bottomtext); if (tt != null) { tt.setText(o.Top()); } if(bt != null){ bt.setText(o.Bottom()); } if(position == 2) { convertView.setBackgroundColor(R.color.selectem_color); } } return convertView; It will show the list view but mark every 9'th item after this item (the 11'th item 13'th and so on). Does anyone know what's the reason?

    Read the article

  • How do I dynamically add and remove line items from an ASP.NET MVC view?

    - by Mike Roosa
    I have a PurchaseOrder model: public class PurchaseOrder { public string OrderNumber { get; set; } public string Customer { get; set; } public IList<LineItem> Lines { get; set; } } and a LineItem class: public class LineItem { public string PartNumber { get; set; } public int Quantity { get; set; } } What I want to do is on my view for the PurhcaseOrder Create action, I need a section for line items. The user should be able to add a new line, remove a line, then submit. One caveat is the PartNumber needs to be a dropdown list of valid parts. What can I do to accomplish what I'm looking for?

    Read the article

  • In SQL, why is "Distinct" not used in a subquery, when looking for some items "not showing up" in th

    - by Jian Lin
    Usually when looking for some items not showing up in the other table, we can use: select * from gifts where giftID not in (select giftID from sentgifts); or select * from gifts where giftID not in (select distinct giftID from sentgifts); the second line is with "distinct" added, so that the resulting table is smaller, and probably let the search for "not in" faster too. So, won't using "distinct" be desirable? Often than not, I don't see it being used in the subquery in such a case. Is there advantage or disadvantage of using it? thanks.

    Read the article

  • How can I get all the checked items from a submitted form with sinatra's params?

    - by 102405176597896213397
    I'm running Sinatra 1.0 with HAML, my form has a number of checkboxes, for example books I like, and you would select all the books you want. The checkbox name is "books". In sinatra params['books'] there should be an array of all the books that were checked, but it only has the last item that was checked, not an array. How can I get all the checked items? HAML: %form{:action => "/test", :method => 'post'} %input{:name=>'check',:type=>'checkbox',:value=>'item1'} item 1 %input{:name=>'check',:type=>'checkbox',:value=>'item2'} item 2 %input{:name=>'check',:type=>'checkbox',:value=>'item3'} item 3 %input{:type => "submit", :value => "send", :class => "button"} Sinatra get method post '/test' do puts params['check'] #should be an array but is last item checked end

    Read the article

  • What is the correct way to customize Icon and Text position of items in a QListView?

    - by petermcg
    I'm using C++ and Qt's (4.6) model/view framework and wondering what is the correct way to change the display of items in a QListView or a class derived from QListView from: to: I'm not concerned about the sort order or Flow, I'm interested in the best way to correctly position the text to the right of the icon. If this can only be done by writing a custom QStyledItemDelegate that's totally fine, I want to rule out whether this is the correct approach or whether it's best to look at setLayout or similar, example code would help. The example application I'm looking at is the 'interview' example from qtdemo which amongst other things displays icons and text in a QListView.

    Read the article

  • PHP, how can I produce a string, a unique list of values up to three items, for use after IN in a query?

    - by Jules
    I need to produce a string for use in an query e.g. SELECT whatever from Keywords.word IN (here); At the moment I have string which could be $search = "one word or four"; or $search = "one"; or $search = "one one"; I need to validate this into some acceptable for my query. I want a unique list of words, separated with a comma up to a maximum of three. This is what I have so far. $array = explode(" ",$search); $unique = array_unique ($array); I'm sure there must be a quicker way than evaluating each of the items for blank and selecting the first three.

    Read the article

  • Problem with multi-table MySQL query

    - by mahle
    I have 3 tables. Here is the relevant information needed for each. items prod_id order_id item_qty orders order_id order_date order_status acct_id accounts acct_id is_wholesale items is linked to order by the order_id and orders is linked to accounts via acct_id I need to sum item_qty for all items where prod_id=464 and the order stats is not 5 and where the is_wholesale is 0 and the order_date is between two dates. Im struggling with this and would appreciate any help. Here is what I have but it's not working correctly: SELECT SUM(items.item_qty) as qty FROM items LEFT JOIN orders ON orders.order_id = items.order_id LEFT JOIN accounts on orders.acct_id = accounts.acct_id WHERE items.prod_id =451 AND orders.order_date >= '$from_date' AND orders.order_date <= '$to_date' AND orders.order_status <>5 AND accounts.is_wholesale=0; Again, any help would be greatly appreciated!

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >