Hi,
I'm having a problem where the text of the <EmptyMessageTemplate> is not centred correctly. My ListBox is inside a Window, which is not visible on the Initial load.
Markup
CodeBehind
How to reproduce: Click "Show window" and you see that the 'no items selected' text is in the upperleft corner of the second ListBox. Move an item from the left to the right ListBox, and move it back to the left again. The 'no items selected' text show again, but now it's nicely centered in the ListBox.
Any idea how to solve this?
Thanks,
Danny
I'm having a problem where the text of the <EmptyMessageTemplate> is not centred correctly. My ListBox is inside a Window, which is not visible on the Initial load.
Markup
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestListBox.WebForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"scrpMngr"
runat
=
"server"
AsyncPostBackTimeout
=
"600"
>
</
telerik:RadScriptManager
>
<
div
>
<
telerik:RadWindow
runat
=
"server"
ID
=
"rdwWin"
Height
=
"320"
Width
=
"515"
Behaviors
=
"Close"
Overlay
=
"true"
Modal
=
"true"
VisibleStatusbar
=
"false"
VisibleOnPageLoad
=
"false"
Visible
=
"false"
>
<
ContentTemplate
>
<
telerik:RadListBox
runat
=
"server"
ID
=
"lbSource"
Height
=
"200px"
Width
=
"260px"
AllowTransfer
=
"true"
TransferToID
=
"lbSelected"
AllowTransferDuplicates
=
"false"
AllowTransferOnDoubleClick
=
"true"
TransferMode
=
"Move"
EnableDragAndDrop
=
"true"
ButtonSettings-Position
=
"Right"
TabIndex
=
"1"
AccessKey
=
"y"
>
<
EmptyMessageTemplate
>No items found</
EmptyMessageTemplate
>
</
telerik:RadListBox
>
<
telerik:RadListBox
runat
=
"server"
ID
=
"lbSelected"
Height
=
"200px"
Width
=
"230px"
AllowTransferOnDoubleClick
=
"true"
EnableDragAndDrop
=
"true"
>
<
EmptyMessageTemplate
>No items selected</
EmptyMessageTemplate
>
</
telerik:RadListBox
>
</
ContentTemplate
>
</
telerik:RadWindow
>
<
asp:Button
Text
=
"Show window"
runat
=
"server"
OnClick
=
"btnShow_Click"
/>
</
div
>
</
form
>
</
body
>
</
html
>
CodeBehind
namespace
TestListBox {
public
partial
class
WebForm1 : System.Web.UI.Page {
protected
void
Page_Load(
object
sender, EventArgs e) {
if
(!Page.IsPostBack) {
lbSource.Items.Add(
new
Telerik.Web.UI.RadListBoxItem() { Value =
"1"
, Text =
"some item"
});
lbSource.Items.Add(
new
Telerik.Web.UI.RadListBoxItem() { Value =
"2"
, Text =
"another item"
});
}
}
protected
void
btnShow_Click(
object
sender, EventArgs e) {
rdwWin.Visible =
true
;
rdwWin.VisibleOnPageLoad =
true
;
}
}
}
How to reproduce: Click "Show window" and you see that the 'no items selected' text is in the upperleft corner of the second ListBox. Move an item from the left to the right ListBox, and move it back to the left again. The 'no items selected' text show again, but now it's nicely centered in the ListBox.
Any idea how to solve this?
Thanks,
Danny