Conditional formatting in Version: 7.403.0.20

Hi,

I've been trying to implement something where I can display either a check box or a small image of some sort in the grid. All samples and documentation I've looked at suggest using the QueryCellInfo method of the GridPropertiesModel, but I can't seem to get it to work, the method doesn't seem to exist. The rest of my grid displays and works fine, just need some extra formatting to make some of the information in the grid easier on the users.

Any help is much appreciated.

Regards,
Henryk.

1 Reply

BM Balaji M Syncfusion Team November 12, 2009 10:46 AM UTC

Hi Henryk,

Thank you for your interest in Syncfusion products.

Our Essential Grid have been revamped to provide an enhanced support to extensive client side functionality. Due

to revamping the QueryCellInfo event is removed from GridPropertyModel. Instead of the QueryCellInfo we can

achieve the formatting data through Format API & CssClass API in view.

Format API in Grid provides you a support for formatting your column data. In this format we can do all the

string formatting.

Css API in Grid Provides you a support for adding css class to GridColumn.

Syntax: Format

column.Add(ColumnMapping).Format("format option");

Syntax: CssClass

column.Add(ColumnMapping).CssClass("CssClassName");

Refer the below code snippet, which illustrates this.



<%=Html.Grid("Grid1", "GridModel", column => {
column.Add(c => c.CustomerID).HeaderText("CustomerID").Format("ID : {CustomerID}");
column.Add(c => c.EmployeeID).HeaderText("Employee ID");
column.Add(c => c.OrderID).HeaderText("Order ID");
column.Add(c => c.OrderDate).HeaderText("Order Date").Format("{OrderDate:MM/dd/yy}");
column.Add(c => c.ShipCity).HeaderText("ShipCity").CssClass("CustomData");
column.Add(c => c.ShipCountry).HeaderText("ShipCountry");
})%>


Note : RegisterClientResourceManager has been updated by RegisterStaticResources. We suggest to you use

RegisterStaticResource to work in new MVC Grid.

Add the Resource Manager to the Site.Master page under the tag as follows.


.....

<%=Html.RegisterStaticResources() %>


Please refer the sample from the below link

http://files.syncfusion.com/support/grid_mvc/Incidents/v7.4.0.20/F91286/MVC_GridSample.zip

We would also suggest you to refer the below documentation link for more details.

http://help.syncfusion.com/ug_74/GridMVC/defaultMVC.html

Please let me know if you have any concerns.

Regards,
M. Balaji.


Loader.
Up arrow icon