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

radlistbox multi column

1 Answer 256 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
jayanthi
Top achievements
Rank 1
jayanthi asked on 11 Sep 2012, 04:01 AM
Hello,

Its very urgent.

I have 2 radlistbox in radpageview.
Definition is as below:

<telerik:RadPageView ID="rpvAssignProcess" runat="server">
 <table cellpadding="0" cellspacing="0">
 <tr>
 <td>Available Process</td>
 <td>Assign Process</td>
 </tr>
<tr>
<td>
    <telerik:RadListBox ID="rlboxAvailableProcess" runat="server" AllowTransfer="True" 
        DataSourceID="SqlDataSource_Process" DataTextField="ProcessName"   Skin="WebBlue" 
        TransferToID="rlboxAssignProcess" Height="200px" Width="300px" DataValueField="ProcessName"  
        >
        <ButtonSettings TransferButtons="All" />
        <ItemTemplate>
                <div>
                    <span style="float:left;padding:10px">
                        <%# DataBinder.Eval(Container.DataItem, "CustomerID")%>
                   <br />
                        <%# DataBinder.Eval(Container.DataItem, "ProcessName")%>
                    </span>
                </div>
            </ItemTemplate>
            
  
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </telerik:RadListBox>
      
    </td>
<td>
 <telerik:RadListBox ID="rlboxAssignProcess" runat="server" AllowDelete="false" AllowReorder="true" 
         Skin="WebBlue" Height="200px" Width="300px" DataSourceID="SqlDataSource_Process1"
         DataTextField="ProcessName" DataValueField="ProcessName">
        <ButtonSettings Position="Right" VerticalAlign="Top" />
            
</telerik:RadListBox>
  
  
 </td>
</tr>
  </table>
    
</telerik:RadPageView>

Code behind code:

Protected Sub RadTabStrip1_TabClick(sender As Object, e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabClick
  
        If RadTabStrip1.SelectedIndex = 4 Then
            Try
                Dim CustomerID As String = ""
                For Each item As GridDataItem In rgView1.MasterTableView.Items
                    If item.Selected = True Then
                        If CustomerID = "" Then
                            CustomerID = item.Item("CustomerID").Text
                        Else
                            CustomerID += "','" + item.Item("CustomerID").Text
                        End If
                    End If
                Next
                SqlDataSource_Process.SelectCommand = "SELECT CustomerID,ProcessName FROM tbl_Process where CustomerID IN ('" & CustomerID & "')"
                rlboxAvailableProcess.DataBind()
            Catch ex As Exception
  
            End Try
        End If
  
    End Sub

It shows multicolumn in first radListbox with values CustomerId, ProcessName. Also i can transfer it to second radlistbox. I tried to transfer data from second to first radlistbox. Data is transfering but it is not visible, transfered row in first listbox is not visible properly. Why it happens? Guide me

Jayanthi

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 11 Sep 2012, 06:20 AM
Hi Jayanthi,

When you transfer templated items with binding expressions, in order to have these expressions evaluated after the items are transferred, you should subscribe to the Transferred server-side event and call databind method for each of the transferred items.

C#:
void rlboxAvailableProcess_Transferred(object sender, RadListBoxTransferredEventArgs e)
    {
        foreach (RadListBoxItem item in e.Items)
        {
            item.DataBind();
        }
    }

Please take a look into this demo and forum thread for more information.

Hope this helps.

Regards,
Princy.
Tags
ListBox
Asked by
jayanthi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or