In RadListBox, Multi-Label

0 Answers 58 Views
Grid
anna
Top achievements
Rank 1
Bronze
Iron
anna asked on 30 Jan 2022, 10:04 AM | edited on 30 Jan 2022, 11:37 AM

Attached File : RadListBox.png

ASP.NET, RadListBox, Web

Question-1) ItemTemplate of RadListBox, By applying multi-label, Is it possible to implement multi-column of ListBox?

Question-2) If Question-1 is possible, As in the attached file, After creating one more RadListBox, Is it possible to move data between listboxes?

Question-3) If Question-2 is possible, like the source below,Listbox.Item.Add(item),  Listbox.Item.Insert(index),  Listbox.SelectedItemindex, Listbox.Selected.Items.Count   

Can you code using functions?

private void AddRemoveAll(ListBox aSource, ListBox aTarget)
 {
  try
  {
   foreach(ListItem item in aSource.Items)
   aTarget.Items.Add(item);
   aSource.Items.Clear();
  }
  catch(Exception expException)
  {
    Response.Write(expException.Message);
  }
 }
private void private void MoveUp(ListBox lstBox)
 { 
  int   iIndex, iCount, iOffset, iInsertAt,iIndexSelectedMarker = -1;
  string lItemData,lItemval;

  try
   {
  // Get the count of items in the list control
  iCount = lstBox.Items.Count;
       
  // Set the base loop index and the increment/decrement value based
  // on the direction the item are being moved (up or down).
  iIndex = 0;
  iOffset = -1;
  // Loop through all of the items in the list.
  while(iIndex < iCount) 
   {
    // Check if this item is selected.
    if(lstBox.SelectedIndex > 0)
    {
    // Get the item data for this item
     lItemval =lstBox.SelectedItem.Value.ToString();
    lItemData = lstBox.SelectedItem.Text.ToString() ;
    iIndexSelectedMarker=lstBox.SelectedIndex; 
      
    // Don't move selected items past other selected items
       if(-1 != iIndexSelectedMarker)
       {
         for(int iIndex2 = 0; iIndex2 < iCount; ++iIndex2)
      {
        // Find the index of this item in enabled list
            if(lItemval == lstBox.Items[iIndex2].Value.ToString())
         {
           
          // Remove the item from its current position
             lstBox.Items.RemoveAt(iIndex2);  
             
      // Reinsert the item in the array one space higher 
             // than its previous position
             iInsertAt=(iIndex2 + iOffset)<0?0:iIndex2+iOffset;
             ListItem li= new ListItem(lItemData,lItemval);
          lstBox.Items.Insert(iInsertAt,li);
          break;
         }
        }
        }
     }
            
     // If this item wasn't selected save the index so we can check
        // it later so we don't move past the any selected items.
        else if(-1 == iIndexSelectedMarker)
        {
         iIndexSelectedMarker = iIndex;  
       break;
     }
      iIndex = iIndex + 1;
    }
    if(iIndexSelectedMarker==0)
      lstBox.SelectedIndex=iIndexSelectedMarker;
    else
      lstBox.SelectedIndex=iIndexSelectedMarker-1;
   }
   catch(Exception expException)
   {
    Response.Write(expException.Message); 
   } 
 } 

 

An example source for reference please.

Your answer is desperately needed.

I will keep waiting for your reply.

No answers yet. Maybe you can help?

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