How to get tab index of Telerik TabView?

Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

Hi everybody, wish you get healthy!
I'm working with Telerik TabView
I don't see event SelectionChanged, I saw a guide here telerik forum
Now I need get the current tab index.
I have try to custom like this
`public class CrossRadTabView : RadTabView, IDisposable
{
public event EventHandler OnSelectionChanged;
public CrossRadTabView()
{
this.PropertyChanged += CrossRadTabViewSelectionChanged;
}

    private void CrossRadTabViewSelectionChanged(object sender, PropertyChangedEventArgs e)
    {
        if (e.PropertyName == "SelectedItem")
        {
            Debug.WriteLine("TabView Property: " + e.PropertyName);
            OnSelectionChanged?.Invoke(this, new SelectionChangedEventArgs(e.Index, e.Name));
        }
    }        

    public void Dispose()
    {
        this.PropertyChanged -= CrossRadTabViewSelectionChanged;
    }
}

public class SelectionChangedEventArgs : EventArgs
{
    public SelectionChangedEventArgs(int index, string name)
    {
        this.Index = index;
        this.Name = name;
    }

    /// <summary>Gets the value of selected index.</summary>
    public int Index { get; internal set; }

    /// <summary>Gets or sets the name.</summary>
    /// <value>The name.</value>
    public string Name { get; internal set; }
}`

But PropertyChangedEventArgs don't have Index and Name
If you have a best way to get current Tab index, please suggest me!
Thank you!

Sign In or Register to comment.