Grid Column Width not displaying at set width

2 posts, 0 answers
  1. Chris Holmes
    Chris Holmes avatar
    4 posts
    Member since:
    Aug 2009

    Posted 31 Oct 2014 Link to this post

    I have a grid(see below) with specified widths for the columns.  Once the page starts to render the widths are correct; as soon as the grid is databound it auto generates widths for the columns.  The issue is that these new widths are nothing like what I have specified.  Any ideas?

     <%= Html.Telerik().Grid<WebUI.Models.UserMaintenance>()    
        .Name("CheckedUsers")
        .DataKeys(keys => 
        { 
            keys.Add(u => u.Id); 
        })      
        .Columns(columns =>        
        {
            //columns.Bound(u => u.Id).Hidden(true);
            //columns.Bound(u => u.Name).Width(350);
            columns.Bound(item => item.UserId).Title("User Id").Width(5);
            columns.Bound(item => item.FirstName).Title("First Name").Width(15);
            columns.Bound(item => item.LastName).Title("Last Name").Width(15);
            columns.Bound(item => item.OrgName).Title("Org Name").Width(25);
            columns.Bound(item => item.Email).Title("Email Address").Width(20);
            columns.Bound(item => item.Language).Title("Language").ReadOnly().Width(10);
            columns.Bound(item => item.ApplicationAssigned).Title("Applications").ReadOnly().Width(15);
            columns.Bound(item => item.ComplianceAssigned).Title("Compliance").ReadOnly().Width(51);
            columns.Bound(item => item.UserType).Title("User Type").ReadOnly().Width(15);
            columns.Bound(item => item.LastActivityDate).Title("Last Sign In").ReadOnly().Width(15);
            columns.Bound(item => item.LockedOut).Title("Locked Out").ReadOnly().Width(5);
            columns.Command(commands =>
                {
                    commands.Custom("unlock").Text("Unlock").Ajax(true);
                }
                ).Title("Unlock User").Width(5);
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.Image);
                commands.Delete().ButtonType(GridButtonType.Image);
            }).Width(5);
           
        })
        .Editable(editing => editing.Mode(GridEditMode.InLine))
        .Filterable()
        .Sortable()
               //.ClientEvents(clientEvents => clientEvents.OnDataBinding("onDataBinding").OnDelete("onCheckedUsersDelete").OnError("onCheckedUsersError"))
        .ClientEvents(clientEvents => clientEvents.OnDelete("onCheckedUsersDelete").OnError("onCheckedUsersError").OnSave("onCheckedUsersSave").OnCommand("onCheckedUsersCommand"))
        .DataBinding(dataBinding => dataBinding.Ajax().Select("_GetAllMembershipUser", "Survey")
                                                        .Delete("_DeleteMembershipAssigned", "Survey")
                                                        .Update("_EditMembershipUser","Survey"))
        .HtmlAttributes(new { style = "min-width:1500px" })

        %>
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2310 posts

    Posted 04 Nov 2014 Link to this post

    Hi Chris,


    We cannot provide assistance for the Telerik MVC Extensions Grid, as this product was discontinued in mid 2013. We strongly recommend using UI for ASP.NET MVC instead.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top