I have a grid where i need to highlight one particular column in different color. How can we do that. I have the below code where i need to display the country column alone in a different color.
@( Html.Infragistics().Grid<GridDoubleClick.Models.UserInfo>() .ID("igGrid1") .AutoGenerateColumns(true) .Columns(column => { column.For(x => x.UserId).DataType("int").HeaderText("UserId").Width("100"); column.For(x => x.FirstName).DataType("string").HeaderText("First Name").Width("100"); column.For(x => x.LastName).DataType("string").HeaderText("Last Name").Width("100") ; column.For(x => x.Address1).DataType("string").HeaderText("Address1").Width("100"); column.For(x => x.Address2).DataType("string").HeaderText("Address2").Width("100"); column.For(x => x.City).DataType("string").HeaderText("City").Width("100"); column.For(x => x.State).DataType("string").HeaderText("State").Width("100"); column.For(x => x.Country).DataType("string").HeaderText("Country").Width("100"); }) .Features(features => { features.Resizing().AllowDoubleClickToResize(true); features.Resizing().DeferredResizing(true); features.Sorting().Mode(SortingMode.Multiple); features.Sorting().ApplyColumnCss(false); features.Selection().MouseDragSelect(true).MultipleSelection(false).Mode(SelectionMode.Row); }) .ClientDataSourceType(ClientDataSourceType.JSON) .DataSourceUrl(Url.Action("GetUserInfo")) .Width("1000") .Height("360") .LocalSchemaTransform(true) .DataBind() .Render() )
Will we be able to do without using row template? If so let me know.
Regards,
Suresh A
Any update on this?
Hello Suresh,
Thank you for posting in our forums.
You can use RowTemplate for the purpose.
Please refer to the blog of Taz regarding this
http://blogs.infragistics.com/blogs/taz_abdeali/archive/2011/04/21/jquery-templating-tips-amp-tricks.aspx
and the online sample
http://samples.infragistics.com/jquery/grid/row-template
Please let me know if you need further assistance.
Thanks i have used row template for highlighting the column .