将列表框中间中心的空消息对齐

时间:2014-12-15 04:51:14

标签: c# asp.net vb.net telerik telerik-radlistbox

我使用两个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>

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

enter image description here

注意:

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

2 个答案:

答案 0 :(得分:0)

根据您的要求使用此CSS。此外,您需要将此CSS放在RadWindow的ContentTemplate中,因为RadListBox是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>

答案 1 :(得分:0)

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