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

No "No data" text

2 Answers 280 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tomáš
Top achievements
Rank 1
Tomáš asked on 17 Jul 2009, 01:47 PM
Hello there!

I notise a strange thing about GridView. When I have empty grid with no data binded, it shows ,,No data to display,, text and that's fine for me. But when I add some columns in design mode, text disappears.

My point is - is it some possible way to have grid with defined columns, no data a and ,,No data to display,, text at once? Or is it way how to force this text to show?

Thanks

Tom

2 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 20 Jul 2009, 06:59 AM
Hi Tomáš,

Yes, this is possible. All you need is to set the Text property of the GridElement to the desired text. You should also handle the Rows.CollectionChanged event to trigger when a row is added. Here is a sample:

this.radGridView1.GridElement.Text = "No data to display";             
this.radGridView1.Rows.CollectionChanged += new NotifyCollectionChangedEventHandler(Rows_CollectionChanged); 
 
void Rows_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) 
    if (e.Action == NotifyCollectionChangedAction.Add) 
    { 
        this.radGridView1.GridElement.Text = ""
    } 

Should you have any other questions, we will be glad to help.

Kind regards,
Jack
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
Tomáš
Top achievements
Rank 1
answered on 20 Jul 2009, 10:01 AM
Thank you, Jack :)
Tags
GridView
Asked by
Tomáš
Top achievements
Rank 1
Answers by
Jack
Telerik team
Tomáš
Top achievements
Rank 1
Share this question
or