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

Empty Data Text

6 Answers 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adam
Top achievements
Rank 2
Adam asked on 25 Jan 2012, 08:33 PM
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!

6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Jan 2012, 08:05 AM
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 >>

0
Adam
Top achievements
Rank 2
answered on 26 Jan 2012, 02:11 PM
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

0
Vlad
Telerik team
answered on 26 Jan 2012, 02:13 PM
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 >>

0
Adam
Top achievements
Rank 2
answered on 26 Jan 2012, 02:20 PM
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
0
Accepted
Vlad
Telerik team
answered on 26 Jan 2012, 02:23 PM
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 >>

0
Adam
Top achievements
Rank 2
answered on 26 Jan 2012, 02:26 PM
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
Tags
GridView
Asked by
Adam
Top achievements
Rank 2
Answers by
Maya
Telerik team
Adam
Top achievements
Rank 2
Vlad
Telerik team
Share this question
or