Gridbuilder column data only supports properties?


Guys
Another question, if I may, which probably has a very shot answer.

I have a new typed view displaying a grid:

@ModelType IEnumerable(Of myStuff.Meeting)

@(New HtmlString(Html.Syncfusion.Grid(Of myStuff.Meeting)("myGrid",
"GridProperties", _
Sub(column)
column.Add(Function(p) p.DateString).HeaderText("Date")
column.Add(Function(p) p.AgendaUrl).HeaderText("Status")
End Sub)))


The idea is that you can click on a cell to drill into more information.

My problem is, it seems that you can only specify a simple property of "p" for the column data, e.g. p.AgendaUrl, and not an expression of any sort - at least not in VB. This means I have to embed the knowledge if how to generate my URL in the model classes, which is not very clean.

Is there a way around this?

Thanks
Mark


1 Reply

RR Ranjithkumar R G Syncfusion Team February 29, 2012 11:40 AM UTC

Hi Mark,

Thanks for using Syncfusion prodcuts.

Your requirement of specifying url of a particular column can be achieved by formatting the specified column. Please refer to the code snippet below to achieve this.

[Index]

@( Html.Syncfusion().Grid("SampleGrid")
.Datasource(Model)
.Caption("Orders")
.Column(col =>
{
col.Add(c => c.OrderID);
col.Add(c => c.EmployeeID);
col.Add(c => c.CustomerID);
col.Add(c => c.OrderDate);
col.Add(c => c.ShipCountry);
col.Add("Delete").HeaderText("Delete Record").Format("Delete");

})
.EnablePaging()
.EnableSorting()
.EnableGrouping()
.EnableFiltering()
)


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

http://www.syncfusion.com/downloads/Support/DirectTrac/91198/Sample190335877.zip

Please let me know if you have any concern.

Regards,
Ranjithkumar.




Loader.
Up arrow icon