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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Gridbuilder column data only supports properties?

Thread ID:

Created:

Updated:

Platform:

Replies:

102674 Feb 20,2012 10:20 AM UTC Feb 29,2012 11:40 AM UTC ASP.NET MVC (Classic) 1
loading
Tags: Grid
Mark Treveil
Asked On February 20, 2012 10:20 AM UTC


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


Ranjithkumar R G [Syncfusion]
Replied On 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.




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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;