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. Image for the cookie policy date
close icon

IGridColumnBuilder Format(string content) does not bind

I have some problems with
IGridColumnBuilder<TListItemModel> Format(string content) method.

For some reasons I need to populate grid column with custom format:
columns.Add(String.Empty).Format(@Primoartis.GridEditActionLink()).Width(100).UnBound(true);

Helper method returns string, fomatted like:
" <a class="css-class" rel='nofollow' href="/controller/action?id={Id}></a>" "

but the value "{Id}" does not bind with proper value. TListItemModel has Id property.
When I write format html by hand, it works fine. But when I return it from static method, it does not.

What do I need to do?
Please help someone.

1 Reply

AM Abdul Matin M Syncfusion Team June 10, 2013 01:13 PM UTC

Hi Wojciech,

 

Thanks for your interest in Syncfusion products.

 

I am afraid that I am unable to reproduce this issue with the given information. I have created a sample based on the code snippet you have given. You could use this sample and reproduce the issue if any. We have made this sample work on JSON Mode, we will be glad if you please let us know the mode in which you are interested in running the project. We are unable to use your Primoartis product instead we have used HTML ActionLink to resolve this issue. Could you please refer the below code snippet.

 

<div id="Target" style="width:100%;" class="sample-panel-margin">

    @(Html.Syncfusion().Grid<UnboundExample.Models.JSONOrder>("UnBoundColumn_Grid")

                    .ActionMode(ActionMode.JSON)

                    .Caption("Orders")

                    .EnablePaging()

                    .EnableSorting()

                    .AutoFormat(Skins.Marble)

                    .Column(column =>

                              {

                                  column.Add(p => p.OrderID).HeaderText("Order ID").TextAlign(TextAlignment.Right).Width(100);

                                  column.Add(p => p.CustomerID).HeaderText("Customer ID");

                                  column.Add(p => p.ShipCountry).HeaderText("Ship Country");

                                  column.Add(p => p.ShipCity).HeaderText("Ship City");

                                  column.Add("Delete").HeaderText("Delete Record").Width(120)

                                      .Format(@Html.ActionLink("Delete", "DeleteRecord", new { id = "{OrderID}" }).ToString());

                              }))

</div>

 

For your convenience we have attached the sample

Please try this sample and get back to us with more information, so that we can analyze that and provide the better solution.

 

 

Let us know if you have queries.

 

Regards,

Abdul Matin M


Loader.
Live Chat Icon For mobile
Up arrow icon