I have a datagrid which have ony two rows. i want the cells of the second row clickable but not for the first row. first row should be read only. i mean first row consists of cells of clickable type and second row consists of cells of non cickable type. i have tried a lot. i am not getting it done.
Asked
Active
Viewed 1,206 times
1
-
First hit on gooogle: http://stackoverflow.com/questions/6766408/wpf-how-to-disable-cell-edit-in-datagrid ... – bobblez Aug 06 '12 at 14:02
-
2that link is only for changing an entire grid or column. he wants it for just the first row. Check this one http://stackoverflow.com/q/8833081/1074345 – emybob Aug 06 '12 at 14:07
-
Thanks for the suggestion. i am still not able to find the solution. my scenario is i want to make a timesheet ui which will have a grid which have 5 columns(weekdays) and two rows. one row for dates which i want read only(normal text not clickable) and other row for time. for Time row,each cell consists of linkable time(hours).Any suggestions please? – neo Aug 07 '12 at 05:48
1 Answers
0
Maybe you could try putting an if statement to check if it is the first row, if it is then return in your event handler.
if (dg.CurrentRow == null||dg.CurrentRow == dg.Rows[0])
{ return;}

Sheng Liu
- 79
- 1
- 8