Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
503 views
in Technique[技术] by (71.8m points)

datagrid - How to Remove Default Row In Wpf data Grid

I am using a WPF Data Grid. Whenever it is loaded there is a blank default row. How can I disable the default row from appearing like you can in the Windows Forms grid.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is the row for new entries. If you don't want let the user create new entries or if you handle this from code, e.g. with a add-button, disable the CanUserAddRows-option.

<DataGrid  CanUserAddRows="False" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...