Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WPF DataGridView
Hello All,
I a particular requirement as follows;
Table of data Items (as shown below)where number of columns are known only at the design time

+-----+------+........+---------+
|Col 1|Col 2 |        |  Col N  |
|     |      |        |         |
+-----+------+........+---------+
|  D1 |  D 1 |        |         |
|     |  D 2 |        |         |
|     |   .  |        |         |
|     |   .  |        |         |
|     |  D N |        |         |
+-----+------+........+---------+
|  D1 |  D 1 |        |         |
|     |  D 2 |        |         |
|     |  D 3 |        |         |
+-----+------+........+---------+

if we look at the column 2, row 1 and 2 it contains a variable number of items to be displayed, again the number of data items are known only at the design time !

I have data models as follows
Class Col -> represents a cell {Members are" ColName,ObservableList}
Class Row -> represents a Row {Members are" RowNumber,ObservableList}
and finally I have an observable list of Rows which represents the entire table

Could somebody suggest me How I make a display using WPF as shown above?

Thanks in advance.
Krish
Posted 1-May-13 14:23pm
Comments
SDavisworth at 5-Nov-13 0:03am
   
Hello Radkrish... did you ever get resolve on this as I'm in a similar position?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello Davis,

It is small application so I switched to WPF instead of windows forms.

In WPF it is possible to define a template for each column and handle the event thats populating the grid to add items to the list box.

Hope that helps!

Regards
Krish
  Permalink  
Comments
spins3 at 10-Apr-14 8:01am
   
Hello Krish can you please give a sample snippet.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Suvendu Shekhar Giri 285
1 Sergey Alexandrovich Kryukov 245
2 OriginalGriff 210
3 PIEBALDconsult 180
4 Peter Leow 125
0 Sergey Alexandrovich Kryukov 6,425
1 OriginalGriff 5,918
2 Peter Leow 2,514
3 Maciej Los 2,263
4 Abhinav S 2,249


Advertise | Privacy | Mobile
Web02 | 2.8.150414.1 | Last Updated 5 Nov 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100