Not Selectable ListViewElement

3 posts, 1 answers
  1. M
    M avatar
    4 posts
    Member since:
    Feb 2017

    Posted 04 Feb Link to this post

    Hi

    I want a Not selectable ListViewElement

    by not selectable , I mean you can not select it's items

    I have it as custom item in a parent listview

  2. M
    M avatar
    4 posts
    Member since:
    Feb 2017

    Posted 04 Feb Link to this post

    I manged to do this by following code and overriding VisualItemFormatting(

    void radListView1_VisualItemFormatting(object sender, Telerik.WinControls.UI.ListViewVisualItemEventArgs e)
    {
        e.VisualItem.DrawFill = false;
        e.VisualItem.DrawBorder = false;
    }

  3. Answer
    Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 06 Feb Link to this post

    Hi M,

    Another approach is to use the SelectedItemChanging event:
    public RadForm1()
    {
        InitializeComponent();
        radListView1.SelectedItem = null;
        radListView1.SelectedItemChanging += RadListView1_SelectedItemChanging;
    }
     
    private void RadListView1_SelectedItemChanging(object sender, Telerik.WinControls.UI.ListViewItemCancelEventArgs e)
    {
        e.Cancel = true;
    }
    I hope this information is useful.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top