Radlistview particular colomn editable

1 Answer 234 Views
ListView
Naresh
Top achievements
Rank 1
Iron
Naresh asked on 13 Apr 2022, 04:27 PM

Hi ,

once I made change allowedit = false; noneditable

this scenario ,I need to edit paritcular column edit in Radlistview.

thanks,

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Apr 2022, 06:44 AM

Hello, Nani,

RadListView allows items' editing if the AllowEditing property is set to true. However, setting this property to false, is expected to disable the edit functionality for the entire control. 

If I understand your requirement correctly, you need to allow editing only for certain cells. The possible solution that I can suggest is to keep the AllowEditing property to true and handle the ItemEditing event. This event is cancelable and you can prevent the edit operation from continuing by setting the Cancel property from the arguments to true:

        private void RadForm1_Load(object sender, EventArgs e)
        {
            this.customersTableAdapter.Fill(this.nwindDataSet.Customers);

            this.radListView1.DataSource = this.customersBindingSource;
            this.radListView1.ViewType = ListViewType.DetailsView;
            this.radListView1.AllowEdit = true;
            this.radListView1.ItemEditing+=radListView1_ItemEditing;
        }

        private void radListView1_ItemEditing(object sender, ListViewItemEditingEventArgs e)
        {
            if (e.ListViewElement.CurrentColumn.Name!="ContactName")
            {
                e.Cancel = true;
            }
        }
I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ListView
Asked by
Naresh
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or