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

[Solved] Custom message in empty row record of Grid

1 Answer 140 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.
Sam
Top achievements
Rank 1
Sam asked on 02 Aug 2012, 11:02 PM
good morning everyone,

i am currently using the Telerik Extensions for ASP.NET MVC3 and i need to custom the message that is displayed in the Grid when there are no records.  Currently, the message says "No records to display".  

1.  How would i be able to customize it?
2.  Can i do it through the "RowTemplate" method where inside is a block of lamda code that i could call the row.NoRecordsTemplate??? If yes?  how do i do that with the " row.NoRecordsTemplate "???  Not sure how to use it his properly.

currently, my code is as follows:

@{Html.Telerik().Grid(Model)
    .Name("grdGroup")
    .DataKeys(keys => keys.Add(k =>
        k.Id)
    )
    .HtmlAttributes(new { style = "border-style: dotted; width: 600px;" })
    .Columns(columns =>
    {
        columns.Bound(o => o.Code)
            .Width(100);
        columns.Bound(o => o.Name)
            .Width(475);
        columns.Bound(o => o.Year)
            .Width(25);
    })
    .RowTemplate(row =>
    {
        row.NoRecordsTemplate =
    })
    .Footer(false)
    .Render();
}



Thank you very much for your help.  Very much appreciate it.

1 Answer, 1 is accepted

Sort by
0
Sam
Top achievements
Rank 1
answered on 04 Aug 2012, 12:08 AM
i found some sort of solution at:

http://www.telerik.com/community/forums/aspnet-mvc/grid/custom-message-for-no-records-to-display.aspx 

but it doesn't relate to using:

.RowTemplate(row =>
    {
        row.NoRecordsTemplate =
    })

or even using

.NoRecordsTemplate(() =>
        {
            
        })


not sure how to use the above 2 code syntax.
Tags
Grid
Asked by
Sam
Top achievements
Rank 1
Answers by
Sam
Top achievements
Rank 1
Share this question
or