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

Is there a way to pad the grid with empty rows?

1 Answer 23 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 14 Dec 2011, 05:11 PM
We'd like the grid to have somewhat of an Excel look - the grid needs to occupy all the vertical real estate available and if there aren't enough rows with data we'd like to pad the grid with empty rows. For example if there's enough space to display 10 rows but we only have 3 rows of data - we'd like the grid to display extra 7 empty rows. We bind the grid's ItemsSource to a collection in a viewmodel.

I saw a similar thread here: http://www.telerik.com/community/forums/silverlight/gridview/radgridview-rows-padding.aspx but it didn't solve my issue. We are not using a DomainDataSource.

I'd rather be able to add the empty rows in the grid itself rather than in the source collection. It's a purely visual requirement and I'm concerned that if I mess with the underlying collection we might have additional issues, like sorting, etc.

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 14 Dec 2011, 07:00 PM
Hi Boris,

 

RadGridView is a virtual component - the virtualization is turned on by default. By that reason it is not recommended to directly work with the UI. It would be much more appropriate if you work with the data item instead. In your particular case the grid should be bound to a collection with the desired number of empty rows.


Greetings,
Vanya Pavlova
the Telerik team

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

Tags
GridView
Asked by
Boris
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or