Hi
I am updating an old project to use some of the Telerik controls - I am new to your controls. A standard ASP.NET Listbox was previously used in a modal popup to re-order items in a list - once the user was happy with the new order of items they click a 'Save Order' button to save the new order of items and close the popup. The function that works fine and does this is:
I have tried applying the same function to the RadListBox (ID =ListBox1) . I have made the following change on one of the lines:
" For Each item As RadListBoxItem In ListBox1.Items"
However there is an error on the following line:
intIndex = ListBox1.Items.IndexOf(item)
I can not get the index of the Radlistbox item. The error is:
'Telerik.Web.UI.ControlItemCollection.Protected Friend Overridable Function IndexOf(item As Telerik.Web.UI.ControlItem) As Integer' is not accessible in this context because it is 'Protected Friend'.
Any help in getting the index of the Radlistbox item would be appreciated. The 'save order' must be done with an 'external' button as the user must be happy with the display order etc. before they save it - in other words I can not use Autopostback etc.
Thanks in advance.
Kevin
I am updating an old project to use some of the Telerik controls - I am new to your controls. A standard ASP.NET Listbox was previously used in a modal popup to re-order items in a list - once the user was happy with the new order of items they click a 'Save Order' button to save the new order of items and close the popup. The function that works fine and does this is:
Protected Sub SaveOrder(ByVal sender As Object, ByVal e As EventArgs)
Dim intID As Integer
Dim intIndex As Integer
Dim strUpdate As String
Dim cmdUpdate As SqlCommand
connTC.Open()
For Each item As RadListBoxItem In ListBox1.Items
'get the ID of the item
intID = item.Value
'get the index number in the listbox
intIndex = ListBox1.Items.IndexOf(item)
'increase by 1 since listbox index starts at 0
intIndex = intIndex + 1
strUpdate = "Update tblGalleryImages SET fldOrder=@fldOrder WHERE fldGalleryImageID=@fldGalleryImageID"
cmdUpdate = New SqlCommand(strUpdate, connTC)
cmdUpdate.Parameters.AddWithValue("@fldOrder", intIndex)
cmdUpdate.Parameters.AddWithValue("@fldGalleryImageID", intID)
cmdUpdate.ExecuteNonQuery()
Next
connTC.Close()
'hide the modal popup
ModalTextPopup.Hide()
End Sub
I have tried applying the same function to the RadListBox (ID =ListBox1) . I have made the following change on one of the lines:
" For Each item As RadListBoxItem In ListBox1.Items"
However there is an error on the following line:
intIndex = ListBox1.Items.IndexOf(item)
I can not get the index of the Radlistbox item. The error is:
'Telerik.Web.UI.ControlItemCollection.Protected Friend Overridable Function IndexOf(item As Telerik.Web.UI.ControlItem) As Integer' is not accessible in this context because it is 'Protected Friend'.
Any help in getting the index of the Radlistbox item would be appreciated. The 'save order' must be done with an 'external' button as the user must be happy with the display order etc. before they save it - in other words I can not use Autopostback etc.
Thanks in advance.
Kevin