TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Roberto Salemi
NA
146
140.9k
[WPF] DataGrid Read Only but not for new row
Apr 17 2015 9:11 AM
Hi,
I have a DataGrid (called dgSample), where I set IsReadOnly="True".
User can add a new Row, this row must be editable.
So in my model I set a property:
[DefaultValue(false)]
public virtual bool IsNewItem { get; set; }
where user add new row I set this property to true
So in my DataGrid I have:
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsNewItem}" Value="True">
<Setter Property="IsReadOnly" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
but the last Row is not editable, why?
Thanks.
Reply
Answers (
3
)
[WPF] DataGrid: apply style to text into cell from codebehin
[WPF] DataGrid Cell Style: Textdecoration Strikethrough