We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Controlling grid dimensions?

Thread ID:

Created:

Updated:

Platform:

Replies:

96824 Oct 7,2010 03:51 PM Oct 20,2010 09:04 AM ASP.NET MVC (Classic) 3
loading
Tags: Grid
Greg Clouston
Asked On October 7, 2010 03:51 PM

Silly question but how do you control basic size attributes of the MVC Grid? I would have thought that these attributes would be painfully obvious in the namespace but I can't find them. I'll assume they are buried further down somewhere.

The resulting HTML produces a div with it's size set to an arbitrary width. I need to make the grid's height and width larger to fill up it's container.


Krishnaraj D [Syncfusion]
Replied On October 13, 2010 01:43 PM

Hi Greg Clouston,

Thanks for evaluating Syncfusion Products. The response for this query has been updated in the incident 73089 also.

We have categorized the size attributes under scrolling and therefore to specify the basic size attributes in View, please refer to the below mentioned code snippet.

<%=Html.Grid("Grid1")
.Datasource(Model)
. . . . . . . .
. . . . . . . .
//Setting the size attributes of grid and width
.Scrolling(size =>
{
size
.Height(210)
.Width(1200);
})

.EnablePaging()
.EnableSorting()
.AutoFormat(Skins.Sandune)

%>

We will provide explicit support for specifying the size attributes in Grid builder in our volume1 2011 release.

For more details about setting the size attributes through builder, please refer our online documentation in the below link.

http://help.syncfusion.com/ug_83/User%20Interface/ASP.NET%20MVC/Grid/default.htm?turl=Documents%2Fthroughgridbuilder15.htm

To Control the size attributes from the controller, you can directly set the width and height of GridPropertiesModel as below.

GridPropertiesModel model = new GridPropertiesModel
{
DataSource = new NorthwindDataContext().Orders.Take(100).ToList(),
AutoFormat = Syncfusion.Mvc.Shared.Skins.Sandune
};
//Setting height and width of grid. This will apply only if you set AllowScrolling to true.
model.Height = 210;
model.Width = 1200;
model.AllowScrolling = true;



For more details about setting the size attributes through controller, please refer our online documentation in the below link.

http://help.syncfusion.com/ug_83/User%20Interface/ASP.NET%20MVC/Grid/default.htm?turl=Documents%2Fthroughgridpropertiesmodel15.htm

Please let us know if you have any queries.

Regards,
Krishnaraj D





Greg Clouston
Replied On October 14, 2010 08:31 AM

Thanks that worked.

I'm curious to know why this isn't mentioned anywhere in the products documentation.


Krishnaraj D [Syncfusion]
Replied On October 20, 2010 09:04 AM


Hi Greg Clouston,

Good to hear that you have everything working. And the documentation for setting the size attributes is available in the below links.

http://help.syncfusion.com/ug_83/User%20Interface/ASP.NET%20MVC/Grid/default.htm?turl=Documents%2Fthroughgridbuilder15.htm

http://help.syncfusion.com/ug_83/User%20Interface/ASP.NET%20MVC/Grid/default.htm?turl=Documents%2Fthroughgridpropertiesmodel15.htm


Please let us know if you have any queries.

Regards,
Krishnaraj D


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;