I'm trying to attach an image on a button in WPF, however this code fails. Seems strange after similar code would work perfectly in Mozilla XUL.
Disconnect from Server
I'm having trouble adding an Entity Framework entity to a ObjectContext's EntitySet automatically using the WPF 4.0 DataGrid's add functionality. Here's the setup:
DataGrid--BoundTo--ListCollectionView--BoundTo--EntitySet
When I interactively add a row to the DataGrid, the EntitySet does not have a new entity added to it. Updating the row's cell data does in fact update the bound entity's properties, however.
Any idea what I could be doing wrong?
What would be a good aproach to localize a MVVM based WPF allication that can change its language at runtime? Of course I could create a string property in the ViewModel for each and every string that is displayed somewhere in the View but that seems rather tedious to me. Is there a common approach/best practice for this?
Hello
I am trying to create a status window which content(textbox) should change in a lengthy operation.
This status window is called and updated from the main application.
Unfortunately, the content is updated only at the finish of the operation.
I am using VS2008, C# and WPF.
Thank you.
I have some useful wpf buttons to test some functionality. It would be good not to show them in release but in debug indeed.
Doing it from code is easy. But I'd prefer a declarative solution.
I'm working on an XmlEditor (similar to XmlNotepad, but using WPF) in which I want to implement personalized menus. I.e. only show the most popular MenuItems on first open, and show all MenuItems when the user explicitly asks for it, either by clicking on the double arrow at the bottom or waiting for a certain amount of time.
I'm specifically looking for feedback on how I should approach this problem: any thoughts are appreciated!
When I worked on web pages I used these a lot. While building a page out for WPF project the other day I ended up building a page that looked like it had an in-page dialog on it but it was the only thing on the page.
My question here is. Has any one created such component that allows for easy creation of these kinds of dialogs.
WPF launches certain method which calls external exe and waits , and then accesses a file which was an output of external exe. Assuming I would build this application with a consideration of porting to Silverlight 4 later what should I do ?
I'm looking for a good guide into the right method of using Linq to Sql together with WPF.
Most guides only go into the bare basics like how to show data from a database but noone I found goes into how to save back to the database. Can you answer or point out to me a guide that can answer these questions.
I have a separate Data project because the same data will also be used in a web page so I have the repository method. That means I have a seperate class that uses the DataContext and there are methods like GetAllCompanies() and GetCompanyById ( int id ).
1) Where there are collections is it best to return as a IQueryable or should I return a list?
Inside the WPF project I have seen reccomendations to wrap the collection in a ObservabgleCollection.
2) Why should I use ObservableCollection and should I use it even with Linq / IQueryable
Some properties of the linq entities should be editable in the app so I set them to two-way mode. That would change the object in the observableCollection.
3) Is the object in the ObservableCollection still a instance of the original linq entity and so is the change reflected in the database ( when submitchanges is called )
I should have somekind of save method in the repository. But when should I call it? What happens if someone edits a field but decides not to save it, goes to another object and edits it and then press save. Doesn't the original change also save? When does it not remember the changes to a linq entity object anymore. Should I instance the Datacontext class in each method so it loses scope when done.
4) When and how to call the SubmitChanges method
5) Should I have the DataContext as a member variable of the repository class or a method variable
To add a new row I should create a new object in a event ( "new" button push ) and then add it to the database using a repo method.
6) When I add the object to the database there will be no new object in the ObservableCollection. Do I refresh somehow.
7) I wan't to reuse the edit window when creating new but not sure how to dynamically changing from referencing selected item from a listview to this new object. Any examples you can point out.
hello,
Can someone elaborate the difference between Control template and Data template in wpf?
It would be great if an example of how each can be used in different scenarios can be provided.
What is the best way to display multidimensional data in WPF? I want to use databinding and I won't know the size/shape of the data until runtime. I was thinking some sort of grid but I don't know how to dynamically bind to the data and have it figure out the number of rows and columns. Suggestions and examples please?
Hi,
I want to make a WPF datagrid look similar to the HTML grid in the following picture:
http://img443.imageshack.us/img443/2563/saltoftheearth.jpg
Does anyone know an easy way to do this ?
Regards,
S.
I'm having some issues trying to change the look / style of a combo box in Expression Blend / WPF. While there are tutorials out there describing setting styles for buttons, there seem to be a few wrinkles with ComboBox controls.
Can anyone offer any advice, or point me towards good tutorials that cover re-styling something more complex than a button?
Hi All,
I have a situation that needs to conditionally make readonly to wpf datagrid cell. There is IsReadOnly property in DataGridCell. But unfortunately, that property is readonly! Is there any way to do it?
ant.
Hi,
I have a user control...and the base page(s) which uses this user control has a dataset which will be used by the user control.
My dataset is dynamic...means..it can have different number of columns depending upon which page my usercontrol is implemented. Is there any control in wpf which i can use to bind this dataset (without knowing the column information) ...i mean similar to datagrid/gridview in 2.0 ?
I would like simmulate Console text output in my WPF app
but when I add new lines in TextBox I should use scroll bar to see last added text but I want to see last added text but for firsts lines use scroll bar
<TextBox TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
Text="{Binding Path=Data, Mode=TwoWay}" />`
I have ItemsControl in a WPF application, which is bind to an array of objects.
And I am using ItemTemplate to render the list.
I want to display for each item in the list the item order, like for example
Customer 1
Name : xxxxx
Age: 9999
Customer 2
Name : yyyy
Age: 8888
Any idea how to do it
Thanks
I'm looking for an Expression Blend 2 book that includes
best-practices (Expression Blend 2/Visual Studio 2008)
designer perspective (Expression Blend 2)
programmer perspective (interoperability with Visual Studio 2008)
How-To-chapters for Windows Forms developers (how to solve the same problem with WPF)
Could you make a recommendation?
Hi all
i am new to WPF and i created user control consist of :
1) media element ,,,
2) 2 Text blocks ,,,
3) 2 buttons to play and pause the media
everything is good with my user control except the two buttons
i can not click them when i add the user control to any 3d panel .
if i add my user control to simple window i can use play and pause buttons otherwise no.
Thank you in advance.
Majed
I have an INotifyProperty item that I have bound to a wpf control.
<local:ScrollingSelector DataContext="{Binding Path=SelectedScreen.VisualizationTypes}" Grid.ColumnSpan="2" Grid.Column="3" Margin="0,0,0,0" Grid.Row="1"/>
If I change the SelectedScreen property to a different control the binding still assumes the first control. Why is this? Is there an easy work-around?
I am now very comfortable with WPF, but I read some articles about MVP and MVVM that find the default project solution ineffective. Then I realized how ineffective it was and how the MVVM pattern is much better. So I want to really learn this pattern. Can I be directed to some resources like maybe a tutorial or a video or something?
Hi,
in one of our applications we're using alocal RDLC-report (displaying using a ReportViewer control) to print some tables and text entered by the user.
We'd like to give the user the ability of formatting the text. I thought I might use the respective WPF controls (embedded into the Windows Forms application) to make things easy.
Question is: how do I print the resulting FlowDocument within the local report? Is this possible at all?
Thanks for any advice,
Thorsten
I have a WPF application with DataGrid
The DataGrid contains 4 columns with a checkbox template column on the first column
the problem is when i check some of the checkbox on the items, the checkbox would got reset when i sort a certain column. For example i check the checkbox on the row 2 it gets unchecked when i sort the datagrid.
been searching for similar case like this for a while but haven't seen one
Thanks,
Im working on a middle size project, using WPF. Need DataGrid, suitable for the client: fast, customizable, beautiful. Which component suite do you suggest from your practice?(for example Devexpress's, telerik's, Infragistics's and etc)
Hi all,
I have a treeview in wpf and I load it ok is all done in zaml .
I have a problem and this is mainly because I am new to zaml.
If i have this structure
England
London
Manchester
Liverpool
etc...
and I select london i need to display "England-London" .
I dont seem to get how to retrieve the parent of the selected child.
Can you help?
Thanks