Search Results

Search found 9012 results on 361 pages for 'wpf binding'.

Page 73/361 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Implementing master-detail with 2 tables in a dataset (wpf)

    - by Dani
    I've created a dataset that contains 2 tables: Users (userID, UserName, other user details) Emails (Id, UserId, UserEmail) I populate the dataset using 2 DataAdapters (one for each table) I have a listbox, a few textboxes and a grid. listbox gets all the users, the few textboxs displays the user details when picked in the list box (this is easy b/c they are both bound to the same table). the grid should display the selected user's email addresses. How do I do it using binding ? is it possible or should I catch the selection change event and filter the grid "manually" (currently the grid displays all the emails in the tables).

    Read the article

  • Adding a textblock to a custom wpf control (piepiece control from codeplex)

    - by bomortensen
    Hi Stackoverflow! I'm currently building a Surface application where the main navigation is a circular menu. For each menu item I'm using a custom control that I found on codeproject.com: http://www.codeproject.com/KB/WPF/PieChartDataBinding.aspx (PiePiece control) The number of submenu items (which is also piepiece controls) comes from a database and thus dynamically loaded. What I can't figure out is how I add a textblock to this custom control to display the submenu item text. It needs to follow the PiePiece's RotationAngle property to line up correctly. Anyone got a hot-fix for this? I was thinking about adding another dependencyproperty to the piepiece custom control, but that way I can't set the font-family, size etc (can I?) Any input on this is greatly appreciated! Thanks!

    Read the article

  • WPF - Weird results with DataGrid - extra line for editing entries

    - by Jim Beam
    Working with WPF and C#. I have a page with a datagrid that lists a series of objects with List as the DataContext. I recently had it working in the code behind and the Datagrid would show the extra line at the bottom of the datagrid for new entries. Now, I have moved the exact same code to its own library project. The data still appears but the extra line for entry does not and users cannot add a new record. I have already tried using grid.CanUserAddNew = true; but that does not solve it. So, it must be something in the List object - it's the exact same code as before, only pulling from a library. Help.

    Read the article

  • Floating child window in WPF

    - by Dusan Kocurek
    I want to create floating child window in .NET 3.0 WPF application. What I'm doing is: sideWindow = new SideWindow(this); sideWindow.Left = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - sideWindow.Width; sideWindow.Top = 125; sideWindow.WindowStartupLocation = WindowStartupLocation.Manual; sideWindow.Owner = this; sideWindow.Show(); This is running fine except one customer. According to trace messages the window is created, but the client doesn't see it! Any idea about similar problems? Thank you very much.

    Read the article

  • Creating Pages or Windows in WPF

    - by cmptrer
    Hey all, I'm new to using WPF. I have the following program I want to create: -Application opens up with one button -User clicks button and it takes them to a new page with various input. I'm confused about how I need to do this. I tried opening a new window, but I don't want a window to open up, I want it to be all one Window. I tried creating a new page and navigating to it using NavigationService but couldn't get it to work. Basically I want to create a workflow where the user enters some stuff, clicks the next button and is taken to a new page to enter some more information. Can anyone point me in the right direction?

    Read the article

  • Improving WPF memory usage

    - by Krishna
    Hello developers Is there any way you can store the UI state to disk when a WPF form has been minimised. I have a complex GUI with few Tab Controls and it consumes quite a bit of memory which is kept allocated when the application is not active. I was hoping one of you may have got this working along the lines (or similar) Application Active User does work, plays with UI - enters some information in the text boxes and moves around the tabs User minimises the form to work with other applications On Minimise, Save the current state to the disk and dispose the root tabcontrol On Activiate, build the root tabcontrol from the disk and add to the controls collection Before I divein to do this, I thought it will help me if I ask this question here. Please let me know your thoughts

    Read the article

  • WPF WebBrowser - How to Zoom Content?

    - by Beems
    Trying to test basic browser concepts in a WPF (C#/XAML, .NET 4.0) WebBrowser application. So far, the only problem is programatically zooming. Has anyone had any experience with this? MSDN lists nothing: http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx Additionally, I have tried various things such as RenderTransform options to no avail. Either this is not possible or not documented. I'm hoping for the latter. Note that a WinForm solution isn't acceptable. Thanks in advance for any help, Beems

    Read the article

  • Change WPF Datagrid Row Color

    - by juergen d
    I have a WPF datagrid that is filled with an ObserverableCollection. Now I want to color the rows depending on the row content at the program start and if something changes during runtime. System.Windows.Controls.DataGrid areaDataGrid = ...; ObservableCollection<Area> areas; //adding items to areas collection areaDataGrid.ItemsSource = areas; areaDataGrid.Rows <-- Property not available. how to access rows here? CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(areaDataGrid.Items); ((INotifyCollectionChanged)myCollectionView).CollectionChanged += new NotifyCollectionChangedEventHandler(areaDataGrid_Changed); ... void areaDataGrid_Changed(object sender, NotifyCollectionChangedEventArgs e) { //how to access changed row here? } How can I access the rows at start and runtime?

    Read the article

  • How do I know if a drag/drop has been cancelled in WPF

    - by Jon Mitchell
    I'm writing a user control in WPF which is based on a ListBox. One of the main pieces of functionality is the ability to reorder the list by dragging the items around. When a user drags an item I change the items Opacity to 50% and physically move the item in an ObservableCollection in my ViewModel depending on where the user wants it. On the drop event I change the Opacity back to 100%. The problem I've got is that if the user drags the item off my control and drops it somewhere else then I need to change the Opacity back to 100% and move the item back to where it was when the user started the drag. Is there an event I can handle to capture this action? If not is there any other cunning way to solve this problem?

    Read the article

  • Frustrated With Wpf DataGrid

    - by user197373
    Hello Experts, I have a tabcontrol and I place datagrid inside a tabcontrol... But I could not focus that Datagrid at the load event ... Focus means I couldn't navigate through keyboard into it... I'm getting this problem only inside of the tab control otherwise it works fine...my sample project link as follows.. http://cid-0255f3152326d2b1.skydrive.live.com/browse.aspx/WPF%20Datagrid%20Problem?uc=1&nl=1 (1) Please remember note that focus means I couldn't navigate a datagrid through keyboard (2) It should be in load event......Because it works fine in other events... (3) Datagrid should be placed inside a tab control... Because it works fine outside a tab control..... I hope u wil help me... please help me out Thanks in Advance

    Read the article

  • WPF StaticResource bound to subproperty

    - by mizipzor
    I have a class thats created as a resource: <Window.Resources> <Model:MyModel x:Key="model" /> </Window.Resources> The MyModel class has a cli property named Foo. I want the selected value in a combobox to be bound to this property. I thought I could do this but Im getting errors: <ComboBox SelectedItem="{Binding Source={StaticResource model.Foo}}" /> Heres the error: Cannot find resource named '{model.Foo}'. Where did I go wrong? What extra parameters do I need to specify to properly bind to a subproperty?

    Read the article

  • How to remove the auto added column (HeaderRole=Padding) in WPF GridView

    - by dnr3
    Hi, I'm trying to make a custom gridview in WPF but I just realized that as this link says: The GridViewHeaderRowPresenter class performs layout for the column headers in a GridView and places an additional column header at the end to add space and because of the additional column header at the end, there's an extra column to the right of the last column. so I was wondering if I can modify it, please refer to this image below My questions are: Is there anyway I can remove the 'A' part from the grid? Is there anyway I can add the same effect of 'B' part (the role = padding header) to the 'C' Part (before the first column)? Thanks

    Read the article

  • Changing the cursor in WPF sometimes works, sometimes doesn't

    - by Scott
    On several of my usercontrols, I change the cursor by using this.Cursor = Cursors.Wait; when I click on something. Now I want to do the same thing on a WPF page on a button click. When I hover over my button, the cursor changes to a hand, but when I click it, it doesn't change to the wait cursor. I wonder if this has something to do with the fact that it's a button, or because this is a page and not a usercontrol? This seems like weird behavior.

    Read the article

  • WPF: capturing XAML into subclassed control

    - by Sonic Soul
    hello, i narrowed down what i want my wpf button to look like using XAML. now i would like to create a sub classed button control that i can just re-use w/out having to write all that markup <Button Click="TestGridColumnButton_Click" Background="Transparent" Width="16" Height="16" Margin="0,0,0,0" Padding="0,0,0,0" BorderBrush="{x:Null}"> <Button.Template> <ControlTemplate> <Image HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource SourceStyle}" /> </ControlTemplate> </Button.Template> </Button> how can i set all these properties using C# ?

    Read the article

  • Is there a way to capture a bitmap from a WPF window using native C++?

    - by Mike Caron
    Imagine a document window in a MDI application which contains a child WPF window, say a sidebar for example. How can one get a bitmap containing both the WPF pixels AND the GDI (non-wpf) pixels? I've discovered that when making my thumbnail preview for the Win7 taskbar app icon hover, I get black in the parts of the preview where the WPF pixels should be. My current method simply grabs a bitmap capture of the document window. Then I get a DC for the preview, make a memory DC from it and select my bitmap into it. Then I do some size adjustments and bitblt the memory dc to the real dc. I'm guessing that the BitBlt operation doesn't take into account the fact that the WPF pixels are hardware accelerated and therefore need to be grabbed from the graphics hardware. All the stuff in GDI is managed just fine, though and when there's no WPF child windows, the preview image looks fine. I'm wondering if it's at all possible to grab a bitmap of the WPF window from native C++. Then I can blt that onto the black area of the previous preview.

    Read the article

  • Wpf button click when application window is not active

    - by byte
    I have a WPF application window with a button (ButtonA) which has a command binding to a View Model property. When another application is launched the focus is lost and application window is deactivated. Clicking ButtonA now doesn’t execute the command but instead only activates the window and sets the focus to the button. 2nd click is required to fire the command. The desired functionality is on click of ButtonA while the application window is not active, the application window activates and command associated with ButtonA is executed. I have also tried removing the command and adding a click handler for test purpose but this displays same behaviour. I appreciate any help with this issue.

    Read the article

  • How to create DataSource dependency property on a wpf User Control

    - by Michael Hedgpeth
    I have a user control that wraps a grid. I want to be able to set the underlying grid's data source, but through the user control, like this: <my:CustomGrid DataSource="{Binding Path=CollectionView}" /> I have set this up in the grid like this: private static readonly DependencyProperty DataSourceProperty = DependencyProperty.Register("DataSource", typeof(IEnumerable), typeof(CustomGrid)); public IEnumerable DataSource { get { return (IEnumerable)GetValue(DataSourceProperty); } set { SetValue(DataSourceProperty, value); underlyingGrid.DataSource = value; } } But this doesn't work (it doesn't give me an error either). The data source is never set. What am I missing?

    Read the article

  • WPF C#: Starting crash due to client 'Region and Language' settings

    - by FrieK
    Hi, I'm working on a WPF C# application, and it seems to crash with a few random people. So eventually I found out it was the 'Region and Language' settings that was responsible. For example, if I were to set my Format to English (United States) it will work, if I set it to Swedish (Sweden) it will crash from the start. When I test this in Visual Studio 2010 it gives error 'TypeInitializationException'. More precisely it does it here (it doesn't get passed the InitializeComponent() void): private void RadioButton_Checked(object sender, RoutedEventArgs e) { Info.SortOrder = SortBy.Rank; } It claims the error at the first line, which is just setting an enum value to a variable. I guess it's just doing it there because it's the first thing it makes, or something. Anyone has any idea how to fix this? I've searched around but can't seem to find out how :( Any help is much appreciated! Thanks

    Read the article

  • Communication between Multiple Threads in a WPF Application

    - by Robert
    I'm creating a WPF application that uses a custom object to populate all the controls. The constructor of that object is initiated by an EventHandler that waits for an API. The problem I'm having is when I try to access any information from that object using a button for example, it returns an error saying "The calling thread cannot access this object because a different thread owns it". I'm assuming this is because the EventHandler creates a new thread which doesn't allow the Main Thread to have access to it. Any ideas on how to get around this? I'm basically having the error "The calling thread cannot access this object because a different thread owns it" when trying to get or set a CollectionViewSource.

    Read the article

  • wpf get access to other classes

    - by Calvin
    I am currently working on a wpf application. There are some methods in other classes in which I want to trigger to do some work instead of trying to figure out how to rewrite them in. How is it that I can get to those classes? Would I have to for example instantiate the class? If so, once I instantiate it, how would I be able access them. Keep in mind that these classes have abstract classes on top of abstract classes.

    Read the article

  • Populating a WPF listbox with items from an SQL (SDF) database

    - by xplinux557
    I have been searching on how to do this for a very long time, and I have not managed to get a straight answer on the subject, so hopefully one of you StackOverflow users will be able to help me here. I have a WPF ListBox named CategoryList and a SDF database called ProgramsList.sdf (with two tables called CategoryList and ProgramsList). What I wish my program to do is get the category names from the CategoryList table and list them in the ListBox control called CategoryList. Here's the code that I tried, but it only caused my program to crash. SqlConnection myConnection = new SqlConnection("Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "ProgramsList.sdf"); SqlDataReader myReader = null; myConnection.Open(); CategoryList.Items.Clear(); SqlDataReader dr = new SqlCommand("SELECT Name FROM CategoryList ORDER BY Name DESC", myConnection).ExecuteReader(); while (myReader.Read()) { CategoryList.Items.Add(dr.GetInt32(0)); } myConnection.Close(); Can anyone help me? Thanks in advance!

    Read the article

  • WPF databind in memory image to Image control

    - by Ready Cent
    I am using a DataGrid and trying to do the following Databinding <DataTemplate> <Grid> <Image> <Image.Source> <BitmapImage UriSource="{Binding Data.CustomImage}" CacheOption="OnLoad" /> </Image.Source> </Image> </Grid> </DataTemplate> CustomImage is of type BitmapImage. When I run I get the error: Initialization of 'System.Windows.Media.Imaging.BitmapImage' threw an exception. The thing is that these images are stored as resources in a different assembly so I can't just point to a location on disk

    Read the article

  • WPF Prism deactivate ?

    - by 2Fast4YouBR
    Hi all, I have an problem and would like to know if it is common problem or jsut with me. I am using Wpf with Prism and Unity, all with the pattern MvvM. I am loading a viewModel that has a reference to a dropdown with few items, my idea is that each time that the user click in some place to open the view that has this dropdown is that the dropdown will be shown with diferent values. The problem is that I see is that after I show the view for the first time and after the first DEACTIVATE, when I try to load it again looks like it is already in the memory (was not deactivated/disposed), so as is already in memory, it not call the constructor again of the modelView and the dropdown is shown with tha same old values. public BranchSelectionViewModel(IUnityContainer unityContainer) { this.unityContainer = unityContainer; User user = this.unityContainer.Resolve<User>(); this.branches = new ObservableCollection<Department>(user.Departments .Where(department => department.DepartmentId != user.SelectedDepartment.DepartmentId)); }

    Read the article

  • WPF toolkit DataGrid show filds even with browsable attribute set to false

    - by Jonathan
    Hi Hi have an observable collection that I bind to a DataGrid using the itemsource property of the DataGrid. All the properties of the class inside the collection are displayed properly in the DataGrid. Now, I want to hide some fields to the DataGrid using the browsable attribute [Browsable(false)] in the class. It works well in winforms, but it seems not working in WPF. Someone knows why? I can hide the columns later, but I don't want to loss performance in this way. Is there any other solution? Thanks.

    Read the article

  • Looking for a standard way to manage documents in a WPF application

    - by user322383
    Hi! I'm writing a WPF application that uses one document at a time. Is there any standard way to implement the management of the current document? What I mean are the following functions: New document: if there are not saved changes in the current document, a dialog box opens ('Do you want to save changes to {0}?') with Yes/No/Cancel buttons. If Cancel is hit, the operation stops. Open document: same dialog box as at new document, and an Open dialog opens after Save document: if the current document hasn't been saved, a Save dialog opens Save as: you can imagine... So, is there anything standard in the .NET framework like this or do I have to manually implement it?

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >