Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WPF in VS 2008, simple question.

Posted on 2012-04-02
12
Medium Priority
?
364 Views
Last Modified: 2012-06-27
Starting to learn WPF in VS 2008.

Here is a simple question. I have brought in a table in Data Sources, have created my query in Fill method. Data comes in good in Preview, but now having trouble binding it to WPF window. Tables don't have any drop downs to select what control to bring over to WPF window (like is suggested in help).

Need step by step instructions:

Using DataAdpter Fill method I want to bring data in some form onto the WPF window.
I could not find any datagrids for WPF in my Toolbox for some reason.
But we can first try with Listbox, or perhaps UniformGrid control?
0
Comment
Question by:LenkaL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37800612
The DataGrid is now part of WPF 4, starting with 2010.  It was "borrowed" from the WPF Toolkit.

WPF Toolkit - June 2009 Release
http://wpf.codeplex.com/releases/view/29117
0
 

Author Comment

by:LenkaL
ID: 37801248
Thanks, so what should I do in VS 2008 to display the data from the table I brought in to my project from the database. I have a table, and Fill method with my query. How can I make the data available in my WPF form?

What would be the syntax to make it available? Using dataadaptor?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37801580
If you use the WPF Toolkit DataGrid, then I believe that it should be something like this:

WPF Toolkit: DataGrid Feature Walkthrough
http://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-datagrid-feature-walkthrough.aspx

<dg:DataGrid ItemsSource="{StaticResource myData}"/>

Open in new window

0
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 

Author Comment

by:LenkaL
ID: 37801700
No, don't have access to WPF datagrid, need to use other objects.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37801878
You should be able to download, and install the WPF Toolkit.
0
 

Author Comment

by:LenkaL
ID: 37802040
On my network don't have permissions to download it. Can you please paste the code here on how to bind or populate my Fill method in a table to a ListView?

Thx.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37802078
For ListView.ItemsSource, the syntax should be the same for the Binding.
0
 

Author Comment

by:LenkaL
ID: 37802094
What about Columns in ListView - they are not autoexpendable like in DataGrid?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 37802161
If you are asking about AutoGenerateColumns, I don't believe that the WPF ListView has that functionality.

Using a WPF ListView as a DataGrid
http://weblogs.asp.net/psheriff/archive/2010/03/08/using-a-wpf-listview-as-a-datagrid.aspx
0
 

Author Comment

by:LenkaL
ID: 37802981
Ok tried that but getting only "System.Data.DataRowView" filled in in my ListView.

Perhaps something am I doing wrong?

Seemingly a very simple task - to get data in my table to the ListView, but so hard to find a solution.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 37803373
Can you show me how you defined the columns for the ListView, please?
0
 

Author Closing Comment

by:LenkaL
ID: 37803413
I figured it out, by putting my DataSet in the Collection and then binding that collection to ListView.

Thx.

Watch for my other questions on WPF.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question