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

[Solved] Show NewRow at Bottom

6 Answers 461 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.
michael
Top achievements
Rank 1
michael asked on 12 Oct 2010, 09:16 PM
Is there really no way to show the "Click here to add new item" at the bottom of the grid instead of the top?

6 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 13 Oct 2010, 02:59 PM
Hi Michael,

I have prepared an example for you that demonstrates how to change the position of the GridViewNewRow.
Please check the attached project and let me know if it works in your case.

Greetings,
Vanya Pavlova
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
0
Edward
Top achievements
Rank 1
answered on 18 Nov 2010, 05:27 PM
Hello,

Thanks for this. We have added your code as a template for our grids and the NewRow does appear at the bottom. However:

1. It appears at the very bottom of the grid, rather than directly after the last row. Can this be changed?

2. After clicking on the NewRow, there is no horizontal line along the top of the NewRow, which looks a bit strange. Maybe this wouldn't matter if the NewRow was directly after the last row.

While I'm here can I throw in another couple of issues relating to NewRow:

3. Suppose you have 3 columns in your grid. You add a new row by clicking on the NewRow and then fill in data for columns 1, 2 and 3, and press Tab to commit the new row. You then click on the NewRow again. The cursor appears in column 3 (because it was the most recently used column) - I would expect it to appear in column 1. Similarly, if you only fill in data for columns 1 and 2 then press Esc to abandon the NewRow, then click on the NewRow again, the cursor appears in column 2 - again I think it should appear in column 1.

4. After pressing Tab to commit the new row, I would actually like another new row to automatically be added (and the cursor placed in column 1). Then the user would press Esc if they didn't want the new row. This would speed up data entry because there is no need to use the mouse. How would I implement this?

Many thanks for your help.

Ed
0
Vanya Pavlova
Telerik team
answered on 23 Nov 2010, 10:17 AM
Hi Edward,

 
The approach demonstrated at previous example was achieved through editing the template the RadGridView and extracting the PART_NewRow from the GridViewScrollViewer. The GridViewNewRow shows up under the horizontal scrollbar. Unfortunately with the current implementation of RadGridView there is no easy way to determine the actual count of an items in RadGridView and position the NewRow exactly after the last GridView and to keep this template synchronized. I hope this is not a show- stopper for you, s that I recommend you to use the default behavior of GridViewNewRow.

Please if you need any further assistance please let me know.

Kind regards,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Edward
Top achievements
Rank 1
answered on 23 Nov 2010, 12:39 PM
Thanks very much for your reply. We got round the issue by not setting the Height of the grid, so that the grid height expands to fit to the data. The NewRow then always remains directly below the last row of the grid.

I'll start another topic for points 3 and 4 above.

Ed
0
Stephen
Top achievements
Rank 2
answered on 11 Feb 2011, 03:17 AM
Hi,

I've been working on a RadGridView and have turned on the ShowNewRow option. We were adding a new record to the bound viewmodel collection then editing it. Switching to using the NewRow is putting the new row at the top of the datagrid. Strangely, if I look at the sample Silverlight apps it creates the NewRow at the bottom. That is the behaviour I'd like but for some reason its putting it at the top. 

I've looked at the default xaml that is being used to for the RadGridView and it looks like it puts it above the Virtualised stack panel. So I'm wondering how the Sample apps put it at the bottom. I can't see any modifications in the code and yet it appears at the bottom. 
I can modify the default ControlTemplate but I wonder why I'm not getting the apparently default behaviour? Is the default to put it at the top or below the contents?

thanks,
Stephen
0
Vanya Pavlova
Telerik team
answered on 15 Feb 2011, 03:16 PM
Hi Michael,

Please let me try to explain how this example works. In the original template of RadGridView you can see the PART_AddNewRow which is attached within a GridViewScrollViewer, which has its own behavior. In this way the GridViewNewRow is shown below the GridViewHeaderRow. The trick to display it to the bottom is just to delete this part from GridViewScrollViewer and to place it outside. In this way you are extracting this part from the original template. 

Greetings,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
michael
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Edward
Top achievements
Rank 1
Stephen
Top achievements
Rank 2
Share this question
or