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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Not able to apply skin on Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

100952 Sep 15,2011 07:44 AM UTC Sep 20,2011 11:19 AM UTC ASP.NET MVC (Classic) 1
loading
Tags: Grid
Sonam Mehta
Asked On September 15, 2011 07:44 AM UTC

Hi,

I am using razor engine. I have define stylesheet and theme on my master page (_layout.cshtml).
@{ Html.Syncfusion().StyleManager()
.Register(stylesheets =>
{
stylesheets.Add(ComponentType.Grid);
stylesheets.Theme(Skins.Midnight);
}).Render();}

But when I run my application with syncfusion grid, Grid does not show with theme.

My grid code is as follow in my cshtm page register with master page:

@{ Html.Syncfusion().Grid("Grid1")
.Caption("User List")
.Column(column =>
{
column.Add(p => p.gebruiker_id).HeaderText("User ID");
column.Add(p => p.naam).HeaderText("Name");
column.Add(p => p.email).HeaderText("Email ID");
column.Add(P => P.avatar).HeaderText("Avtar");
})
.EnableSorting().SortSettings(sorting => sorting.AllowMultiSorting(true).AllowSorting(true))
.EnablePaging().PageSettings(p => p.PageSize(10).PageCount(3).PagerStyle(PagerStyle.DefaultAndAdvanced).ShowPagerInformation(true).PagerPosition(Position.BottomLeft).AllowPaging(true))
.Datasource(Model)
.Render();
}

Can you please provide me some solutions?




Ranjithkumar R G [Syncfusion]
Replied On September 20, 2011 11:19 AM UTC

Hi Sonam,

Thanks for using Syncfusion products.

Your requirement of applying skin to grid can be achieved by setting the property AutoFormat() in cshtml page. Please refer to the code-snippet below.

[Index.cshtml]

@{ Html.Syncfusion().Grid("Grid1")
.Datasource((IEnumerable)ViewData["data"])
.ActionMode(ActionMode.JSON)
.AutoFormat(Skins.Midnight)
.Column(column =>
{
column.Add(p => p.OrderID).HeaderText("Order ID");
column.Add(p => p.EmployeeID).HeaderText("Employee ID");
column.Add(p => p.CustomerID).AllowEditing(false);
column.Add(p => p.ShipCountry).HeaderText("Ship Country");
column.Add(p => p.OrderDate).HeaderText("Order Date").Format("{0:MM/dd/yyyy}");
column.Add(p => p.Freight).HeaderText("Freight");

})

.EnablePaging()
.EnableSorting()

.Caption("Orders")
.EnableGrouping()

}

Please refer to the below link to download the sample application.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=inlineedit-razor-mvc-630860359.zip

Please let me know if you have any concern.

Regards,
Ranjithkumar.



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.

Warning Icon 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.Close Icon

;