문제

I need to allow users to add new entries to GridView but at the same to disallow editing of existing entries. How can I achieve this?

도움이 되었습니까?

해결책

You can use the IsReadOnlyBinding property of a RadGridView, for example:

<telerik:RadGridView ItemsSource="{Binding Path=MyViewModel.SomeData}" 
                     IsReadOnlyBinding="{Binding Path=IsExisting}" ... />

Each of your entries would then need to have a property named IsExisting, which has the value true if the entry is existing and false if it is new.

다른 팁

if I'm correct, you can set the IsReadOnly property to be true so that the user cannot change existing entries on the grid.

However, you can always change the collection of data that the grid is binded to, in the code behind.

All you would have to do is add some new item to the collection, and then call Rebind on the grid. And your grid will be updated.

HTH

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top