Wpf - Multiple Views Of Observable Collection?

Mar 13, 2012

I've been working on this problem for a while and I'm clearly missing something...I create, populate and bind an observable collection like so:

Dim _ObservableWEI As New ObservableWEI
...
_ObservableWEI.Add(New WEI() With {.WEInum = 1, .WEIvalue = 1})[code].....

The problem is the filter effects the contents of both listboxes. I guess I need a specific instance of the collection to apply the filter too or something

View 1 Replies


ADVERTISEMENT

Wpf - Add Multiple Classes To An Observable Collection?

Jan 30, 2012

I'm still teaching myself how to bind and use observable collection. One problem that I'm a little confused on is binding multiple classes/observable collection to one page. In other words, if I have a PersonName class and a AnimalName class, I have to create two separate observalbe collections for each? How would I set the datacontext when a page only allows one?

[code]...

Now If I add another class, how would I combine the two on the binding part and collection part.

View 2 Replies

Using The Observable Collection?

Oct 3, 2011

I am creating some user controls in vb using winforms. I ran across the observable collection and INotifyChanged events and was wondering if this type of action was available in winforms As I understand it, the observable collection is a WPFapplication, but it would be nice to use this type of functionality in a winform as well.

View 6 Replies

Observable Collection Is Not Updating Datagrid

May 6, 2012

I am using a Dim All_PriceLists As System.Collections.ObjectModel.ObservableCollection(Of BSPLib.PriceLists.PriceListPrime) where PriceListPrime implements Inotify for all properties in it.

I bound the All_PriceList to a datagrid as DataGrid1.ItemsSource = All_PriceLists but when I do All_PriceLists=Getall() where Getall reads and gets the data from the DB, the datagrid is not updating.[code

View 3 Replies

Wpf - How To Bind Observable Collection And Save To Database

Feb 1, 2012

I will be doing an MVVM Project soon and I'm working a couple tutorial/examples out. How do I take the following code and connect it to a database. If I were to have a datagrid, how can I change information in the datagrid and have it automatically update? I'll be using MS SQL.

[Code]...

View 1 Replies

Sort Items In ListView By Column Bound To An Observable Collection?

Sep 28, 2011

How to sort items in ListView by column bound to an Observable Collection ?I've looked all over the place and I can't find anything easy enough or simple on this.

View 2 Replies

Wpf - Sorting Observable Collection Incorrectly Sorting?

Aug 20, 2011

I have a WPF ObservableCollection which is bound to a ListBox and I have a Sort() method which when called will convert the ObservableCollection to a List(Of T), and undertakes a sort based on a date/time column within the collection.

The data is sorted, even when new items are added to the ObservableCollection, however the date/time isn't being correctly sorted. The data is sorting based on the date however it is very much random when it comes to the time portion. The following is an example of the outcomes I am experiencing:

[Code]...

Is there anything that I am doing incorrectly in this method that would cause the time portion not be included in the sort? Is there a better way of doing a sort?

View 1 Replies

Property Pages And Multiple Views

Mar 31, 2009

I've been wondering what a good solution is for displaying multiple forms all within the same form. I am fairly new to .net, so I might be asking a typical newbie question here, but I was wondering how one deals with having to show many forms all in one parent form. For example, I have a signup form where there is a Next button that shows, say, up to 10 'pages'. In VB6, I simply made a collection of pictureboxes as containers. At runtime, I'd set each picturebox on top of the other then set the requested picturebox's zorder to 0 when it was needed to be shown. Many pictureboxes became a bit obtrusive taking up most of the visual area of the form in design mode so I then started putting them in a tabstrip control then making the tabstrip very tiny and out-of-the-way and then setting it's visible property to false so that it wouldn't be seen at runtime. On the form's load event, I'd simply parent all of the pictureboxes (usint SetParent) to the main form and then use the zorder teqnique as usual. Lame, I know.In VB.net, I've tried just making many forms and then parenting them when needed, but I get an error that a top-level control can't be parented/added to another top-level control. I haven't tried the SetParent API technique yet because I'm sure that there is a common, simpler solution that you experts use.

View 4 Replies

Multiple Properties In A Collection

Aug 10, 2010

I want to create a collection with multiple properties.

View 15 Replies

Multiple ComboBoxes Using Same Collection For DataSource

Apr 21, 2009

I have two combo boxesthat use the same collection for their datasource. The data member and value member are also the same properties. When the form loads, and I select an item in one of the combo boxes, the same item is then selected in the other combo box. I want the combo boxes to work separately. Do I need to have two different collections, even though they would have the same data in them?

cboInboardKnife.DataSource = cKnives
cboInboardKnife.DisplayMember =
"Name"
cboInboardKnife.ValueMember =
"ToolID"
cboOutboardKnife.DataSource = cKnives
cboOutboardKnife.DisplayMember =
"Name"
cboOutboardKnife.ValueMember =
"ToolID"

View 1 Replies

Updating Observable Colelction From List?

Oct 7, 2009

I have my datgrid's itemsource binded to a observablecollection. Every 5 secs my client app resceives a list from the server which i use to update the observable collection. The problem is that when it updates the grid seems to reset (if details is open when i update the details collapses, if i have an item selected it will un-select)

Here is the code that i am using to update my observable collection:
Private Sub creategriddata()
Dim svc As New ServiceReference1.Clientthing then re-adding

View 3 Replies

Filtering A Collection With Linq And Multiple Criteria?

Jun 7, 2012

On my view there is a datatable holding a collection of ServerRow and 4 textboxes (Hostname, OS, Location, Zone). When the user types into any of the 4 boxes I want to immediately filter this list. I have this code setup and ready to go that on the set method of each textbox property I call the filter method.

Now onto the problem: if I have 4 criteria that means I have 2 to the power of 4 different scenarios. What I would like to do is write a linq statement with all of these scenarios dealt with such that if any of the properties are NullOrEmpty they will not be used in the Where clause and on the flip side if there is a value the corresponding field will be searched with a Contains.

Example

AvailableCis = New ObservableCollection(Of ServerRow)
(_CiData.Where(Function(ci) ci.OS.ToUpper
.Equals(_selectedOS.ToUpper) AndAlso
ci.HostName.ToUpper.Contains(_ciNameFilterText.ToUpper))
.OrderBy(Function(a) a.CiName))

This example shows how it works with 2 criteria and both of those criteria are set.

View 1 Replies

Looping A Collection Into Multiple New Filenames - How To Speed Up

Apr 6, 2010

i have the following snippet of

For Each tempstring In SourceDataCollection
LineToFieldsTemp = Split(tempstring, ",")
LineStringWithoutFirstEntry = "" 'reset the linestring
For i = 1 To UBound(LineToFieldsTemp)

[code]....

essentially what i'm doing is to read through each item in a collection of comma separated variable strings. the first variable in each string is appended to a master filename and becomes the NEW filename to which the entire string will be appended. this is a way to split a CSV file into multiple files using the first variable in that string.

the trouble is that this is doing a LOT of writes to potentially a LOT of files, the IO is taking forever. is there a way to buffer this data until the end, then write it to a disk? be aware, the filenames and total number of files to be created is UNKNOWN at the begining of the loop. it just creates a new file each time a unique first column ID is discovered.

View 13 Replies

.net - Massive Memory Leak When Binding ItemsControl To An Observable Colleciton?

Feb 21, 2010

I have an ItemsControl in a ScrollViewer. The ItemsControl.ItemSource is set to the Observable Collection.Every time I add an item to the collection, my application nearly doubles in memory usage and eventually after enough adds.

Here is a rough sketch:

<Scrollviewer Name="MyScroll">

[code]....

Using ANTS Memory Profiler, I can see all the class instances in my App. When I start the program, I have 150 instances of TextBox (There are three in the datatemplate). When I add a studyunit to the collection, I have 303. Adding another leaves me with 456... 609... etc.The studyunit objects inherits from dependency objects and I am only binding to its dependency properties. I made the studyunit a series of dependency properties due to this article: [URL], but it didn't fix anything.Update 2/22/2010. Here is the actual code (code above was very simplified and created from memory)

Private Sub ObservableCollectionChanged(ByVal sender As Object, ByVal e As System.Collections.Specialized.NotifyCollectionChangedEventArgs)
If e.Action = NotifyCollectionChangedAction.Remove Then 'q removed

[code]....

View 1 Replies

Sync Locks - Manage Access To A Collection Object From Multiple Threads - Add, Update, Remove, Clear

Oct 20, 2009

I am considering a piece of code that will manage access to a collection object from multiple threads - add, update, remove, clear. OK ... so I have put a sync lock within each method, but what is not clear from the MS documentation is exactly how the sync lock is behaving. Is it locking the piece of code it wraps? Or is it locking the object? And if it is locking the object a private static object should lock out any code locked on the object within all instances of the object? i.e. if an add operation is underway, an update, delete or clear will wait for the lock to be released.

Finally, if I have multiple threads contending for the sync lock, how is the release managed? First come, first serve? random (from my p.o.v)? Is there a chance that two separate threads could blunder into 'locked' code simulataneously?

View 2 Replies

SQL Views And VB2008Express?

Sep 4, 2009

After creating a multi-table SQL View in a dataset and trying to configure it, the vizard refuses to create UPDATE, INSERT, DELETE statements or Update method. Does that mean that Views altered by VB code cannot be written back into the database? I am having trouble finding good basic information about SQL Views handled from VB.

View 2 Replies

.net - Different 'views' In A Single WPF Window?

Oct 11, 2010

I'm doing a VB.Net subject at university and the major assignment is the creation of a WPF application.The application is management-focused (adding, modifying, deleting entries, etc). As these are all rather disparate tasks I'm thinking to create a tabbed interface for my assignment (in a similar vein to [URL]...

I'm a bit confused as to how I should go around approaching this? Btw, would this classify as MDI?We were recommended to create a menu system that listed all the options - upon selecting an option, a new window would be opened, the interaction would take place. If the user wanted to do something else, he'll close the window to be taken back to the menu screen.

This doesn't really seem like an elegant approach to me and it seems like it'll be an interesting exercise to implement the tab-based system I explained.I'd appreciate if anyone could point me in the right directions or give any hints as to how I should achieve. Is it possible, for example, to create each option in a separate xaml/code-behind file and then 'plug' these into each tab?edit: To clarify, let's take a hypothetical of an indoor soccer team management system. Let's say there are five different tasks the user can perform: 'Register a player', 'Modify players', 'Register a team', 'Modify team details', 'Add player to team'.

Each task is separate from the next. One way of creating the application is to create a main page with a button for each task. When a user click on each button, a new window opens up (for example, if the user clicks 'Register a player', a new PlayerRegistration window is opened).

What I'm looking for, as mentioned above, is a tab-based approach. In my application, if the user clicks 'Register a player' the entire PlayerRegistration xaml file gets loaded in a segment of the window. The same happens when the user clicks any other button.

View 2 Replies

DB/Reporting :: Get Query Of Views In .net?

May 22, 2008

anyone knows how to fetch the query of a view (Sql server) in vb.net?

View 3 Replies

Asp.net - @Model Not Supported In Razor Views For VB?

Feb 27, 2011

Is not the @Model MyModelClass notation not supported in VB Razor Views? It's not working for me. What is the construct for it?

View 1 Replies

Compare Rows Of Two Grid Views GW1 And GW2

Mar 30, 2009

I want to compare rows of two grid views.GW1 and GW2.When I click a Search Button ,I want to check the Values in the GW2,and if GW1 and GW2 have same PayID ,EmpID,then that specific row of GW1 must be disabled.

View 3 Replies

ASP.NET MVC: Tracking Page Views And View Duration?

Jul 26, 2010

I have an application I'm currently working on that requires Administrators to be able to track the views of a ticket and it's duration.I've got the tracking of the number of views by users sorted out, I have a table that contains a TicketID, UserID and a DateOpened. Each time a user visits the page, a new row will be inserted.However, the way I would like to track the duration of views is by having a DateClosed field in the table which will allow me to work out view duration in the code as opposed to storing the time directly.

I can't use Google Analytics or anything Third Party for the task either due to internal policy as it's an intranet application.What would be the best way to achieve filling this field on page exit?

View 1 Replies

ListView Capable Of Displaying Files In All Available Views?

Mar 13, 2009

I have a ListView capable of displaying files in all available views (Large Icon, Small Icon, Tile, List, Details). Now I am wondering how to properly use the SmallImagelist and LargeImagelist for the small and large icons...the ListView is actually a modified listview (inheriting from ListView), using a modified ListViewItemCollection.In this custom ListViewItemCollection I use the Add override function to add a few details to my ListViewItem:

vb.net Public Overrides Function Add(ByVal value As System.Windows.Forms.ListViewItem) As System.Windows.Forms.ListViewItem
Dim file As clsTexture = TryCast(value, clsTexture)
If file IsNot Nothing Then

[Code]...

I realize it is a pretty complex post to read and will probably not get very many answers, but I really want to make the most of my Listviews...Of course, one work around is to just always use the LargeIcon which then gets scaled down automatically when the SmallImagelist is used but I am pretty sure there are icons that are very different in Large or Small view...

View 3 Replies

Rendering Strongly Typed Partial Views

Sep 2, 2009

When ASP .NET hits the RenderPartial("Openings") line, an exception is thrown ("Could not load type 'System.Web.Mvc.ViewUserControl(of IEnumerable(of OpenSpace))'.") even though the view exists and the proper model is being passed in. The views are all inside the View folder and in this case, they're even in the same subdirectory.[code]

View 2 Replies

Using LINQ To SQL With Views Need To Cast / Convert To Table

Jun 25, 2012

My SQL Server database contains several views which are essentially filtered (WHERE) / ordered (ORDER BY) versions of some of the tables i.e. no joins.

An example would be my Downloads table, which has a view such as DownloadsOnlineOnly e.g.

SELECT * FROM Downloads WHERE Live = 1 ORDER BY FolderName ASC;

I can drag and drop these views onto my LINQ to SQL DataContext, and use LINQ to query these views and retrieve data fine...

But the foreign key relationships are not being picked up in my DataContext, so I've lost the ability to:

Dim dl as DownloadOnlineOnly = (From r in db.DownloadOnlineOnlies Select r).First

Dim fol as Folder = dl.Folder ' Syntax error as there is no association between

' DownloadOnlineOnly and Folder in my DataContext.

I understand why this is happening, but how can I get around this:

Without manually adding associations in my DataContext? Can I change the type of the Entity like changing the return type of an SP on the DataContext? Can I cast or convert between a DownloadOnlineOnly object and Download object? Or some other method?

View 1 Replies

[2008] Collecting Sub Items In List Views?

Mar 12, 2009

I have used list views for a project. I have used sum items on the items. The sub items are prices of products. I will need to use these sub items to come up with a total.Also, i have used to listviews, for a smoother look and feel. You click the product which then is removed from the list view and added to the second one. Would this also "move" the sub item across to the other list view?

View 1 Replies

Adding And Removing Items From The List And Tree Views

Mar 10, 2009

I am trying to learn how to work with the different controls in Visual Studio for VB.Net in particular the List View and Tree Views. I don't have any code to show as I am not working on anything in particular just messing around with it to learn what the different controls do that weren't covered in my Intro to VB.Net class last semester.I would like a clearer explanation on how to actually use code for these controls. In particular adding and removing items from the List and Tree Views using code.

View 1 Replies

MVC2 Extension Methods Throwing Errors In Views?

Nov 21, 2011

I have a project written in MVC2 and VB.NET. I use a lot of htmlhelper extension methods,and I have them all in a public module. They work just fine, and I can compile and run my project. I reference the namespace they are in with this:<%@ Import Namespace="MyProject.WebUI.Extensions" %>So, again, they work great, my project runs and compiles without a hitch.The problem is that each one of these extension methods is shown as an error:

Error 33 'TabbedMenu' is not a member of 'System.Web.Mvc.HtmlHelper(Of Object)'. C:ProjectsMyProjectMyProject.WebUIViewsSharedSite.Master 23 21 MyProject.WebUI

[code]....

View 2 Replies

.net - Multiple "= New" With The Same Variable - Does Garbage Collection Dispose

Jul 30, 2009

Dim x as whatever
Try
x = new whatever(1)
something is done with x

[code]....

What happens to x = whatever(1)Does garbage collection find the pointer to the first new and destroy it or what?

View 2 Replies

Draw Lines Between Elements In 2 List Views To Bind The Data?

Aug 4, 2009

I am using VB 2008 and wonder if there is a way to draw lines between the data elements in two listviews to bind the elements together?

View 1 Replies

Forms :: Write A Program That Views Images On A Website That Are Organized?

Jun 28, 2009

I'm BRAND NEW to programming, and I'm starting to learn VB. I need to write a program that views images on a website that are organized. I have 2 textboxes in which you enter variables which affect the URL. It doesn't load anything though when I enter values into the textboxes. Here is the

Dim shoot As String
a = TextBox1.Text
Dim pic As String
b = TextBox2.Text

[Code]...

Also, i want to be able to enter something else in the textboxes and be able to press the button again to load the new image

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved