Well, I tend to stay away from the DataGrid control - however as far as I
know when binding directly to an object collection it creates the grid based
on the object you're using. Just add a boolean property to your Employee
object with a get and set accessor. When the user modifies the checkbox in
the column, the object in your collection will be updated as well.
If this solution does not work for you, we need more information how your
data layer is setup when you're persisting data from your application back
to the database.
"Ronald S. Cook" <rcook@westinis.comwrote in message
news:4DAE8C11-455A-4745-9707-B058AA8FA971@microsoft.com...
Quote:
>I bring back a list of Employees as an IEnumerable of Employee... columns
>include EmployeeId, EmployeeLastName, etc.
>
I want to bind the IEnumerable to a datagrid BUT I want the grid to have
an extra column, a checkbox for the user to select some employees and not
others.
>
I will then use this information, but the checkbox column does not
correspont to a column in the Employee table to get updated.
>
Is there a way I can add a column to an IEnumerable? What is a "normal"
way to do what I'm trying to do?
>
I can convert the IEnumerable to a DataTable and add a column to it and
then bind to the datagrid, but that seems like a hack.
>
Thanks for any help,
Ron
>