Edit a cell in DataGrid

P

Pranav Shah

I have a Windows DataGrid with 6 columns.
The DataSource is a DataTable that gets populated based on
user request.
Column 5 & 6 are Expression columns based on Columns 1 & 2
and Columns 3 & 4 repectively.

In the DataGrid I wanto do a few things.
1)Allow user to modify columns 3 - 6.
2)When the user is editing a column he can press Enter or
Tab and the change will be accepted. At this moment the
user needs to click on a different column or different
object.
3)I can make edit Columns 5 & 6 but as soon as I loose
focus my chages are not accepted and only the Expression
value is acceped.

Any help is appreciated. Thanks.
 
R

Rajesh Patel

1. you can stop editing of other columns then 3 and 6 by making
datagridtextboxcolumn readonly = true.

2. check events for keyboards.

3. don't make it expression column. just make the column. populate it.
change the values on datagrid's events for other columns, the columns which
you use in expression for column 5 and 6.

Rajesh Patel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top