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

Scrolling is not enable when using width in percentage

0 Answers 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ajmal
Top achievements
Rank 1
ajmal asked on 10 May 2011, 12:31 PM
Hello,

Why below code not enabling scrolling, while using width in percentage...please help

@(Html.Telerik().Grid<BHN.PayGo.ASP.Model.Reports.POSListModel>()
                                  .Name("grdPOS").HtmlAttributes(new { style = "width:100%" })
  
                                   .Columns(columns =>
                                   {
                                       columns.Bound(o => o.POSName).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPOSName);
                                       columns.Bound(o => o.POSID).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPOSID);
                                       columns.Bound(o => o.PosType).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPosType);
                                       columns.Bound(o => o.DealerName).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblDealerName);
                                       columns.Bound(o => o.DealerID).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblDealerID);
                                       columns.Bound(o => o.ParentName).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblParentName);
                                       columns.Bound(o => o.ParentID).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblParentID);
                                       columns.Bound(o => o.ParentAccountType).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblParentAccountType);
                                       columns.Bound(o => o.LastTransactionDate).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblLastTransactionDate);
                                       columns.Bound(o => o.Street1).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblStreet1);
                                       columns.Bound(o => o.Street2).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblStreet2);
                                       columns.Bound(o => o.City).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblCity);
                                       columns.Bound(o => o.State).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblState);
                                       columns.Bound(o => o.Zip).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblZip);
                                       columns.Bound(o => o.Phone1).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPhone1);
                                       columns.Bound(o => o.Phone2).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPhone2);
                                       columns.Bound(o => o.Fax).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblFax);
                                       columns.Bound(o => o.Email).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblEmail);
                                       columns.Bound(o => o.Active).Width("10").Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblActive);
  
                                   })
  
                                    .DataBinding(dataBinding => dataBinding.Ajax().Select("_POSListBinding", "Reports"))
                                    .Pageable(settings => settings.Total((int)ViewData["TOTAL_POSLIST_DATA"]))
                                    .EnableCustomBinding(true)
                                    .Sortable(settings => settings.Enabled(false))
                                    .Scrollable(settings => settings.Enabled(true).Height("auto"))
                           )

If I'm using pixel then scrolling works, what the issue, do I need to change CSS,

@(Html.Telerik().Grid<BHN.PayGo.ASP.Model.Reports.POSListModel>()
                                  .Name("grdPOS").HtmlAttributes(new { style = "width:955px" })
  
                                   .Columns(columns =>
                                   {
                                       columns.Bound(o => o.POSName).Width(90).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPOSName);
                                       columns.Bound(o => o.POSID).Width(40).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPOSID);
                                       columns.Bound(o => o.PosType).Width(50).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPosType);
                                       columns.Bound(o => o.DealerName).Width(90).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblDealerName);
                                       columns.Bound(o => o.DealerID).Width(50).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblDealerID);
                                       columns.Bound(o => o.ParentName).Width(75).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblParentName);
                                       columns.Bound(o => o.ParentID).Width(50).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblParentID);
                                       columns.Bound(o => o.ParentAccountType).Width(65).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblParentAccountType);
                                       columns.Bound(o => o.LastTransactionDate).Width(75).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblLastTransactionDate);
                                       columns.Bound(o => o.Street1).Width(75).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblStreet1);
                                       columns.Bound(o => o.Street2).Width(75).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblStreet2);
                                       columns.Bound(o => o.City).Width(50).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblCity);
                                       columns.Bound(o => o.State).Width(50).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblState);
                                       columns.Bound(o => o.Zip).Width(50).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblZip);
                                       columns.Bound(o => o.Phone1).Width(65).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPhone1);
                                       columns.Bound(o => o.Phone2).Width(65).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblPhone2);
                                       columns.Bound(o => o.Fax).Width(65).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblFax);
                                       columns.Bound(o => o.Email).Width(100).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblEmail);
                                       columns.Bound(o => o.Active).Width(50).Title(@BHN.PayGo.ASP.Localization.Resources.Views.Reports.POSList.lblActive);
  
                                   })
  
                                    .DataBinding(dataBinding => dataBinding.Ajax().Select("_POSListBinding", "Reports"))
                                    .Pageable(settings => settings.Total((int)ViewData["TOTAL_POSLIST_DATA"]))
                                    .EnableCustomBinding(true)
                                    .Sortable(settings => settings.Enabled(false))
                                    .Scrollable(settings => settings.Enabled(true).Height("auto"))
                           )

Tags
Grid
Asked by
ajmal
Top achievements
Rank 1
Share this question
or