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

Text in GridView body when there are no rows

9 Answers 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
yonadav
Top achievements
Rank 1
yonadav asked on 31 Jan 2010, 06:25 PM
Hi There,

I'm trying to find a way to have a text appear in the body of the GridView (where the background color appears) whenever the grid does not contain any rows (something like "The list is empty, click on XXX to add something!"). I could think of a few ways to do this, but was wondering if there is some kind of recommended way.

What do you guys say?

Thanks,
yonadav

9 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 01 Feb 2010, 09:39 AM
Hello yonadav,

Since this is a frequently requested behavior , I am preparing an online examle right now. I will notify you as soon as it is online ( later today or tomorrow).

Best wishes,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Pavel Pavlov
Telerik team
answered on 01 Feb 2010, 04:29 PM
Hi yonadav,

A quick update :
I have posted the online example here . You may notice this is for Silverlight .However RadGridView shares a common codebase between Silverlight and WPF therefore the same approach is applicable in WPF.

Sincerely yours,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
yonadav
Top achievements
Rank 1
answered on 01 Feb 2010, 05:13 PM
Hi Pavel,

Thanks for the quick reply!

It appears System.Windows.Interactivity.dll required Blend to be installed. While we do have the licenses for Blend, this may complicate the setup on some of our developers' stations. Is there a solution for this without requiring Blend?

Thanks,
yonadav
0
Pavel Pavlov
Telerik team
answered on 03 Feb 2010, 10:36 AM
Hi yonadav,
System.Windows.Interactivity.dll is indeed part of the Blend redistribution package.

However using it and redistributing it does not require a Blend installation or a Blend license.
So I believe  just copying the dll , or even including it in your installer should not be a problem .

There are some deiscussions on the net on that issue - for example : here.

If however you have concerns and decide not to use the dll, the code can be easily extracted from the attached behavior and added to your project. In case you decide to avoid the dll , just let me know and I will send yo a small example without  attached behaviors.

Regards,
Pavel Pavlov
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
yonadav
Top achievements
Rank 1
answered on 03 Feb 2010, 05:00 PM
Hi Pavel,

We would prefer to avoid using Blend's DLLs (even a redist). Could you update the sample to include a version that does not require Blend?

Thanks,
yonadav
0
Accepted
Pavel Pavlov
Telerik team
answered on 05 Feb 2010, 12:32 PM
Hello yonadav,
The attached example is for WPF and does not require System.Windows.Interactivity.dll .

I have copied the code from the behavior to a user control , so to have this working in your project - just copy the user control to your project and create an istance of it as follows :

 

public Window1()
  
{
  
InitializeComponent();
  
EmptyDataControl myControl = new EmptyDataControl() { GridView = this.RadGridView1 };
  
}

 



Kind regards,
Pavel Pavlov
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
yonadav
Top achievements
Rank 1
answered on 24 Feb 2010, 03:49 PM
Hi Pavel,

Works like a charm, thank you!

It would be great if this were to be included as a feature of GridView. The reason is because we don't feel comfortable messing around with the GridView's implementation (the Grids themselves). This is something that can easily break in a future version.

Thanks,
yonadav
0
yonadav
Top achievements
Rank 1
answered on 14 Apr 2010, 01:57 PM
Hi Pavel,

As we expected, this broke in the Q1 release - there are no two Grids in GridView:
 private void LoadControlIntoGridView(RadGridView gridView) 
        { 
            Grid rootGrid = gridView.ChildrenOfType<Grid>()[1]; 
 
            this.SetValue(Grid.RowProperty, 2); 
            this.SetValue(Grid.RowSpanProperty, 2); 
            this.SetValue(Grid.ColumnSpanProperty, 2); 
            this.SetValue(Border.MarginProperty, new Thickness(0, 27, 0, 0)); 
            rootGrid.Children.Add(this); 
        } 
 

(Note the first line of the function)

While we could try messing around and figure out what has changed, we'd appreciate a more "official" answer from you. How do we fix it to work in Q1? Will you be adding this functionality in a future release so we do not need to use this solution?

Thanks,
yonadav
0
Pavel Pavlov
Telerik team
answered on 14 Apr 2010, 04:55 PM
Hi yonadav,

In an attemt to isolate the problem , I have taken the previously sent project and updated it with the binaries from Q1.
However everything seems to work just fine. 

Please find the project attached.

In case you have more info I will be glad to ellaborate further and find the reason for the trouble.

Kind regards,
Pavel Pavlov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
yonadav
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
yonadav
Top achievements
Rank 1
Share this question
or