This is a migrated thread and some comments may be shown as answers.

RadListControl Move item

5 Answers 197 Views
ListControl
This is a migrated thread and some comments may be shown as answers.
Carol Watson
Top achievements
Rank 1
Carol Watson asked on 13 Jul 2011, 11:08 PM
At design time I can Add items to the Items Collection and change the order they are displayed.

Is it possible to do this at run time, if so how.  

It is possible to do this with a list that is bound to datasource?

Thanks

5 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 15 Jul 2011, 03:21 PM
Hello Carol,

When using the control in data bound mode you should not manipulate the items directly (e.g. you should not call the Insert, Add or Clear methods of the Items collection).

I would suggest that you prepare the items in the DataLayer (for example, sort them).

Do not hesitate to contact us if you have other questions.

Greetings,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
AJing
Top achievements
Rank 1
answered on 22 Nov 2011, 01:53 AM
Hi,

   If we through operate the data source(for example, remove and insert,),so that we can change the order they are  displayed (Up and down).However,  The selected Item is always the first Item in RadListControl visible region because of the vertical scroll bar ---what is not expected.

   How to do?
   Thanks!
0
Peter
Telerik team
answered on 22 Nov 2011, 11:45 AM
Hello Ajing,

Thank you for contacting us.

As far as I understand, you want to remove the selected item in order to modify the DataSource.
To achieve this you can set SelectedIndex to -1 before modifying the data source - this will clear the selected item.

I hope this helps.

All the best,
Peter
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Arun
Top achievements
Rank 1
answered on 07 Sep 2016, 12:57 PM

Hi,

How to remove a particular item from RadDropDownList?

for eg., I can Add like, rddl_Items.Add("Car")

IN Vb.Net, I can remove like, rddl_Items.remove("Car")

Please help.

Thanks in advance

0
Hristo
Telerik team
answered on 08 Sep 2016, 02:56 PM
Hi Arun,

Thank you for writing.

You can directly access the Items collection and use either the Remove or RemoveAt methods. The first method received a RadListDataItem as a parameter and the second receives an index.

I hope this information was useful. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
ListControl
Asked by
Carol Watson
Top achievements
Rank 1
Answers by
Peter
Telerik team
AJing
Top achievements
Rank 1
Arun
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or