radlistbox multi column

2 posts, 1 answers
  1. jayanthi
    jayanthi avatar
    111 posts
    Member since:
    Jul 2010

    Posted 10 Sep 2012 Link to this post

    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
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Sep 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top