Telerik Forums
UI for WPF Forum
0 answers
347 views
Hello
I have seen quite a few examples to Save and Load the Gridview settings, but all of them use the IsolatedStorage which is only available for Clickonce applications.
My application is not a Clickonce, hence I cannot use that.
Is there another way to save/load settings?
I have got Telerik Q3 2010 version and am using .NET 3.5
I also tried modifying the RadGridViewSettings class and use IsolatedStorageFile.GetUserStoreForAssembly
as below, but when serializing, I get an error saying:
Type 'System.Windows.Input.Cursor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  See the Microsoft .NET Framework documentation for other supported types.

Any ideas?
Regards
Apoorva
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.ComponentModel;
using System.Windows;
using System.Windows.Data;
using Telerik.Windows.Controls;
using Telerik.Windows.Data;
using Telerik.Windows.Controls.GridView;
using System.Windows.Controls;
using System.Runtime.Serialization;
using System.IO;
using System.IO.IsolatedStorage;
using System.ServiceModel;
 
namespace Groupcall.MessengerInvoice
{
    public class RadGridViewSettings
    {
        public RadGridViewSettings()
        {
            //
        }
        public class RadGridViewApplicationSettings : Dictionary<string, object>
        {
            private RadGridViewSettings settings;
 
            private DataContractSerializer serializer = null;
             
            string folderName = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
            string settingsFile;
 
            public RadGridViewApplicationSettings()
            {
                //
            }
 
            public RadGridViewApplicationSettings(RadGridViewSettings settings)
            {
                this.settings = settings;
                settingsFile = Path.Combine(folderName, "Groupcall\\GC Messenger Invoice\\UsageGridSettings.xml");
                List<Type> types = new List<Type>();
                types.Add(typeof(List<ColumnSetting>));
                types.Add(typeof(List<FilterSetting>));
                types.Add(typeof(List<GroupSetting>));
                types.Add(typeof(List<SortSetting>));
                types.Add(typeof(List<PropertySetting>));
                types.Add(typeof(TextBlock));
                types.Add(typeof(System.Windows.Media.MatrixTransform));
 
                this.serializer = new DataContractSerializer(typeof(RadGridViewApplicationSettings), types);
            }
 
            public string PersistID
            {
                get
                {
                    if (!ContainsKey("PersistID") && settings.grid != null)
                    {
                        this["PersistID"] = settings.grid.Name;
                    }
 
                    return (string)this["PersistID"];
                }
            }
 
            public int FrozenColumnCount
            {
                get
                {
                    if (!ContainsKey("FrozenColumnCount"))
                    {
                        this["FrozenColumnCount"] = 0;
                    }
 
                    return (int)this["FrozenColumnCount"];
                }
                set
                {
                    this["FrozenColumnCount"] = value;
                }
            }
 
            public List<ColumnSetting> ColumnSettings
            {
                get
                {
                    if (!ContainsKey("ColumnSettings"))
                    {
                        this["ColumnSettings"] = new List<ColumnSetting>();
                    }
 
                    return (List<ColumnSetting>)this["ColumnSettings"];
                }
            }
 
            public List<SortSetting> SortSettings
            {
                get
                {
                    if (!ContainsKey("SortSettings"))
                    {
                        this["SortSettings"] = new List<SortSetting>();
                    }
 
                    return (List<SortSetting>)this["SortSettings"];
                }
            }
 
            public List<GroupSetting> GroupSettings
            {
                get
                {
                    if (!ContainsKey("GroupSettings"))
                    {
                        this["GroupSettings"] = new List<GroupSetting>();
                    }
 
                    return (List<GroupSetting>)this["GroupSettings"];
                }
            }
 
            public List<FilterSetting> FilterSettings
            {
                get
                {
                    if (!ContainsKey("FilterSettings"))
                    {
                        this["FilterSettings"] = new List<FilterSetting>();
                    }
 
                    return (List<FilterSetting>)this["FilterSettings"];
                }
            }
 
            public void Reload()
            {
                try
                {
                    //using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication())
                    using (IsolatedStorageFile file=IsolatedStorageFile.GetUserStoreForAssembly())
                    {
                        using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(PersistID, FileMode.Open, file))
                        //using (FileStream stream=new FileStream(settingsFile,FileMode.Open))
                        {
                            if (stream.Length > 0)
                            {
                                RadGridViewApplicationSettings loaded = (RadGridViewApplicationSettings)serializer.ReadObject(stream);
 
                                FrozenColumnCount = loaded.FrozenColumnCount;
 
                                ColumnSettings.Clear();
                                foreach (ColumnSetting cs in loaded.ColumnSettings)
                                {
                                    ColumnSettings.Add(cs);
                                }
 
                                FilterSettings.Clear();
                                foreach (FilterSetting fs in loaded.FilterSettings)
                                {
                                    FilterSettings.Add(fs);
                                }
 
                                GroupSettings.Clear();
                                foreach (GroupSetting gs in loaded.GroupSettings)
                                {
                                    GroupSettings.Add(gs);
                                }
 
                                SortSettings.Clear();
                                foreach (SortSetting ss in loaded.SortSettings)
                                {
                                    SortSettings.Add(ss);
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    //MessageBox.Show(ex.Message);
                }
            }
 
            public void Reset()
            {
                try
                {
                    //using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication())
                    using (IsolatedStorageFile file=IsolatedStorageFile.GetUserStoreForAssembly())
                    {
                        file.DeleteFile(PersistID);
                        //File.Delete(settingsFile);
                    }
                }
                catch
                {
                    //
                }
            }
            public void Save()
            {
                try
                {
                    //using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication())
                    using (IsolatedStorageFile file=IsolatedStorageFile.GetUserStoreForAssembly())
                    {
                        using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(PersistID, FileMode.Create, file))
                        //using (FileStream stream=new FileStream(settingsFile, FileMode.Create))
                        {
                            serializer.WriteObject(stream, this);
                        }
                    }
                }
                catch (Exception ex)
                {
                    //
                    MessageBox.Show(ex.Message);
                }
            }
        }
 
        private RadGridView grid = null;
 
        public RadGridViewSettings(RadGridView grid)
        {
            this.grid = grid;
        }
 
        public static readonly DependencyProperty IsEnabledProperty
           = DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(RadGridViewSettings),
                new PropertyMetadata(new PropertyChangedCallback(OnIsEnabledPropertyChanged)));
 
        public static bool GetIsEnabled(DependencyObject dependencyObject)
        {
            return (bool)dependencyObject.GetValue(IsEnabledProperty);
        }
 
        public static void SetIsEnabled(DependencyObject dependencyObject, bool enabled)
        {
            dependencyObject.SetValue(IsEnabledProperty, enabled);
        }
 
        private static void OnIsEnabledPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            RadGridView grid = dependencyObject as RadGridView;
            if (grid != null)
            {
                if ((bool)e.NewValue)
                {
                    RadGridViewSettings settings = new RadGridViewSettings(grid);
                    settings.Attach();
                }
            }
        }
 
        public virtual void LoadState()
        {
            try
            {
                Settings.Reload();
            }
            catch
            {
                Settings.Reset();
            }
 
            if (this.grid != null)
            {
                grid.FrozenColumnCount = Settings.FrozenColumnCount;
 
                if (Settings.ColumnSettings.Count > 0)
                {
                    foreach (ColumnSetting setting in Settings.ColumnSettings)
                    {
                        ColumnSetting currentSetting = setting;
 
                        GridViewDataColumn column = (from c in grid.Columns.OfType<GridViewDataColumn>()
                                                     where c.UniqueName == currentSetting.UniqueName
                                                     select c).FirstOrDefault();
 
                        if (column != null)
                        {
                            if (currentSetting.DisplayIndex != null)
                            {
                                column.DisplayIndex = currentSetting.DisplayIndex.Value;
                            }
 
                            if (setting.Width != null)
                            {
                                column.Width = new GridViewLength(setting.Width.Value);
                            }
                        }
                    }
                }
                using (grid.DeferRefresh())
                {
                    if (Settings.SortSettings.Count > 0)
                    {
                        grid.SortDescriptors.Clear();
 
                        foreach (SortSetting setting in Settings.SortSettings)
                        {
                            ColumnSortDescriptor d = new ColumnSortDescriptor();
                            d.Column = (from c in grid.Columns.OfType<GridViewBoundColumnBase>()
                                        where c.GetDataMemberName() == setting.PropertyName
                                        select c).FirstOrDefault();
                            d.SortDirection = setting.SortDirection;
 
                            grid.SortDescriptors.Add(d);
                        }
                    }
 
                    if (Settings.GroupSettings.Count > 0)
                    {
                        grid.GroupDescriptors.Clear();
 
                        foreach (GroupSetting setting in Settings.GroupSettings)
                        {
                            ColumnGroupDescriptor d = new ColumnGroupDescriptor();
                            d.Column = (from c in grid.Columns.OfType<GridViewBoundColumnBase>()
                                        where c.GetDataMemberName() == setting.PropertyName
                                        select c).FirstOrDefault();
                            d.SortDirection = setting.SortDirection;
 
                            grid.GroupDescriptors.Add(d);
                        }
                    }
 
                    if (Settings.FilterSettings.Count > 0)
                    {
                        foreach (FilterSetting setting in Settings.FilterSettings)
                        {
                            FilterSetting currentSetting = setting;
 
                            GridViewDataColumn matchingColumn =
                            (from column in grid.Columns.OfType<GridViewDataColumn>()
                             where column.DataMemberBinding.Path.Path == currentSetting.PropertyName
                             select column).FirstOrDefault();
 
                            if (matchingColumn != null)
                            {
                                ColumnFilterDescriptor cfd = new ColumnFilterDescriptor(matchingColumn);
 
                                if (setting.Filter1 != null)
                                {
                                    cfd.FieldFilter.Filter1.Member = setting.Filter1.Member;
                                    cfd.FieldFilter.Filter1.Operator = setting.Filter1.Operator;
                                    cfd.FieldFilter.Filter1.Value = setting.Filter1.Value;
                                }
 
                                if (setting.Filter2 != null)
                                {
                                    cfd.FieldFilter.Filter2.Member = setting.Filter2.Member;
                                    cfd.FieldFilter.Filter2.Operator = setting.Filter2.Operator;
                                    cfd.FieldFilter.Filter2.Value = setting.Filter2.Value;
                                }
 
                                foreach (FilterDescriptorSetting fds in setting.SelectedDistinctValues)
                                {
                                    Telerik.Windows.Data.FilterDescriptor fd = new Telerik.Windows.Data.FilterDescriptor();
                                    fd.Member = fds.Member;
                                    fd.Operator = fds.Operator;
                                    fd.Value = fds.Value;
                                    cfd.DistinctFilter.FilterDescriptors.Add(fd);
                                }
 
                                this.grid.FilterDescriptors.Add(cfd);
                            }
                        }
                    }
                }
            }
        }
 
        public virtual void ResetState()
        {
            Settings.Reset();
        }
 
        public virtual void SaveState()
        {
            Settings.Reset();
 
            if (grid != null)
            {
                if (grid.Columns != null)
                {
                    Settings.ColumnSettings.Clear();
 
                    foreach (Telerik.Windows.Controls.GridViewColumn column in grid.Columns)
                    {
                        if (column is GridViewDataColumn)
                        {
                            GridViewDataColumn dataColumn = (GridViewDataColumn)column;
 
                            ColumnSetting setting = new ColumnSetting();
                            setting.PropertyName = dataColumn.DataMemberBinding.Path.Path;
                            setting.UniqueName = dataColumn.UniqueName;
                            setting.Header = dataColumn.Header;
                            setting.Width = dataColumn.ActualWidth;
                            setting.DisplayIndex = dataColumn.DisplayIndex;
 
                            Settings.ColumnSettings.Add(setting);
                        }
                    }
                }
 
                if (grid.FilterDescriptors != null)
                {
                    Settings.FilterSettings.Clear();
 
                    foreach (IColumnFilterDescriptor cfd in grid.FilterDescriptors.OfType<IColumnFilterDescriptor>())
                    {
                        FilterSetting setting = new FilterSetting();
 
                        if (cfd.FieldFilter.Filter1.Value != Telerik.Windows.Data.FilterDescriptor.UnsetValue)
                        {
                            setting.Filter1 = new Telerik.Windows.Data.FilterDescriptor();
                            setting.Filter1.Member = cfd.FieldFilter.Filter1.Member;
                            setting.Filter1.Operator = cfd.FieldFilter.Filter1.Operator;
                            setting.Filter1.Value = cfd.FieldFilter.Filter1.Value;
                            setting.Filter1.MemberType = null;
                        }
 
                        if (cfd.FieldFilter.Filter2.Value != Telerik.Windows.Data.FilterDescriptor.UnsetValue)
                        {
                            setting.Filter2 = new Telerik.Windows.Data.FilterDescriptor();
                            setting.Filter2.Member = cfd.FieldFilter.Filter2.Member;
                            setting.Filter2.Operator = cfd.FieldFilter.Filter2.Operator;
                            setting.Filter2.Value = cfd.FieldFilter.Filter2.Value;
                            setting.Filter2.MemberType = null;
                        }
 
                        foreach (Telerik.Windows.Data.FilterDescriptor fd in cfd.DistinctFilter.FilterDescriptors.OfType<Telerik.Windows.Data.FilterDescriptor>())
                        {
                            if (fd.Value == Telerik.Windows.Data.FilterDescriptor.UnsetValue)
                            {
                                continue;
                            }
 
                            FilterDescriptorSetting fds = new FilterDescriptorSetting();
                            fds.Member = fd.Member;
                            fds.Operator = fd.Operator;
                            fds.Value = fd.Value;
                            setting.SelectedDistinctValues.Add(fds);
                        }
 
                        setting.PropertyName = cfd.Column.DataMemberBinding.Path.Path;
 
                        Settings.FilterSettings.Add(setting);
                    }
                }
 
                if (grid.SortDescriptors != null)
                {
                    Settings.SortSettings.Clear();
 
                    foreach (ColumnSortDescriptor d in grid.SortDescriptors.OfType<ColumnSortDescriptor>())
                    {
                        SortSetting setting = new SortSetting();
 
                        setting.PropertyName = ((GridViewDataColumn)d.Column).GetDataMemberName();
                        setting.SortDirection = d.SortDirection;
 
                        Settings.SortSettings.Add(setting);
                    }
                }
 
                if (grid.GroupDescriptors != null)
                {
                    Settings.GroupSettings.Clear();
 
                    foreach (ColumnGroupDescriptor d in grid.GroupDescriptors.OfType<ColumnGroupDescriptor>())
                    {
                        GroupSetting setting = new GroupSetting();
 
                        setting.PropertyName = ((GridViewDataColumn)d.Column).GetDataMemberName();
                        setting.SortDirection = d.SortDirection;
 
                        Settings.GroupSettings.Add(setting);
                    }
                }
 
                Settings.FrozenColumnCount = grid.FrozenColumnCount;
            }
 
            Settings.Save();
        }
 
        private void Attach()
        {
            if (this.grid != null)
            {
                this.grid.LayoutUpdated += new EventHandler(LayoutUpdated);
                this.grid.Loaded += Loaded;
                Application.Current.Exit += Current_Exit;
            }
        }
 
        void Current_Exit(object sender, EventArgs e)
        {
            SaveState();
        }
 
        void Loaded(object sender, EventArgs e)
        {
            LoadState();
        }
 
        void LayoutUpdated(object sender, EventArgs e)
        {
            if (grid.Parent == null)
            {
                SaveState();
            }
        }
 
        private RadGridViewApplicationSettings gridViewApplicationSettings = null;
 
        protected virtual RadGridViewApplicationSettings CreateRadGridViewApplicationSettingsInstance()
        {
            return new RadGridViewApplicationSettings(this);
        }
 
        protected RadGridViewApplicationSettings Settings
        {
            get
            {
                if (gridViewApplicationSettings == null)
                {
                    gridViewApplicationSettings = CreateRadGridViewApplicationSettingsInstance();
                }
                return gridViewApplicationSettings;
            }
        }
    }
 
    public class PropertySetting
    {
        string _PropertyName;
        public string PropertyName
        {
            get
            {
                return _PropertyName;
            }
            set
            {
                _PropertyName = value;
            }
        }
    }
 
    public class SortSetting : PropertySetting
    {
        ListSortDirection _SortDirection;
        public ListSortDirection SortDirection
        {
            get
            {
                return _SortDirection;
            }
            set
            {
                _SortDirection = value;
            }
        }
    }
 
    public class GroupSetting : PropertySetting
    {
        ListSortDirection? _SortDirection;
        public ListSortDirection? SortDirection
        {
            get
            {
                return _SortDirection;
            }
            set
            {
                _SortDirection = value;
            }
        }
    }
 
    public class FilterSetting : PropertySetting
    {
        List<FilterDescriptorSetting> _SelectedDistinctValues;
        public List<FilterDescriptorSetting> SelectedDistinctValues
        {
            get
            {
                if (_SelectedDistinctValues == null)
                {
                    _SelectedDistinctValues = new List<FilterDescriptorSetting>();
                }
                return _SelectedDistinctValues;
            }
        }
 
        Telerik.Windows.Data.FilterDescriptor _Filter1;
        public Telerik.Windows.Data.FilterDescriptor Filter1
        {
            get
            {
                return _Filter1;
            }
            set
            {
                _Filter1 = value;
            }
        }
 
        Telerik.Windows.Data.FilterDescriptor _Filter2;
        public Telerik.Windows.Data.FilterDescriptor Filter2
        {
            get
            {
                return _Filter2;
            }
            set
            {
                _Filter2 = value;
            }
        }
    }
 
    public class FilterDescriptorSetting
    {
        string _Member;
        public string Member
        {
            get
            {
                return _Member;
            }
            set
            {
                _Member = value;
            }
        }
 
        Telerik.Windows.Data.FilterOperator _Operator;
        public Telerik.Windows.Data.FilterOperator Operator
        {
            get
            {
                return _Operator;
            }
            set
            {
                _Operator = value;
            }
        }
 
        object _Value;
        public object Value
        {
            get
            {
                return _Value;
            }
            set
            {
                _Value = value;
            }
        }
 
        bool _IsCaseSensitive;
        public bool IsCaseSensitive
        {
            get
            {
                return _IsCaseSensitive;
            }
            set
            {
                _IsCaseSensitive = value;
            }
        }
    }
 
    public class ColumnSetting : PropertySetting
    {
        string _UniqueName;
        public string UniqueName
        {
            get
            {
                return _UniqueName;
            }
            set
            {
                _UniqueName = value;
            }
        }
 
        object _Header;
        public object Header
        {
            get
            {
                return _Header;
            }
            set
            {
                _Header = value;
            }
        }
 
        double? _Width;
        public double? Width
        {
            get
            {
                return _Width;
            }
            set
            {
                _Width = value;
            }
        }
 
        int? _DisplayIndex;
        public int? DisplayIndex
        {
            get
            {
                return _DisplayIndex;
            }
            set
            {
                _DisplayIndex = value;
            }
        }
    }
}
Apoorva
Top achievements
Rank 1
 asked on 26 Sep 2011
2 answers
203 views
Is there any way to display Rad TreeView with ItemsOptionListType as CheckList and that particular TreeView should be a Read only kind of...???


Simply my requirement is to display Read only TreeView with checkbox's (not with Disabled mode)



Balaji
Top achievements
Rank 1
 answered on 26 Sep 2011
1 answer
127 views
I would like to persist the state and position of my Tileview to Isolated Storage, but am not sure of the best approach for this?

Can you steer me in the right direction?

Many Thanks

Greg
Alex Fidanov
Telerik team
 answered on 26 Sep 2011
1 answer
189 views
Hi,

I have a WPF radgridview, on a particular event (say button click) I want to change the selection on the grid to a different row based on some parameters. The grid is bound to a datatableview. I am setting it as

grid.SelectedItem = ((

 

DataView)grid.ItemsSource).Table.Rows[count];

 

 

grid.CurrentItem = ((

 

DataView)grid.ItemsSource).Table.Rows[count];

 

 

grid.BringIndexIntoView(count);


where count is the index of the row I want to select. Can you please tell me how to do it.
Pavel Pavlov
Telerik team
 answered on 26 Sep 2011
1 answer
181 views
Good morning
As the title say, RadDragAndDropManager dont fire the DropQuery and DragQuery events.
in XAML:

                dragDrop:RadDragAndDropManager.DropQuery="rTreeListView_DropQuery"
                dragDrop:RadDragAndDropManager.DropInfo="rTreeListView_DropInfo"
                dragDrop:RadDragAndDropManager.DragQuery="rTreeListView_DragQuery"
                dragDrop:RadDragAndDropManager.DragInfo="rTreeListView_DragInfo" 
 
and, in code behind, there is the implementation of events.
Setting a breakpoint into the events, it's never hit.
Need the DropQuery event because, in my application, there are rules that allow or not 
the drop of an element under another element;
and (as i read from help) i would like to set the QueryResult to false, cancelling drop.
The second question is:
I would like to show an icon (like denial of access)  when the DragCueItem is on an item 
on which drop operation is not allowed.
 



Dimitrina
Telerik team
 answered on 26 Sep 2011
1 answer
157 views
Hi,

Assembly version :2011.2.823.40

I've got a weird issue on telerik radgridview:
i create and destroy columns on view code behind by the code :
myGrid.Columns.RemoveAt(i);
...
myGrid.Columns.Add(NewColumns);

when i rebind my grid, the new column is systematiquely at the place of the removed column but the header is wrong, the new header is at the end of the grid.

is someone had the issue before and know how to resolve that?

thanks by advance
Vera
Telerik team
 answered on 26 Sep 2011
3 answers
144 views
Is there any way to get or set the HighlightedElement with the RadComboBox?  The HighlightedElement seems to follow the SelectedItem when there is a SelectedItem, but the highlight does not go away when SelectedItem is null.

Thanks.
Valeri Hristov
Telerik team
 answered on 26 Sep 2011
4 answers
280 views
I'm wondering if anybody has done any work extending DataFilter to handle dealing with child collections in a complicated manner. For instance, I have an IParent interface, which has an IEnumerable<IChild> Children member. I'd like to be able to express visually:

from p in parents where p.Children.Any(i => i.Type == 1 && i.Foo = "Bar")

Basically, I want to select parents based on whether any children exists.

I have this notion that I could implement this entirely on my own... somehow. Perhaps a custom 3-part editor control for teh Children property, with a "any" operator... and a sub-RadDataFilter rendered in part-3.

That seems pretty kludgy though.
Rossen Hristov
Telerik team
 answered on 26 Sep 2011
1 answer
124 views
Hi Support
I was able to bind combo according to this thread http://www.telerik.com/help/silverlight/raddatafilter-how-to-create-custom-filter-editors.html
but i don't know how to bind it to special value and Description, is there any idea?
<DataTemplate x:Key="ComboKind">

<telerik:RadComboBox DisplayMemberPath="Dsc"

                     SelectedValue="{Binding Value, Mode=TwoWay, FallbackValue=null}"/>

 

</DataTemplate>


P.S. Item Source contain ID and Dsc

Thanks in advance 
Mehri
Rossen Hristov
Telerik team
 answered on 26 Sep 2011
2 answers
405 views
Hi,

I have an issue about the scroll on my gridview.
My gridview contains a lot of data so there is vertical scrollbars and I set the insert row to visible.
The problem is when I enter data on the insert row and I press enter the gridview don't scroll to the the added row.
Here is my gridview:
<telerik:RadGridView telerik:StyleManager.Theme="Office_Blue"  Width="auto" Height="200"  x:Name="rgvTest"
    ItemsSource="{Binding TrckTest, IsAsync=True}"
    DataLoadMode="Asynchronous"
    SelectionMode="Extended"
    AutoGenerateColumns="False"
    ScrollMode="Deferred"
    EnableRowVirtualization="True"
    SnapsToDevicePixels="True"
    UseLayoutRounding="True"
    ActionOnLostFocus="None"
    ShowInsertRow="{Binding IsReadOnly}"
    CanUserInsertRows="{Binding IsReadOnly}"
    CanUserDeleteRows="{Binding IsReadOnly}"
    Grid.Column="0" RowEditEnded="rgvTest_RowEditEnded">
 
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="RowEditEnded">
    <Commanding:EventToCommand Command="{Binding TestEditEndedCommand}" PassEventArgsToCommand="True"/>
    </i:EventTrigger>
 
    <i:EventTrigger EventName="AddingNewDataItem">
    <Commanding:EventToCommand Command="{Binding AddNewTestEvent}" PassEventArgsToCommand="True" />
    </i:EventTrigger>
 
    <i:EventTrigger EventName="SelectionChanged">
    <Commanding:EventToCommand Command="{Binding ItemTestSelectedCommand}" CommandParameter="{Binding ElementName=rgvTest, Mode=OneWay, Path=SelectedItem}"/>
    </i:EventTrigger>
    </i:Interaction.Triggers>
 
    <telerik:RadGridView.Columns>
    ...
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

I tried to use the event RowEditEnded in the code behind to scroll to the position of  the row like this but it didn't work:
private void rgvTest_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
{
        rgvTest.ScrollIntoView(e.Row);
}

Do you any solution about this issue?
Thanks
Hakim
Top achievements
Rank 1
 answered on 26 Sep 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?