Bob
Bob

Reputation: 861

WPF - Bind Grid Rows to List of Model

So I have a list of persons, and would like each row in my grid to correspond to a element in the list.
The trick is - I would like each attribute of a person to have a different control.

For example I would like the name attribute to use a textbox, the age attribute to use a dropdown box, and the isfemale attribute to use a checkbox.

In other words I want a grid of repeating rows, where is row is a set if different controls.

EDIT: How do I set each column in the datagrid to a different type of control?

Upvotes: 0

Views: 687

Answers (1)

John Gardner
John Gardner

Reputation: 25156

so are you looking for DataGrid then?

http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.aspx

A table of rows + columns, where each column has different controls?

you can hide the column headers, and adjust the styling of the grid to make it look like a list, if you really want it to look like a list.

Upvotes: 1

Related Questions