Search Results

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

Page 94/538 | < Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >

  • ASP.NET MVC Filters: How to set Viewdata for Dropdown based on action parameter

    - by CRice
    Hi, Im loading an entity 'Member' from its id in route data. [ListItemsForMembershipType(true)] public ActionResult Edit(Member someMember) {...} The attribute on the action loads the membership type list items for a dropdown box and sticks it in viewdata. This is fine for add forms, and search forms (it gets all active items) but I need the attribute to execute BASED ON THE VALUE someMember.MembershipTypeId, because its current value must always be present when loading the item (i.e. all active items, plus the one from the loaded record). So the question is, what is the standard pattern for this? How can my attribute accept the value or should I be loading the viewdata for the drop down in a controller supertype or during model binding or something else? It is in an attribute now because the code to set the viewdata would otherwise be duplicated in each usage in each action.

    Read the article

  • Combobox population problem

    - by Luke
    So I have a combobox - the designer code: this.cmbStatusBox.Items.AddRange(new object[] { "Ordered", "Cooking", "In-transit", "Delivered"}); The formload code: if (mainForm.boolEdit == true) { this.cmbStatusBox.Items.AddRange(new object[] { "Cooking", "In-transit", "Delivered"}); } else { this.cmbStatusBox.Items.AddRange(new object[] { "Ordered"}); } As you can see, I am trying to make the combobox have different values. As things stand, i get both whats in the designer and in formload in the comboboxes. How can i stop this? I also have an edit function, so when i edit a record, i want the combo box to be populated by what is already saved. Just a random question, can you stop the user entering a value that isn't in the combo box? Thankyou

    Read the article

  • parsing a xml to get some values

    - by Joan Silverstone
    Hello, i have this xml: http://www.managerleague.com/export_data.pl?data=transfers&output=xml&hide_header=0 These are player sales from a browser game. I want to save some fields from these sales. I am fetching that xml with curl and storing on my server. Then do the following: $xml_str = file_get_contents('salespage.xml'); $xml = new SimpleXMLElement($xml_str); $items = $xml->xpath('*/transfer'); print_r($items); foreach($items as $item) { echo $item['buyerTeamname'], ': ', $item['sellerTeamname'], "\n"; } The array is empty and i cant seem to get anything from it. What am i doing wrong?

    Read the article

  • wp7 odata v2 dataservicestate save and restore methods tombstoning example needed

    - by MIantosca
    I am looking for an example of how to use the new DataServiceState Save and Restore methods in a WP7 application in order to tombstone a datacontext - I cannot find any examples and the approach I used resulted in an exception this saves the data context correctly PhoneApplicationService.Current.State["DataContext"] = DataServiceState.Save(this.Model.Entities); this attempts to restore it after the app is re-activated var dc = (PhoneApplicationService.Current.State["DataContext"] as DataServiceState).Restore(); but throws an exception An item could not be added to the collection. When items in a DataServiceCollection are tracked by the DataServiceContext, new items cannot be added before items have been loaded into the collection. This is the same exception I get if I try to reload a datacontext that I stored "directly" (without using the DataServiceState.Save method) in the PhoneApplicationService.Current.State. I cannot find any offical documentation on the new ODATA v2 DataServiceState class or examples. thanks Michael

    Read the article

  • jQuery - getting the id of the item selected

    - by John Leonard
    I have a basic jQuery selector question. Let's say I'm parsing JSON and generating a row of data for each item in my result set. On each item row, I want an action button. What is the best practice to script that button so its click action can reference the data specific to that row? Starting with the block below, how do I generate a 'Click Me' button that when clicked will alert with its json data? $.getJSON(url,params,function(json){ if(json.items){ $.each(json.items, function(i, n){ var item = json.items[i];

    Read the article

  • How to code an efficient blacklist filter function in php?

    - by achairapart
    So, I have three arrays like this: [items] => Array ( [0] => Array ( [id] => someid [title] => sometitle [author] => someauthor ... ) ... ) and also a string with comma separated words to blacklist: $blacklist = "some,words,to,blacklist"; Now I need to match these words with (as they can be one of) id, title, author and show results accordingly. I was thinking of a function like this: $pattern = '('.strtr($blacklist, ",", "|").')'; // should return (some|words|etc) foreach ($items as $item) { if ( !preg_match($pattern,$item['id']) || !preg_match($pattern,$item['title']) || !preg_match($pattern,$item['author']) ) { // show item } } and I wonder if this is the most efficient way to filter the arrays or I should use something with strpos() or filter_var with FILTER_VALIDATE_REGEXP ... Note that this function is repeated per 3 arrays. However, each array will not contain more than 50 items.

    Read the article

  • Windows Mobile 6.5 flick (scrolling with inertia) not working

    - by GRR
    After upgrading to windows mobile 6.5, my ListView control does not work properly with custom items (rows with alternate colors) and the new gesture mechanism... On a mobile device, if the user initiates a flick or pan, after scrolling the first few items, the last items are not shown on the screen, but will show up if the user explicitly taps on them -- so basically the last screen is just white. The WM_DRAWITEM message is sent to all children though, but they just don't show up on the screen. Scrolling with a bar works fine. Any ideas? I have seen some reports of similar behavior from other users, but not sure if this is a bug in the listview control itself or if there is something else that needs to/can be implemented to support flick and pan actions. The application code currently doesn't handle WM_GESTURE messages, so the flick action is done with Microsoft's own code to support legacy applications. Thanks!

    Read the article

  • Drupal: How to render a form and table on same page

    - by Aaron
    Can someone help me render a form and table on the same page? I'm sure it's easy, but can't think of how to do it. Here's hook_menu: function ncbi_subsites_menu() { $items = array(); $items['admin/content/ncbi_subsites'] = array( 'title' => 'NCBI Subsites Module', 'description' => 'Informs Drupal about NCBI subsites as defined by the Content Inventory database', 'page callback' => 'ncbi_subsites_show_main_page', 'access arguments' => array( 'administer site configuration' ), 'type' => MENU_NORMAL_ITEM, ); return $items; } Here's the callback: function ncbi_subsites_show_main_page() { $subsites = ncbi_subsites_get_subsites_from_inventory(); // fnc returns associative array from inventory, defined in include return ncbi_subsites_make_table( $subsites ); } In the callback I call some helper functions that return a themed, paged table. What I want is a small form above the table. How would I that?

    Read the article

  • Looking for ideas on automatically arranging a set of objects (furniture) in a virtual room in AS3

    - by raf
    First of all, I don't want to visually arrange 3D models dragging them with the mouse, all I want is: Given a room of certain dimensions (L,W,H) and given a set of elements like beds, chairs, etc (with L,W,H dimensions, of course) I want to automatically arrange those elements to take advantage of the space as much as I can. So I want to be able to put as much furniture as I can in a given room. At the end I need to represent the arranged items visually, inside the room. My first thought was to use an array of items and sorting it with array.sortOn(["l","w","h"] Array.NUMERIC) and then define a gap between the objects and make the maths to put the objects one next to another, etc. but that isn't a good approach because some items may be placed on top of another ones (boxes of the same size, boxes on top of tables, etc). I really don't have experience on 3D programming, that's why I'm asking for help. Thanks in advance.

    Read the article

  • How do I mimic Windows Explorer multi-select/drag-n-drop behavior in a DataGridView?

    - by bsh152s
    I'm trying to mimic the way Windows Explorer handles multiple selection. In a default DataGridView, you can select multiple items using Ctrl-click. But if you release the Ctrl key and then try and drag/drop the selected items, it clears the selected items and only selects the "hit" row. I found the following solution somewhere online. protected override OnMouseDown(MouseEventArgs e) { int hitRowIndex = HitTest(e.X, e.Y).RowIndex; if(!SelectedRows.Contains(Rows[hitRowIndex])) { base.OnMouseDown(); } } However, this causes other side effects. With the CTRL key pressed and mousing down on a selected item, the item remains selected. This makes sense because the mousedown event is bypassed if the row clicked on is selected. From looking at the behavior of Windows Explorer, it looks like the deselection of an item with the CTRL key held is not handled until the MouseUp event. Has anyone tried to do this?

    Read the article

  • Getting Memory allocation problem at UIBarButtonItem in Iphone sdk.

    - by monish
    Hi guys, Here I am getting memory allocation problem at UIBarButtonItem and the related code for that is: toolbar = [UIToolbar new]; toolbar.barStyle = UIBarStyleBlackOpaque; [toolbar setFrame:CGRectMake(0, 350,320,20)]; [self.view addSubview:toolbar]; UIBarButtonItem* barItem1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:@selector(categoryConfig:)] ; rightBarItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(dialogOtherAction:)] ; UIBarButtonItem* barItem2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:@selector(categoryConfig:)] ; NSArray *items = [NSArray arrayWithObjects: barItem1,rightBarItem,barItem2, nil]; [barItem1 release]; [barItem2 release]; [rightBarItem release]; [toolbar setItems:items animated:NO]; after adding UIBarButtonItems into the array items I released them.even though its showing allocations at barbuttons. can any help me for this? Thank you, Monish.

    Read the article

  • MySQL Query still executing after a day..?

    - by Matt Jarvis
    Hi - I'm trying to isolate duplicates in a 500MB database and have tried two ways to do it. One creating a new table and grouping: CREATE TABLE test_table as SELECT * FROM items WHERE 1 GROUP BY title; But it's been running for an hour and in MySQL Admin it says the status is Locked. The other way I tried was to delete duplicates with this: DELETE bad_rows.* from items as bad_rows inner join ( select post_title, MIN(id) as min_id from items group by title having count(*) 1 ) as good_rows on good_rows.post_title = bad_rows.post_title; ..and this has been running for 24hours now, Admin telling me it's Sending data... Do you think either or these queries are actually still running? How can I find out if it's hung? (with Apple OS X 10.5.7)

    Read the article

  • A gridview for debugging collections?

    - by Llewellyn
    Hi Guys, I'm working with fairly large generic collections and I need a quick way to view all the items and their properties in these collections while debugging. When I say view all the items, I mean I would like to view the collection as if it was bound to say.. a gridview. That was I could see all all the item properties listed. Currently VS2010 displays the collection object during debugging, but it takes several clicks before I can view any item's properties within the collection. As I'm using collection with 50 to 100 items in them, I've having a hard time getting a feel for the collection data because of having to click through to view each individual item's properties during debugging. Do you have any ideas or know of a visual studio plugin that can help display collections in a table format or gridview format? Thanks for you time

    Read the article

  • Files mapping architecture

    - by user326198
    I need to know How I can achieve this goal by classes : we have two different applications in the company (App1 , App2) Appl can export xml with know items ( ID , Name) we need app2 to import this data but App2 display different items (CarID, CarName) and this items defined like this with the mapping info <CarID> <Mapping name="ID"/> </CarID> <CarNAme> <Mapping name="Name"/> </CarNAme>" How I can achieve this as classes or ARCHITECTURE , i will develop this with c# I need one interface because we may support different type of files not just xml

    Read the article

  • Circular Reference for Parent Link on Work Item cannot be resolved by Retry

    - by Atters
    I receive the following error; OH-TFS-Connector-0051: Operation failed getCollectionMetaData. Server Error : TF201063: Adding a Parent link to work item 1737 would result in a circular relationship. To create this link, evaluate the existing links, and remove one of the other links in the cycle. I have completely flattened out the Work Items in the source project. When retrying the migration the timestamp is modified on the pending errors however the issues are not resolved. These Work Items now have no parents or children in the source project. So I'm wondering if the retry list is no longer valid but there doesn't appear to be a away to have it update? I can run the whole migration again, however it takes 5-7 hours to just do the work items so it would be great if there is a quick fix.

    Read the article

  • Design RESTful service with multiple ids

    - by Dustin Digmann
    I am designing a RESTful service. It is to list a set of data. The main problem is that the set does not have a reasonable, single identifier. Nor can the specific set be easily calculated within the knowledge of the system. As a result, it does not seem possible to have a GET /items/{identifier} service. I do have the id of each element being requested. My main issue is that it does not seem RESTful to list the ids in the URI (eg GET items/{id1},{id2},...,{idn} ). Right? I could see DELETE having a similar use case - remove multiple items in one request cycle. How would such a use case be satisfied while staying within the REST realm? Is that possible?

    Read the article

  • Lots of pointer casts in QGraphicsView framework and performance

    - by kleimola
    Since most of the convenience functions of QGraphicsScene and QGraphicsItem (such as items(), collidingItems(), childItems() etc.) return a QList you're forced to do lots of qgraphicsitem_cast or static_cast and QGraphicsItem::Type() checks to get hold of the actual items when you have lots of different type of items in the scene. I thought doing lots of subclass casts were not a desirable coding style, but I guess in this case there are no other viable way, or is there? QList<QGraphicsItem *> itemsHit = someItem->collidingItems(Qt::IntersectsItemShape); foreach (QGraphicsItem *item, itemsHit) { if (item->type() == QGraphicsEllipseItem::type()) { QGraphicsEllipseItem *ellipse = qgraphicsitem_cast<QGraphicsEllipseItem *>(item); // do something } else if (item->type() == MyItemSubclass::type()) { MyItemSubClass *myItem = qgraphicsitem_cast<MyItemSubClass *>(item); // do something } // etc } The above qgraphicsitem_cast could be replaced by static_cast since correct type is already verified. When doing lots of these all the time (very dynamic scene), will the numerous casting affect performance beyond the normal if-else evaluation?

    Read the article

  • Name Value Pairs in a ComboBox

    - by JamesB
    I'm convinced this must be a common problem, but I can't seem to find a simple solution... I want to use a combobox control with name value pairs as the items. ComboBox takes TStrings as its items so that should be fine. Unfortunately the drawing method on a combobox draws Items[i] so you get Name=Value in the box. I'd like the value to be hidden, so I can work with the value in code, but the user sees the name. Any Ideas?

    Read the article

  • Item-Level Permissions (Edit only their own but, read everyones)...

    - by Jason
    I have a list which I've set item-level permissions on. I set it to allow users to read all items and only edit their own items... The issue is that if I do this then I can still edit all items... If I change it so that I can only read my own and only edit my own then it works as expected... Anyone have any thoughts on why this would be occurring and a solution... I've set the list up to only allow one user account with contribute rights for testing purposes...

    Read the article

  • VB.NET take each letter of a word and display in ListBox

    - by Kaleet
    Private Sub btnWord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWord.Click Dim Inputter As String Dim Words As String = "" Do Inputter = InputBox("Enter word", "Enter Word") If Inputter <> String.Empty Then lstDisplay.Items.Add(Inputter) Word += Inputter.Substring(0, 1) End If Loop Until Inputter <> String.Empty ' SOMETHING GOES HERE!!!!!' lstDisplay.Items.Add("---") lstDisplay.Items.Add(Word) End Sub Here is how it works, when you click the button it displays an input box so for example type in "CAT". But I can't figure out how to get it to do C (newline) A (newline) T (newline) within the listbox. Please help! C A T - CAT

    Read the article

  • iPhone - In App Purchase questions

    - by diwup
    Hey guys, Merry Christmas. I have two questions on In App Purchase. iAP application process: do I need to submit my iAP items applications, wait for Apple's responses, then build my app accordingly, or, I can just create some iAP items, build them into my app, then after everything's done, submit my binary to Apple? Intermediary currency: on Apple's documentation I found these sentences: "You may not offer items that represent intermediary currency because it is important that users know the specific good or service that they are buying." However, I found a few apps on the App Store offering its users with different kinds of intermediary currency. I'm confused. Is this a gray area in which we developers can play some tricks? Thanks in advance. Di

    Read the article

  • jquery bubblepopup inside jquery carousel

    - by sam
    Hi, I am trying to use the jquery bubble popup inside the jquery carousel. the problem everything works fine. but say if i have 10 items in the carousel, display 5 at a time, hiding the remaining 5 items(which could be opened by clicking the left or right navigation). so when we move the mouse over each carousel item that is visible on the screen, we can see the bubble popup. here, if i move the mouse over the empty area on the screen, i am still getting the bubble pop which shouldnt be visible because that particular carousel item is hidden.if i keep on moving over all the hidden items, i am able to see the bubble popup. is there anyway to hide the bubble pop when the carousel item is not visible on the screen.

    Read the article

  • How would I initialize these two lists so that modifying one doesn't modify the other?

    - by Brandon
    I'm aware of why this is happening, but is there any way to do this without having to implement ICloneable or a Copy() method? Preferably .net 2.0, but 3.5 is fine if it is necessary. Essentially I'm trying to implement an undo method. In most cases I can just perform the reverse action in the Undo(), but for others that is not possible. So I want to keep two lists. One for the list of items that I will be modifying, and one for the original, unmodified list of items. This way if I need to do an undo, I just delete the modified items and replace them with the originals. Most of the ways I've tried to assign the _originalItems variable doesn't work, so what would I need to do? public MyClass(List<SelectedItems> selectedItems) { _selectedItems = new List<SelectedItems>(selectedItems); _originalItems = ?? }

    Read the article

  • Why does a Linq Cast<T> operation fail when I have an implicit cast defined?

    - by Ryan Versaw
    I've created two classes, with one of them having an implicit cast between them: public class Class1 { public int Test1; } public class Class2 { public int Test2; public static implicit operator Class1(Class2 item) { return new Class1{Test1 = item.Test2}; } } When I create a new list of one type and try to Cast<T> to the other, it fails with an InvalidCastException: List<Class2> items = new List<Class2>{new Class2{Test2 = 9}}; foreach (Class1 item in items.Cast<Class1>()) { Console.WriteLine(item.Test1); } This, however, works fine: foreach (Class1 item in items) { Console.WriteLine(item.Test1); } Why is the implicit cast not called when using Cast<T>?

    Read the article

  • C#, Generic Lists and Inheritance

    - by Andy
    I have a class called Foo that defines a list of objects of type A: class Foo { List<A> Items = new List<A>(); } I have a class called Bar that can save and load lists of objects of type B: class Bar { void Save(List<B> ComplexItems); List<B> Load(); } B is a child of A. Foo, Bar, A and B are in a library and the user can create children of any of the classes. What I would like to do is something like the following: Foo MyFoo = new Foo(); Bar MyBar = new Bar(); MyFoo.Items = MyBar.Load(); MyBar.Save(MyFoo.Items); Obviously this won't work. Is there a clever way to do this that avoids creating intermediate lists? thanks, Andy

    Read the article

< Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >