Grid Resize Settings

Hello,
I am using grid object in my project. I want to make grid cell resizing all them. But They can not expansion all cell. Only end column cell is resizing.
I am sending code block.
You may me help please !https://i.hizliresim.com/rJqJX1.png
Thank you.
Best Regards.
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.datasource).Adaptor(AdaptorType.RemoteSaveAdaptor))
.AllowResizing(true)
.AllowPaging(true)
.PageSettings(eve => eve.PageSize(50))
.AllowMultiSorting(true)
//.IsResponsive(true)
//.EnableResponsiveRow(true)
.AllowTextWrap(false)
.MinWidth(321)
.AllowScrolling()
.ScrollSettings(col =>
{
col.Width("1600").Height("750");
})
.AllowFiltering()
.Columns(col =>
{
col.Field("MATCActual").HeaderText("MAT PF Actual Unit").AllowEditing(false).TextAlign(TextAlign.Right).Width(150).Format("{0:N0}").CssClass("MAT").Add();
col.Field("MATCLastYearActual").HeaderText("MAT PF Y-1 %").Format(Session["Digit"].ToString()).CssClass("MAT").AllowEditing(false).TextAlign(TextAlign.Right).Width(150).Add();
col.Field("MATCGeo").HeaderText("MAT PF Geo %").Format(Session["Digit"].ToString()).CssClass("MAT").AllowEditing(false).TextAlign(TextAlign.Right).Width(150).Add();
col.Field("MATCMarketShare").HeaderText("MAT PF MS %").Format(Session["Digit"].ToString()).CssClass("MAT").AllowEditing(false).TextAlign(TextAlign.Right).Width(150).Add();
col.Field("MATMActual").HeaderText("MAT MARKET Actual Unit").AllowEditing(false).TextAlign(TextAlign.Right).Width(150).Format("{0:N0}").CssClass("MAT").Add();
col.Field("MATMLastYearActual").HeaderText("MAT MARKET Y-1 %").Format(Session["Digit"].ToString()).CssClass("MAT").AllowEditing(false).TextAlign(TextAlign.Right).Width(150).Add();
col.Field("MATMGeo").HeaderText("MAT MARKET Geo %").Format(Session["Digit"].ToString()).CssClass("MAT").AllowEditing(false).TextAlign(TextAlign.Right).Width(150).Add();
})



3 Replies

VA Venkatesh Ayothi Raman Syncfusion Team January 4, 2018 01:31 AM UTC

Hi Ayben, 

Thanks for using Syncfusion products. 

We have checked your query and we have suspect that you are expecting the resizing behavior not to be applied for all columns. We went through your code example that you have shared for us and you have set the scroll settings width as 1650 which is exceeding the windows width. But you are defined column width as 150 for each.  
We suspect that you want to render the columns based on the width which is specified in the columns definition. If so, we suggest you use ColumnLayout property as fixed. If the columnLayout is set as fixed, then column width will be static. Also, we suggest you to use AllowResizeToFit property instead of AllowResizing property. Because, if we enable While enabling resizing, by default resizeMode was set as “normal”, It will adjust all the columns in the Grid. It happens in your case. 
Same time, if we enable AllowResizeToFit property then Column width is set automatically based on the content or header text which is large. Please refer to the following code example and Help documentation, 
Code Example: 
@(Html.EJ().Grid<object>("FlatGrid") 
         .Datasource((IEnumerable<object>)ViewBag.datasource) 
 
            .AllowResizeToFit(true) 
                .. .  . 
                        .ColumnLayout(ColumnLayout.Fixed) 
                        .  . . 
 
        .Columns(col => 
        { 
. .  . 
        })) 
 

We have also prepared a sample based on your requirement which can be download from following link, 


Please let us know If you have any further assistance on this. 

Regards, 
Venkatesh Ayothiraman. 



AY ayben January 9, 2018 12:29 PM UTC

Hi Venkatesh ,

Thanks for your help . I can analize  your sending examples and I can try them.
But  My problem  continues  this part. I can send you video about my problem and You can understand 
what We make this.


Thank you.
Best Regards.



Attachment: GridResize2_aaec54f5.rar


VN Vignesh Natarajan Syncfusion Team January 10, 2018 11:59 AM UTC

Hi Ayben, 

We have analyzed your video and attached code snippet. We have prepared sample using your video. We are not able to reproduce the reported issue at our end.  

Kindly download the sample from below link 

  
Kindly share the following details to reproduce the issue a our end.   
  1. Share the correct code snippet of the Grid rendering code (since video demo and code shared mismatch)
  2. Are you using frozen column in your sample?
  3. Share the screenshot of the script error in console window(if any).
  4. If  possible share  the issue reproducing sample or try to reproduce the issue in provided sample

Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon