How i know if radgrid is empty?

3 posts, 1 answers
  1. Brygom
    Brygom avatar
    15 posts
    Member since:
    May 2009

    Posted 30 May 2009 Link to this post

    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. Answer
    Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 31 May 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brygom
    Brygom avatar
    15 posts
    Member since:
    May 2009

    Posted 31 May 2009 Link to this post

    Thanks a lot!!!
Back to Top