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

[Solved] MvcGrid Template Column not Editable

0 Answers 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tim
Top achievements
Rank 1
Tim asked on 15 May 2012, 09:13 PM
I have been following the examples online involving Server and Client Template columns for the Grid.  I have a couple of columns I would like to "band" together (U.S. Cost and China Cost) under a single Header.  However, there does not seem to be anyway to specify a Template to use while the Row is in an "inline" edit mode.  Can this be accomplished?

.Columns(columns =>
{
    columns.AutoGenerate(false);
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Image);
        commands.Delete().ButtonType(GridButtonType.Image);
    }).Width(200);
    columns.Bound(p => p.Code);
    columns.Bound(p => p.Name);
    columns.Bound(p => p.StandardPrice).Format("{0:c}");
    columns
        .Template(
            @<text>                                                       
            <table cellspacing="0">
                <tr><td>@item.USCost</td><td>@item.CNCost</td></tr>
            </table>
            </text>)
        .HeaderTemplate(
            @<text>       
            <table cellspacing="0" class="header-band-col">
                <tr><td colspan="2"><strong>Cost</strong></td></tr>
                <tr><td>U.S.</td><td>China</td></tr>
            </table>
            </text>)
        .Width(200);
})
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Share this question
or