This is a migrated thread and some comments may be shown as answers.

[Solved] passing data into column.Format

0 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fran
Top achievements
Rank 1
Fran asked on 31 Jan 2011, 11:08 PM
On this forum I noticed that user's could populate information in the column Format function using the "{0}" syntax.  In the following code the link (/controllerName/Member/id) in the first column is generated correctly, but when I try to use this syntax in the last column, the "{0}" resolves to null.  Is there some magin that let's this work with Html.ActionLink(...) and not with user created extension methods such as AddUnlockButton(...).

for example
    <%= Html.Telerik().Grid(Model)
            .Name("AddressClassifications")
                .DataKeys(keys => { keys.Add(p => p.ProviderUserKey); })
                        .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxBinding""Administration"))
                        .Columns(columns =>
                {
                    columns.Bound(o => o.ProviderUserKey).Format(Html.ActionLink("Select""Member"new { id = "{0}" }).ToString()).Encoded(false).Filterable(false).Sortable(false).Title(String.Empty);
                    columns.Bound(o => o.UserName);
                    columns.Bound(o => o.CreationDate).Filterable(false);
                    columns.Bound(o => o.LastLoginDate).Filterable(false);
                    columns.Bound(o => o.ProviderUserKey).Format(Html.AddUnlockButton( "{0}" ));
                })
                .Pageable( pager =>
                {
                    pager.PageSize(25);
                    pager.Style(GridPagerStyles.NextPreviousAndInput);
                })

    %>
Tags
Grid
Asked by
Fran
Top achievements
Rank 1
Share this question
or