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

ComboBox Text Alignment

3 Answers 328 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
PTS Group AG
Top achievements
Rank 2
PTS Group AG asked on 08 Jun 2010, 09:30 AM
Hi all,
I have the problem that the text inside the combobox after selection is right align ?!
(see screenshot)
I find similiar posts here but not really a solution.
Is it possible to set the alignment programmatically ?

ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ComboBox.aspx.cs" Inherits="ComboBox" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <rad:RadScriptManager ID="uxRadScriptManager" runat="server"></rad:RadScriptManager>  
    <rad:RadComboBox ID="RcbFarAway" runat="server" ></rad:RadComboBox>     
    </form> 
</body> 
</html> 
CS
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
public partial class ComboBox : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        RcbFarAway.Items.Clear(); 
        RcbFarAway.ID = "RcbFarAway"
        RcbFarAway.Width = Unit.Pixel(100); 
        RcbFarAway.DropDownWidth = 220; 
        RcbFarAway.AutoPostBack = false
        RcbFarAway.MarkFirstMatch = true
 
        for (int i = 0; i < 5; i++) { 
            RcbFarAway.Items.Add(new Telerik.Web.UI.RadComboBoxItem(i.ToString() + " Far far far far far away ...", i.ToString())); 
        } 
    } 



3 Answers, 1 is accepted

Sort by
0
PTS Group AG
Top achievements
Rank 2
answered on 10 Jun 2010, 08:11 AM
No one an idea ? Telerik ?
0
T. Tsonev
Telerik team
answered on 10 Jun 2010, 10:12 AM
Hello Stefan,

I'm afraid that this behavior is browser dependant. IE will move the selection to the right while Firefox will keep the left part visible. We don't have any suggestions how to improve this apart from making the RadComboBox wider.

I hope this helps.

Regards,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Michael Fellmeth
Top achievements
Rank 1
answered on 14 Nov 2010, 10:40 PM
Here's a fix. You can use Javascript as follows:

//IE ComboBox fix. Bug in IE prevents selecting proper range.
function onDropDownClosed(sender, eventArgs) {
    sender.selectText(0, -sender.get_text().length); 
}

On your RadComboBox control, call the function:

OnClientDropDownClosed="onDropDownClosed"

Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
PTS Group AG
Top achievements
Rank 2
Answers by
PTS Group AG
Top achievements
Rank 2
T. Tsonev
Telerik team
Michael Fellmeth
Top achievements
Rank 1
Share this question
or