Adding Datarow to Datatable set as DataContext Giving error
I have been trying to add Datarow to empty Datatable that has one not null column through C#. Finally this DataTable will be used as DataContext for my UI.Code Snippet:string sqlStmt = "select * from...
View ArticleHow do I change the UserControl visibility from the MainWindow - WPF Question
I have a User Control that is a calculator. I want to open this tool from a menu control defined in the Main Window XAML. So I added a reference for the control, created an instance of the control in...
View ArticleTextBox Text is not editable or selectable in customcontrol
Greetings,I got a custom control which displays the weight of a Vertex in a circle. I build this with a boarder which contains a stackpanel. This stackpanel keeps the textblock. The TextBlock.Text...
View ArticleHow can I save a PDF file to MS SQL serve 2008
Dear all,Can somebody help me. How can I save a PDF file to MS SQL serve 2008. I am creating one windows application in VS using WPF. and I want to upload PDF files in MS SQL Server 2008. I created...
View ArticleCollectionViewSource ... pre-set sort description is ignored
Hi,consider the following situation:I have a CollectionViewSource with a pre-set default sort description. This may be set right after constructing the instance of CollectionViewSource. Later on (e.g....
View ArticleMak right grid's column always visible
Hello,I have created a grid with 3 columns.When the window is resized, I want the 1st and 2nd columns to grow\shrink accordingly while the 3rd stays the same andis always, at all times, visible.How can...
View ArticleHow to init Style type property in sample data source
I have a viewmodel with Style type property and want to create sample data source to get view in designer. I use Application.Current.FindResource("CustomStyle") to define property in code behind, but...
View ArticleSwitch Views Using MVVM in WPF
Hi I am new to wpf and mvvm I am developing an application that contains nearly 20 to 22 user controls(22 views, 22 viewmodels) including login control all controls are grouped in to 7, each views...
View Articledatagrid, datatable updating values in celltemplate
Hi,I've made this control that basically creates dynamic columns in a datagrid each time it is loaded. The itemssource is a datatable. The reason its a datatable is because depending on an object...
View Article.net WPF App has visually different style than WinFORMS on Windows 8
Hey Everyone, Developing a WPF application using VS2012, on Windows 8. This is a standard desktop app. I'm using WPF because it has the Ribbon as a standard control, where as WinForms does not....
View ArticleLocation for Linq statement in MVVM pattern
Hi,I am working on my first WPF app using MVVM application with EF Model. I have created a View, ViewModel and I have a Model using EF 5. In my View I've added few combo boxes at the top so that...
View ArticleHow can I set the Title for the System.Windows.Forms.PrintDialog?
Hi,I am using the System.Windows.Forms.PrintDialog in my application. I want to set the title of this window to "Print Setup". But default value on the Titlebar of the dialog is "Print". And there is...
View ArticleWPF WebBrowser Control - Allow Blocked Content Setting
In my WPF app that contains a WebBrowser control I get the following message when I set the Source to a local HTML file (that uses javascript) "To help protect your security, Internet Explorer has...
View ArticleRandom hang-up when showing a dialog on a touchscreen on Win8
Hello,We are developing an application with VS2010, C#, WPF and NET Framework 4.0.The application is having random hang-ups after showing a dialog. This problem only happens on Win8 and with a...
View Articleeditable matrix type control with dynamic columns
Hi,I have a datatable. Which is returned from an sp. This sp can return a datatable with x amount of columns so I can create a datagrid which can display okThe data looks something like this -identity...
View ArticleWpf.net4 run the machine. Net45?
Working up the files app. config how should be taken?I am using this code but do not take the solution?<?xml version="1.0" encoding="utf-8" ?><configuration> <startup>...
View ArticleWPF DataGridTextColumn.EditingElementStyle MaxLength property not working...
Hi,I'm using a DataGrid in my WPF which is databound to a ObservableCollection. I've set max length property of one of the columns to 5 but it's working very strangely. It can take the values like...
View ArticleFind out if text is wrapped
Hiis there a way to find if the text of Textblock with TextWrapping="Wrap"is actually wrapped?If I have a var "myTextBlock" in cs how can i test whether the content is currently wrapped or not?I mean I...
View ArticleGrouping in DataGrid
Hi,I am using grouping in datagrid. Everything works as expected, but when user selects UP/DOWN in scroll viewer, it does not move one row at a time. Half row is shown for one down and then user has to...
View Article