Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
@model IEnumerable<uyilo_fms.models.vehicle_obj>

@using GridMvc.Html
@{



}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="with=device-width"/>
<link href="@Url.Content("~/Content/Gridmvc.css")" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"></script>
<script src="@Url.Content("~/Scripts/gridmvc.min.js")"></script>
<rowdefinition height="57" width="873">

<title>@ViewBag.Title = "Title"</title>
</head>
<body>

Vehicles List



@Html.Grid(Model, GridRenderOptions.Create("VehiclesGrid")).Columns(columns =>

{
columns.Add().Encoded(false).Sanitized(false).RenderValueAs(c => @<img class="thumbnail" src="~/Content/images/@c.ImagePath" height="80" width="80" alt="@c.ImagePath" />);
columns.Add(c => c.displayName).Titled("Vehicle Name");
columns.Add(c => c.make).Titled("Make");
columns.Add(c => c.type).Titled("Type");
columns.Add(c => c.odometer).Titled("Odometer");




}).WithPaging(5).Sortable(true).



<script>
function getRow(vehicle_reg) {
$.jax({
url: '@Url.Action("DisplayTripHistory", "Home")',
data: JSON.stringify(vehicle_reg),
contentType: 'application/json',
dataType: 'json',
type: 'POST',
success: function () {
alert('SUCCESS');
},
error: function () {
alert('error');
}
}
);
}
</script>
</body>
</html>
Posted

1 solution

All the grids internally uses table structure. So you can change the grid style as per your need.
So answer to your question would be something like this:
<br />
#yourGridName tr td<br />
{<br />
    color: #f44;<br />
}<br />


-KR
 
Share this answer
 
v2
Comments
[no name] 19-Oct-15 7:17am    
Thank you I'm coding using C# MVC I'm a begginer/Learner where would this code go. in views? because i have been trying out this way but its not working maybe I'm coding in the wrong place.
Krunal Rohit 19-Oct-15 7:42am    
This is a CSS.
You can wrap this code in <style></style> tag.

-KR
[no name] 19-Oct-15 8:47am    
Thank you KrunalRohit it doesn't seem to work when i place it in my View raping with style. but ill keep trying it out. there is no error but the color doesn't reflect
Krunal Rohit 19-Oct-15 10:00am    
Try to inspect your grid in browser (Right click on the grid and Inspect Element).
If you see table, then try to format it using CSS.

-KR
[no name] 19-Oct-15 10:07am    
It worked Thank you so much KrunalRohit, I did as you said inspected the code and changed the color using the code below.
th {color: #d35400;
text-decoration: none;}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900