RadListBox, I want to Insert just below the Selected Index in RadListBox1

0 Answers 21 Views
Grid
anna
Top achievements
Rank 1
Bronze
Iron
anna asked on 16 Feb 2022, 04:12 AM | edited on 17 Feb 2022, 09:05 AM

Hello
Attacted File : RadListBox.png, 544016CancelTransferEventAndAddManullyItems.aspx, 544016CancelTransferEventAndAddManullyItems.aspx.cs

Please Check the Attacted File(RadListBox)

Please answer Questions-1 & Questions-2

 

Question - 1 ) If you use AllowTransfer="true"
Is it possible to use InsertAt(It means inserting at the index position of the RadListBox I want) function while using AllowTransfer="true" function?

Can I use [ InsertAt ] function while using  AllowTransfer="true" for RadListBox ?

RadListBox, I want to Insert just below the Selected Index in RadListBox1.



***The goal is to migrate the source code below to RadListBox and AllowTransfer="true"

if (RadListBox2.SelectedIndex >= 0)
{
   for (int i = 0; i < RadListBox2.Items.Count; i++)
   {
       if (RadListBox2.Items[i].Selected)
      {
         arraylist.Add(RadListBox2.Items[i]);
      }
  }

int nSelectIndex = RadListBox1.SelectedIndex + 1;

 for (int j = 0; j < arraylist.Count; j++)
{
     RadListBox1.Items.Insert(nSelectIndex, ((ListItem)arraylist[j]));
     nSelectIndex++;

     RadListBox2.Items.Remove(((ListItem)arraylist[j]));
}
}

 

 

Question - 2 ) If you don't use AllowTransfer="true"
Using a generic RadListBox, Is it possible to migrate the code below to RadListBox?

Does RadListBox have an  <<< InsertAt >>>> function?

if (RadListBox2.SelectedIndex >= 0)
{
   for (int i = 0; i < RadListBox2.Items.Count; i++)
   {
       if (RadListBox2.Items[i].Selected)
      {
         arraylist.Add(RadListBox2.Items[i]);
      }
  }

int nSelectIndex = RadListBox1.SelectedIndex + 1;

 for (int j = 0; j < arraylist.Count; j++)
{
     RadListBox1.Items.Insert(nSelectIndex, ((ListItem)arraylist[j]));
     nSelectIndex++;

     RadListBox2.Items.Remove(((ListItem)arraylist[j]));
}
}

Please Help me. waiting for response.


No answers yet. Maybe you can help?

Tags
Grid
Asked by
anna
Top achievements
Rank 1
Bronze
Iron
Share this question
or