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

New Row should be available when the gridview loaded.

1 Answer 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 02 Aug 2017, 05:49 AM

Hi,

I want to show one empty row at the end of the RadGridview when it is loaded when the data is empty.How to achieve this.I tried like shown below but no use

 

if(collection.Count ==0)

{

var itemsView = (IEditableCollectionView)CollectionViewSource.GetDefaultView(SyncObjects);
                    itemsView.NewItemPlaceholderPosition = NewItemPlaceholderPosition.AtEnd;

}

Once after loaded user will add data using add button.Now the grid is appearing as shown in the image where only headers are coming and it is not appealing  like grid.

 

I want one empty row once it is loaded when no data exist.How to achieve this.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 04 Aug 2017, 12:13 PM
Hi Dharmavaram,

As RadGridView is a data-bound component, the most convenient approach for satisfying such requirement would be to manipulate its source collection. Basically, you can add a single item to it that has no values set for its properties. Would such an approach suit your needs?

Regards,
Stefan X1
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or