(I'm having to fix somebody else's code here...)
anyone know how to get the correct .displayindex value on postback for a reorderlist (obviously after someone has reordered the list)?
i.e.
Dim didx As Integer = -1
Dim lblScaleItem As Label
For i As Integer = 0 To rlScaleItems.Items.Count - 1
If Not rlScaleItems.Items(i).IsAddItem Then ' real UI/DB list item
didx = rlScaleItems.Items(i).DisplayIndex
lblScaleItem = DirectCast(rlScaleItems.Items(i).FindControl("lblScaleItem"), Label)
End If
Next
My rlScaleItems.Items(i).DisplayIndex values are always from the page_load and NOT updated after reordering.
We use this control all the time w/o issue (but BOUND), and never trying to persist all of this junk (based on the end-user saying SAVE or CANCEL for all of the edits/reorders).
Thanks
Rob K
Comments: even attempting to update the list on reorder, does nothing Protected Sub rlScaleItems_ItemReorder(ByVal sender As System.Object, ByVal e As AjaxControlToolkit.ReorderListItemReorderEventArgs) 'reorder item Me.Scale.MoveItem(e.OldIndex, e.NewIndex) ScaleItemChanged = True ' RAK 4/18/2012 For i As Integer = 0 To rlScaleItems.Items.Count - 1 ' RAK 4/18/2012 If Not rlScaleItems.Items(i).IsAddItem Then ' real UI/DB list item Me.rlScaleItems.UpdateItem(i) End If Next End Sub
anyone know how to get the correct .displayindex value on postback for a reorderlist (obviously after someone has reordered the list)?
i.e.
Dim didx As Integer = -1
Dim lblScaleItem As Label
For i As Integer = 0 To rlScaleItems.Items.Count - 1
If Not rlScaleItems.Items(i).IsAddItem Then ' real UI/DB list item
didx = rlScaleItems.Items(i).DisplayIndex
lblScaleItem = DirectCast(rlScaleItems.Items(i).FindControl("lblScaleItem"), Label)
End If
Next
My rlScaleItems.Items(i).DisplayIndex values are always from the page_load and NOT updated after reordering.
We use this control all the time w/o issue (but BOUND), and never trying to persist all of this junk (based on the end-user saying SAVE or CANCEL for all of the edits/reorders).
Thanks
Rob K
Comments: even attempting to update the list on reorder, does nothing Protected Sub rlScaleItems_ItemReorder(ByVal sender As System.Object, ByVal e As AjaxControlToolkit.ReorderListItemReorderEventArgs) 'reorder item Me.Scale.MoveItem(e.OldIndex, e.NewIndex) ScaleItemChanged = True ' RAK 4/18/2012 For i As Integer = 0 To rlScaleItems.Items.Count - 1 ' RAK 4/18/2012 If Not rlScaleItems.Items(i).IsAddItem Then ' real UI/DB list item Me.rlScaleItems.UpdateItem(i) End If Next End Sub