Empty Data Text

7 posts, 1 answers
  1. Adam
    Adam avatar
    40 posts
    Member since:
    Dec 2011

    Posted 25 Jan 2012 Link to this post

    I've been searching around trying to figure out how to apply an empty data text value when my grid has no rows to display. I see it's not something that's built into the RadGridView (not sure why) and it has to be manually created. I've tried a few of the example projects I found but none seem to work correctly. The one I found that actually compiles will show the empty data text even if the data grid has rows. The empty data text is underneath the grid rows.

    Thoughts on how to go about doing this?

    Thanks!
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 26 Jan 2012 Link to this post

    Hello Adam,

    I would recommend you to run through this blog post for a reference. 

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Adam
    Adam avatar
    40 posts
    Member since:
    Dec 2011

    Posted 26 Jan 2012 Link to this post

    Hi Maya,
    Thank you for the prompt reply. The blog you supplied as a reference is the one I'm currently looking into now, however, there appears to be a bug as I get the following error for this line of code:

    Grid rootGrid = gridView.ChildrenOfType<Grid>()[1];

    Cannot apply indexing with [] to an expression of type 'System.Collections.Generic.IEnumerable<System.Windows.Controls.Grid>'

    I can't seem to figure out why this would throw this error if others have been successful using it. Can you help with this error?

    Thanks!
    Adam

  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 26 Jan 2012 Link to this post

    Hi,

     You can use:

    Grid rootGrid = gridView.ChildrenOfType<Grid>().ElementAt(1);  

    All the best,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Adam
    Adam avatar
    40 posts
    Member since:
    Dec 2011

    Posted 26 Jan 2012 Link to this post

    Hi Vlad,
    Thanks for that tip, however I'm getting this error now..Sorry to be such a pain...What am I missing now?

    'System.Collections.Generic.IEnumerable<System.Windows.Controls.Grid>' does not contain a definition for 'ElementAt' and no extension method 'ElementAt' accepting a first argument of type 'System.Collections.Generic.IEnumerable<System.Windows.Controls.Grid>'


    Thanks so much!!
    Adam
  6. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 26 Jan 2012 Link to this post

    Hello,

     Most probably you do not have:

    using System.Linq;

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. Adam
    Adam avatar
    40 posts
    Member since:
    Dec 2011

    Posted 26 Jan 2012 Link to this post

    Wow..too early in the morning here for me to be missing small stuff like that.....Adding the System.Linq did the trick.. Thanks so much guys!!

    Adam
Back to Top