This is a migrated thread and some comments may be shown as answers.
Width not applying on columns
5 Answers 129 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Steve A
Top achievements
Rank 1
Steve A asked on 14 Apr 2010, 02:18 PM
Let me preface . Yes I can see them working on the examples. The width method is having no effect.
If I enable Scrollable it does work. I do not want Scrollable though



<asp:Content ID=
"Content1" ContentPlaceHolderID="MainContent" runat="server">  
    <div class="display">  
        <%  
            Response.Write(Html.Hidden("SelectedPersonId"));    // value holder for other links in the master page.   
            Html.Telerik().Grid<PersonSearchListModel>()  
                            .Name("Telerik_SearchResults")  
                            .Columns(columns =>{  
                                        columns.Bound(c => c.PersonID).Title("ID");  
                                        columns.Bound(c => c.FirstName).Title("First");  
                                        columns.Bound(c => c.MiddleName).Title("Middle");  
                                        columns.Bound(c => c.LastName).Title("Last");  
                                       columns.Bound(c => c.Phone).Title("Phone").Width(300);  
                                        columns.Bound(c => c.Address).Title("Address");  
                                        columns.Bound(c => c.SSN);  
                                        columns.Bound(c => c.HICN);  
                                        columns.Bound(c => c.DOB).Title("Date of Birth").Format("{0:MM/dd/yyyy}");  
                                        columns.Bound(c => c.EnrollmentStatus);  
                                       columns.Bound(c => c.AuthorizedRep);  
                                        columns.Bound(c => c.AuthorizedRepPhone);  
                                     }).ClientEvents(events => events  
                                                                .OnLoad("Telerik_SearchResults_Load")  
                                                                .OnRowSelected("Telerik_SearchResults_RowSelected")  
                                    ).BindTo(Model.SearchResults)  
                            .Selectable()  
                           //.Scrollable(sc=>sc.Height(900))  
                             
                           //   .Pageable(settings => settings.PageSize(Model.ResultsPerPage))  
                            .DataKeys(keys => keys.Add(my => my.PersonID))  
                           //   .Sortable(settings => settings.Enabled(true).SortMode(GridSortMode.SingleColumn))  
                           .Render()  
                             
                            ;  
        %>  
    </div> 

5 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 28 Jun 2010, 02:11 PM
I have this same problem and same effect.  If I set scrollable then the width attribute suddenly takes effect.

However I also don't want to have scrollbars!

Can anyone help?

Thanks,

Ryan.
0
Emmanuel
Top achievements
Rank 1
answered on 01 Sep 2010, 09:16 PM
Anybody been able to fix this??

(I seem to see a lot of unanswered posts... Not very impressed with Telerik.)
0
Joshua
Top achievements
Rank 1
answered on 17 Oct 2010, 04:35 AM
I am having this same problem. Telerik, please help?
0
Atanas Korchev
Telerik team
answered on 18 Oct 2010, 08:10 AM
Hello,

 We would need an example showing when the column width did not apply. Here are a few tips when setting the width of the column:

  1. Leave one column without width set. Otherwise the total sum of the widths can increase the width of the grid.
  2. If using hidden columns - make them last otherwise they will mess up the width of other columns in Internet Explorer
  3. Scrollable grids have their table-layout CSS attribute set to fixed. This allows full control over the width of the column. In non-scrollable mode the HTML Table element is in control of the column width and the value set may not be the value shown by the browser.

Regards,
Atanas Korchev
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
Jann
Top achievements
Rank 1
answered on 21 Feb 2011, 10:58 AM
The problem with your first suggestion is that if you don't set the width of all columns, you don't get proper horizontal scrolling. However, if you set the column width on all columns you get misalignment between the columns and the header when you change the window size. This issue only occurs in IE7, IE8 and FF are fine.
Tags
Grid
Asked by
Steve A
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Emmanuel
Top achievements
Rank 1
Joshua
Top achievements
Rank 1
Atanas Korchev
Telerik team
Jann
Top achievements
Rank 1
Share this question
or