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

Grid with empty result set

3 Answers 108 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.
Jack
Top achievements
Rank 1
Jack asked on 28 Jul 2010, 11:50 PM
I have a Telerik(MVC) grid developed by one of the senior developers and have to add the function that adds a message stating that there were no records (with a link to create a new one) if the result set is empty . How do I do this, is there any simple example out there?

If the grid has no results in it I just want to display a message stating "There were no records for your search, click here to create a record"

Thank you.

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 29 Jul 2010, 08:24 AM
Hello Jack,

Please refer to the following forum thread: How to customize "no data" text.

Kind regards,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jack
Top achievements
Rank 1
answered on 29 Jul 2010, 06:50 PM
Thanks, I am a bit of a novice when it comes to Telerik. I have the view with this in it:
                <%=
            Html.Telerik().Grid(Model)
                .Name("Devices")
                .DataKeys(dataKeys => dataKeys.Add(p => p.ID))
                .DataBinding(dataBinding=> dataBinding.Ajax().Select("AjaxBinding", "Device"))
                .Columns(columns =>
                             {
                                 columns.Bound(f => f.ID).Format("<a href='#'id='{0}' class='lnkDelete'>" + Resources.Resource.Device_Grid_Delete + "</a>")
                                     .Encoded(false).Title(" ");
                                 columns.Bound(f => f.Name).Title(Resources.Resource.Device_Grid_Name);
                                 columns.Bound(f => f.DeviceType).Title(Resources.Resource.Device_Grid_Type);
                                 columns.Bound(f => f.DisplayLastReport).Title(Resources.Resource.Device_Grid_Date);
                                 columns.Bound(f => f.Status).Title(Resources.Resource.Device_Grid_Status);
                                 columns.Bound(f => f.ID).Format("<a href='/Device/Index?device={0}'>" + Resources.Resource.Device_Grid_Locate + "</a>")
                                     .Encoded(false).Title(Resources.Resource.Device_Grid_Locate);
                            })
               .Pageable()
               .Sortable()
               .HtmlAttributes(new { @class = "content_table" })
                %>

                <a href="#" class="lnkNew"><%= Resources.Resource.Device_Grid_New %></a>
    </div>

I did add the javascript function and can see it in asset.axd, I can get to my the empty row using:
$('#Devices').find('.t-no-data td')
      .html('No devices available') I could confirm this by running this in the console part of Firebug.

I have no idea where to add the other parts? Any help?
0
Phil
Top achievements
Rank 1
answered on 25 Sep 2012, 03:38 PM
Dude, the link is dead. Do you have another one?
Tags
Grid
Asked by
Jack
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Jack
Top achievements
Rank 1
Phil
Top achievements
Rank 1
Share this question
or