This is a migrated thread and some comments may be shown as answers.

[Solved] clicking add new item does not work when showinsertrow = true

3 Answers 167 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Valentijn
Top achievements
Rank 1
Valentijn asked on 26 Oct 2010, 04:08 PM
Hi

When i click on 'add new item' on the grid below, nothing happens. Is there any reason why this would not work? I thought that adding ShowInsertRow was enough. Editing a row by doubleclicking the row works.

Does anybody know of any reasons why a new item would not be allowed or supported (CanUserInsertRows is true by default) ?

<

 

 

telerik:RadGridView Grid.Row="1" Grid.Column="1" ColumnWidth="*" ShowGroupPanel="False" AutoGenerateColumns="False" ItemsSource="{Binding Path=MainContact.ContactCommunications}" Margin="0,0,0,10" Name="gridMainCommunications" CanUserReorderColumns="False" IsFilteringAllowed="False" ShowInsertRow="True">

 

 

 

 

<telerik:RadGridView.Columns>

 

 

 

 

<telerik:GridViewDataColumn UniqueName="CommunicationTypeId" Header="{Binding Path=stringResources.lblType, Source={StaticResource LocalizedStrings}}" DataMemberBinding="{Binding CommunicationTypeId}">

 

 

 

 

</telerik:GridViewDataColumn>

 

 

 

 

<telerik:GridViewDataColumn UniqueName="Value" Header="{Binding Path=stringResources.lblValue, Source={StaticResource LocalizedStrings}}" DataMemberBinding="{Binding Value}">

 

 

 

 

</telerik:GridViewDataColumn>

 

 

 

 

<telerik:GridViewDataColumn UniqueName="Deleted" Header="{Binding Path=stringResources.lblValue, Source={StaticResource LocalizedStrings}}" DataMemberBinding="{Binding Deleted}">

 

 

 

 

</telerik:GridViewDataColumn>

 

 

 

 

</telerik:RadGridView.Columns>

 

 

 

 

</telerik:RadGridView>

 

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Oct 2010, 04:20 PM
Hi Valentijn,

The ability to insert and delete items depends on the type of collection you use as data source for the grid. Basically, you need to implement either IList or EditableCollection. If this is not your case, I would need more details about your scenario, so that I could provide you with a more suitable solution.
 

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Valentijn
Top achievements
Rank 1
answered on 27 Oct 2010, 01:50 PM
Hi Maya

I'm using DomainDataSource.DataView from RIA services which is based on Entity Framework. I can add items to the collection with Add() command manually. In the gridview, the EDIT is working. If the Edit is working, shouldn't add and delete also work?

Best regards

Valentijn
0
Maya
Telerik team
answered on 28 Oct 2010, 07:37 AM
Hi Valentijn,

The ability to edit the items does not necessarily mean that you can add and delete them. Please take a look at this forum thread for further reference on the way of implementing the functionality of inserting and removing items in similar scenarios to yours.

Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Valentijn
Top achievements
Rank 1
Answers by
Maya
Telerik team
Valentijn
Top achievements
Rank 1
Share this question
or