473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Dynamic use of WPF datagrid

Hi.

I have the following scenario.

I have a WPF form with a datagrid on it
The datagrid is hook up using binding to a Qbservalcollection. The datagrid should be seen as a propertyeditor. Like the on in visual studio
1 Colum with the propertyname (this is read only)
1 Colum with the propertyvalue

The basic model for the collection is contaning.
Public PopertyName
Public PropertyValue.

This is quite simple and works fine, when passing data to the collection is gets populated in the view.

Now come the tricky part, in the viewmodel there is a eventhandler reacting on a message from another viewmodel.
I takes a propertyobject, the object can differ from message to message.
It is the eventhandles taks to translate the propertobject into something the can be shown in the data grid.

e.g.
a propertyobjec could look like this

id = 100
name = "Action1"
time1 = "1000"
time2 = "2000"
and so on.

This is stille quite ok to show in the data grid, BUT
some of the Values would be nice to show as preselected values in a combobox in the datagrid, but only some, and this differs from propertyobject to propertyobject

e.g.
in one message Value pair number 3 should be a combobox in the datagrid.
in another message it should be Value pair 5 7 8 the should be shown as combobox in the data grid.

As im using a MVVM approche this should be done using biding and some dynamic content template or something.

The question is how should this be done ?

Br.
Michael Rahr
Feb 17 '12 #1
0 1339

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: JP011 | last post by:
Hello I have hit a major road block when it comes to building my dynamic datagrid. To make a long story short I need a dynamic datagrid because my connection string could change and I need the...
0
by: Karlo Swart via .NET 247 | last post by:
Hi. I am creating a dynamic datagrid. The columns are based on a request.querystring value. Eg: I will pass in a 'func=toys' parameter, which will cause the datagrid to load create columns...
1
by: Mark | last post by:
Hello, I have a database which contains approximately 30 reference tables. I've been looking at building a dynamic datagrid that is updateable, but have run into problems with the Cancel and...
1
by: Sudhir | last post by:
I have created a dynamic datagrid and would like to sort the grid when I click the column name in the header. ----------------------------------------------- Private Sub btnSearch_Click(ByVal...
1
by: bshannon | last post by:
Can someone point me in a direction or show me an example of creating a dynamic datagrid. Based on a users input I would like to have the datagrid created progromatically if possible. There are...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
1
by: benoit | last post by:
Hi, I created a Dynamic Datagrid and i added an EditCommandColumn to it. Works fine, but my Editcommand eventhandler seems to have a problem with PostBack This is my code private DataGrid...
7
by: CanoeGuy | last post by:
I have been trying for the last two weeks to display a dynamic DataGrid. The data that I'm pulling from a SQL Server DB will have whole columns that will be either NULL or 0. I want to display...
1
by: RitaK | last post by:
Hi, I have a dynamic datagrid linking to an SQL Table which works fine. I now want the user to be able to click on a column header to selct the column(s) and at the same highlight the selected...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.