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

RadAutoCompleteBox not working after call BeginInsert in Radgridview

1 Answer 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 03 Mar 2015, 06:28 PM
Good Morning.

I need to put a RadAutoCompleteBox inside a GridViewDataColumn, I follow this RadAutoCompleteBox inside GridView example.

Works only when I editing an existent column, but I facing problems when I try to Insert a new row or when I Cancel any modifications.

When I need to insert a new record I call the method BeginInsert of GridView.

this.radGridView.BeginInsert();

It add a new empty row at the end, but then the autocomplete doesn't work anymore.

When I want edit an existing row, and suddenly I decide to cancel the edition; I press Esc key and the value of the column doesn't return to his original value.

I Attach an example of the solution, it has a button with click event, and in the event I call BeginInsert method.
I upload it to dropbox.

Many thanks.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 05 Mar 2015, 03:37 PM
Hi,

It seems the DataContext of the ItemsSource is not correctly resolved. You can additionally specify the correct Source, for example:
<telerik:GridViewDataColumn Width="100" DataMemberBinding="{Binding SelectedItem.Name}" Header="Country">
 <telerik:GridViewDataColumn.CellEditTemplate>
    <DataTemplate>
      <telerik:RadAutoCompleteBox ItemsSource="{Binding Countries, Source={StaticResource ViewModel}}" ... />
    </DataTemplate>
  </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>

Let me know how this works for you.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Robert
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or