.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ListView in Xaml Form

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
660 Views, 4 Replies

ListView in Xaml Form

I want to display data extracted from the Drawing in a grid format. I have added a ListView Control to a Xaml Form and tried all sorts of code - but I can't get the data to list correctly.

Has anyone had any success with this task?
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

There are a lot of tutorials and how-to's on the web for the WPF ListView,
and I would suggest you do some research.

One way is to define a class that exposes the data for each row of the grid
as class properties, and then in XAML define the view of the data, by
binding columns to the class properties.

Here's a blog entry with a simple example:

http://www.codewrecks.com/blog/index.php/2008/03/26/first-steps-on-wpf-listview-with-template-based-on-data/

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6297839@discussion.autodesk.com...
I want to display data extracted from the Drawing in a grid format. I have
added a ListView Control to a Xaml Form and tried all sorts of code - but I
can't get the data to list correctly.

Has anyone had any success with this task?
Message 3 of 5
Anonymous
in reply to: Anonymous

Thanks for the reply, Tony.

I got the columns defined ok, but it is how to add the data.

I have tried to define an ArrayList in code by defining a class of data variables. I then link the ArrayList to the ListView using .ItemsSource.

But I get blank rows with no data ...

I just wondered if anyone had been successful in filling a ListView at runtime with data in a Grid format?
Message 4 of 5
Anonymous
in reply to: Anonymous

I think you may need a little more background on WPF, the
ListView, and using XAML to bind to data. It does work if
done correctly.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6298516@discussion.autodesk.com...
Thanks for the reply, Tony.

I got the columns defined ok, but it is how to add the data.

I have tried to define an ArrayList in code by defining a class of data
variables. I then link the ArrayList to the ListView using .ItemsSource.

But I get blank rows with no data ...

I just wondered if anyone had been successful in filling a ListView at
runtime with data in a Grid format?
Message 5 of 5
Anonymous
in reply to: Anonymous

You might also want to try the MSDN discussion groups as
the problem you're having with WPF really doesn't have much
to do with AutoCAD, or the fact that the data comes from an
AutoCAD application. It's pretty much the same regardless
of what the data is or where it's coming from.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6298516@discussion.autodesk.com...
Thanks for the reply, Tony.

I got the columns defined ok, but it is how to add the data.

I have tried to define an ArrayList in code by defining a class of data
variables. I then link the ArrayList to the ListView using .ItemsSource.

But I get blank rows with no data ...

I just wondered if anyone had been successful in filling a ListView at
runtime with data in a Grid format?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost