or
<telerik:RadGridView.RowStyle> <Style TargetType="telerik:GridViewRow"> <Setter Property="Background" Value="{Binding Status,Converter={StaticResource rowcolorConveter}}"></Setter> <Setter Property="Background" > <Setter.Value> <MultiBinding Converter="{StaticResource ABCConveter}"> <Binding Path="abc"/>//Hardcode Column Name <Binding Path="DataContext.SelectedView" RelativeSource="{RelativeSource AncestorType={x:Type UserControl}}"/> </MultiBinding> </Setter.Value> </Setter> </Style> </telerik:RadGridView.RowStyle>
I have a RadGridView bound to ObservableCollection. This collection is constantly updated and on first binding the grid represent the data correctly. But then I click on one of the headers to sort the data in the grid. After that behaviors on adding a new row become as following:
- the grid adds the row to the end of the list only, it doesn't sort data dynamically according sorting column;
- sometimes (often) the grid creates duplicate rows while underlying collection contains correct data;
I couldn't find in documentation any info that I should programmatically sort underlying collection each time after adding row or rebind it every time so the grid shows it correctly. What should I do to fix it or it\s a norm for Telerik Grid?
<telerik:RadTreeView ItemPrepared="OnItemPrepared" .../> protected void OnItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e) { if (e.PreparedItem.AllowDrop) { e.PreparedItem.DragEnter += OnPreparedItemDragEnter; e.PreparedItem.Drop += OnPreparedItemDrop; } }if(dialog.ShowDialog == true){ DoSomething();}DoCleanup();