2

我正在使用两个 Telerik RadListBoxes,如下所示:

<td align="center">
    <telerik:RadListBox ID="lstDataList" runat="server" Width="266px"
        SelectionMode="Multiple" EmptyMessage="No data to display"
        TransferToID="lstcommited" Height="320" Skin="WebBlue" AllowTransfer="true"
        Style="text-align: left;">
        <ButtonSettings ShowTransferAll="false" VerticalAlign="Middle"
            HorizontalAlign="Center" TransferButtons="TransferFrom" />
    </telerik:RadListBox>
</td>
<td align="center">
    <telerik:RadListBox ID="lstcommited" runat="server" Width="240px"
        EmptyMessage="No data to display" SelectionMode="Multiple"
        TransferToID="lstDataList" Height="320" Skin="WebBlue"
        Style="text-align: left;">
    </telerik:RadListBox>
</td>

我的问题是如何在列表框的中间显示空消息,如下图所示。

在此处输入图像描述

笔记:

两个列表框都在<telerik:RadWindow>

4

2 回答 2

0

删除Style="text-align: left;"两个<telerik:RadListBox>控件中的属性并离开<td align="center">

于 2014-12-15T05:47:19.173 回答
0

使用此 CSS 满足您的要求。此外,您需要将此 CSS 放在 RadWindow 的 ContentTemplate 中,因为您的 RadListBoxes 是 RadWindow 的一部分。检查下面的标记:

<telerik:radwindow id="radList" runat="server" modal="true" animation="None"
    visibleonpageload="false" skin="Windows7" width="630px" keepinscreenbounds="true"
    height="500px" enableshadow="false" visiblestatusbar="false" visibletitlebar="true"
    behaviors="Close,Pin" title=" ASSIGN EMPLOYEE" enableviewstate="true"> 
<ContentTemplate>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>RadControls</title>
    <style type="text/css">
        div.RadListBox .rlbEmptyMessage {
            vertical-align: middle !important;
            text-align: center;
            position: static !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <table width="100%" align="center" cellpadding="4" cellspacing="0">
            <tr>
                <td align="center">
                    <telerik:radlistbox id="lstDataList" runat="server" width="266px" selectionmode="Multiple"
                        emptymessage="No data to display" transfertoid="lstcommited" height="320"
                        skin="WebBlue" allowtransfer="true" style="text-align: left;"> 
<ButtonSettings ShowTransferAll="false" VerticalAlign="Middle" HorizontalAlign="Center" 
TransferButtons="TransferFrom" /> 
</telerik:radlistbox>
                </td>
                <td align="center">
                    <telerik:radlistbox id="lstcommited" runat="server" width="240px" emptymessage="No data to display"
                        selectionmode="Multiple" transfertoid="lstDataList" height="320" skin="WebBlue"
                        style="text-align: left;"> 
</telerik:radlistbox>
                </td>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td align="center" colspan="2">
                    <br />
                    <asp:LinkButton ID="btnconfirm" runat="server" Text="Confirm" CssClass="btn_signin"
                        CausesValidation="false"></asp:LinkButton>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
 </ContentTemplate> 
</telerik:radwindow>
于 2014-12-15T04:54:30.920 回答