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

How i know if radgrid is empty?

2 Answers 876 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brygom
Top achievements
Rank 1
Brygom asked on 31 May 2009, 04:26 AM

Hi! I have two questions. I hope for for your help

1. How i know if the radgrid is empty?

2. How i can change the text to show when the radgrid is empty?

Thanks!!!!!

Briayan

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 31 May 2009, 06:25 PM
Hello Brygom,

Straight onto your questions:

1) You can check the Items count:
if (RadGrid1.Items.Count == 0) 
    ... 

2) The "No records" text could be modified by using the NoMasterRecordsText and NoDetailRecordsText properties of the GridTableView. You can even define your own "no records" template:
private void Page_Load(object sender, EventArgs e) 
    RadGrid1.MasterTableView.NoMasterRecordsText = "No items!"

<MasterTableView> 
    <NoRecordsTemplate> 
        <div style="background-color: Gray"
            NO RECORDS! 
        </div> 
    </NoRecordsTemplate> 
</MasterTableView> 

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Brygom
Top achievements
Rank 1
answered on 01 Jun 2009, 03:58 AM
Thanks a lot!!!
Tags
Grid
Asked by
Brygom
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Brygom
Top achievements
Rank 1
Share this question
or