.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Understanding DataGrids with ComboBoxes

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :WPF
I'm new to WPF.  I have the following XAML and back code.  I'm trying to have a simple DataGrid with a ComboBox in one of the fields.  The window loads OK, but I get a "Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception."  when I click on the ComboBox.  Can anyone see what I am missing?   <Window x:Class="LookPC.LongRangeSetup"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         Title="AGENT II - Long-Range Setup" Height="768" Width="1024" Icon="/LookPC;component/Images/Lookpc.ico" WindowState="Maximized" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight"> <Grid Name="MiscGrid" ShowGridLines="True" Height="1024" >    <Grid.ColumnDefinitions>        <ColumnDefinition Width="*"></ColumnDefinition>    </Grid.ColumnDefinitions>    <TextBlock Height="23" HorizontalAlignment="Left" Margin="136,135,0,0&q

View Complete Post

More Related Resource Links

Truly Understanding View State

This article provides a detailed understanding of the ViewState.

CLR Inside Out: Understanding The CLR Binder


In this article, we cover some of the best practices for assembly binding and loading using the CLR.

Aarthi Ramamurthy and Mark Miller

MSDN Magazine May 2009

Access Control: Understanding Windows File And Registry Permissions


Understanding the ACLs that govern permissions and rights before an operation is allowed to proceed is critical to enhancing security.

John R. Michener

MSDN Magazine November 2008

Advanced WPF: Understanding Routed Events And Commands In WPF


See how routed events and routed commands in Windows Presentation Foundation form the basis for communication between the parts of your UI.

Brian Noyes

MSDN Magazine September 2008

CLR Debugging: Improve Your Understanding of .NET Internals by Building a Debugger for Managed Code


With the release of .NET, the Microsoft scripting strategy has evolved. Script engines can now compile or interpret code for the Microsoft common language runtime (CLR) instead of integrating debugging capabilities directly into apps through Active Scripting. With that change comes a new set of published services for including debugging functionality in a custom host application. You'll see how to use the debugging services published in the .NET Framework to create a full-featured CLR debugger that allows you to set breakpoints, view call stacks, browse variables, view processes, enumerate threads, and perform other important debugging tasks.

Mike Pellegrino

MSDN Magazine November 2002

Apparently missing something in my understanding of session handler...


 It was doing exactly what I expected until I added more than 1 property to it.   It seems if I set the value of a property this, in turn, sets every property in the handler to the same value.  It's blatantly obvious I didn't have the understanding I thought I did on this.  :-)

Could someone point out what I'm missing?  I figured it had something to do with the "shared" but if it's not shared then I would have to declare an instance on my page which would kinda ruin the state of my variables (otherwise, I'd just put them all in my class), right??

Private Shared _strStudentName As String
Private Shared _strSchoolID As String

    Public Shared Property StudentName() As String


            If (HttpContext.Current.Session(SessionHandler._strStudentName) Is Nothing) Then
                Return String.Empty
                Return HttpContext.Current.Session(SessionHandler._strStudentName).ToString()
            End If

        End Get

        Set(ByVal value As String)
            HttpContext.Current.Session(SessionHandler._strStudentName) = value
        End Set

    End Property

    Public Shared Property SchoolID() As String


            If (HttpContext.Current.Session(SessionHandler._strSchoo

Need help in understanding code.

Friends, this code is written in global.asax file, kindly tell me what this code is doing?void Application_Start(object sender, EventArgs e) { // Code that runs on application startup if (HttpContext.Current.User != null) { FormsIdentity id = (FormsIdentity)(User.Identity); String s = id.Ticket.UserData; String[] r = s.Split(','); HttpContext.Current.User = new GenericPrincipal(id, r); } }

How can I bind 2 comboboxes in 2 different WPF windows to the same observable collection?

I have a pretty simple (or deceptively not so) question. I have a WPF application that has a nicely bound combo to an ObservableCollection. I am trying to correctly implement MVVM. One thing I am trying to do (as a test for other things I need) is to have a combo in a popup window have the same content (2-way data bound) as the combo on the main window. I have the main window set up with no issues. <     ComboBox Height="23" HorizontalAlignment="Left" Margin="110,197,0,0" Name="comboBox1" VerticalAlignment="Top" Width="194" ItemsSource="{Binding MyStuff}"/> where "MyStuff" is an ObservableCollection. My problem comes when I create a new wpf application (separate project), put a combo on it, launch it from a button in the first project, and try to bind the combo to the same ItemsSource. I can't seem to figure out the syntax. My 2 issues are as follows: 1. I think the XMAL in the child window needs to have something like this: <     ComboBox Height="23" HorizontalAlignment="Left" Margin="110,257,0,0" Name="comboBox1" VerticalAlignment="Top" Width="194" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ObservableCollection}, AncestorLevel=2}
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend