RadComboBox in RadGridView

7 posts, 1 answers
  1. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 27 Oct 2010 Link to this post

    Hi,

    I remember already asked this but don't remember the thread so here we go,
    I have a RadComboBox in one of my column.

    When I scroll the combobox, it is dynamically changeing the widh if the ComboBox and this gives a bit of sickness
    Is there a way to say to the RadCombobox that it must stay teh samw witdh means, the width if the longer line in the RadComboBox ?

    Thank you
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 01 Nov 2010 Link to this post

    Hello Marc Roussel,

    Probably the workaround was to set the Width of the RadComboBox via the EditorStyle of the combo column:

    <telerik:GridViewComboBoxColumn  ItemsSourceBinding="{Binding AvailableCountries}"  DataMemberBinding="{Binding CountryID}"
        Header="Country"
        DisplayMemberPath="Name"
        SelectedValueMemberPath="ID">
        <telerik:GridViewComboBoxColumn.EditorStyle>
            <Style TargetType="telerik:RadComboBox">
                <Setter Property="Width" Value="200" />
            </Style>
        </telerik:GridViewComboBoxColumn.EditorStyle>
    </telerik:GridViewComboBoxColumn>


    Regards,
    Veselin Vasilev
    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
  3. DevCraft banner
  4. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 01 Nov 2010 Link to this post

    However my RadComBoBox is added by C# code behind at runtime.
    Do you have the equilavent in C# ?
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 04 Nov 2010 Link to this post

    Hello Marc Roussel,

    The code will look something like this:

    void clubsGrid_DataLoaded(object sender, EventArgs e)
    {
        var comboColumn = this.clubsGrid.Columns["CountryID"] as GridViewComboBoxColumn;
     
        var style = new Style()
        {
            TargetType = typeof(RadComboBox)
        };
        style.Setters.Add(new Setter()
        {
            Property = RadComboBox.WidthProperty, Value = 200
        });
        comboColumn.EditorStyle = style;
    }


    Greetings,
    Veselin Vasilev
    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
  6. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 05 Nov 2010 Link to this post

    Hi,

    Thank you for the hint.
    However, this is causing some trouble as having a fixed width makes some value in the combobox not entirely visible and making my combobox larger isn't an option.  What it must do in fact is having it autowidth as it does actually making the ComboBox the widh of the longer value in the list but stay that width when scrolling because there's no point of having the width of the ComboBox readapting according to what we can SEE.

    So do you have any property to set the comboBox to audowidth but not AUTOWIDTH during the scrolling ?
  7. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 10 Nov 2010 Link to this post

    Hi Marc Roussel,

    I agree that this is not expected as the RadComboBox does not behaves the same when put outside the gridview.

    I have logged the problem in our public issue tracking system and you can track its progress here.

    I have updated your Telerik Points

    Sincerely yours, Veselin Vasilev
    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
  8. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 10 Nov 2010 Link to this post

    Man, your Public issue tracking system is incredibly well done.
    I like it very much

    Ok thank you for the information

Back to Top
DevCraft banner