Click here to Skip to main content
12,896,568 members (55,975 online)
Rate this:
Please Sign up or sign in to vote.
See more: sharepoint2010
Hi i am facing some problem in SharePoint 2010,

Whether it is possible to add a list items at top, (ie)whenever we adding a list item it have to update at the top of the list...

Please share your answers... Thanks in Advance....
Posted 14-Feb-13 21:44pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If I understand your problem correctly, you want to see the latest added item at the top of the list. If that is what you want, you can create a view/edit the default view and sort it DESCENDING on the created date.

If that's not you are looking, can you explain your question bit more please?
Member 9837094 18-Feb-13 23:40pm
Thanks for ur reply... It's not like that... Whenever we adding a list item in the list it will be updated at last row of the list instead of that it have to be update @ first row of the list... It like (Last In First Out in Stack)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

So, If I understand your problem correctly, you have a list of say 10 items with IDs 1 to 10. Now you want to add an item to the list which in turn should replace the values of item at ID=1. Is that what you are looking for ? Which means you are replacing the first item with the latest added entry. Also it means that you will only have 10 items at all times and the total count will not increase in the list as the values will keep replacing.

IS that what you are after? If yes, I have a solution, if NOT, I am sorry. You can try explaining the problem in more details.
Member 9837094 20-Feb-13 22:56pm
Thanks for Spending your valuable Time for reply... You are partially correct... Whenever we adding a list items it have to updated at top of the list... For Example I am trying to add a Student Name on Student List which already having 3 items 1.)John,2.)Tony,3.)Vasanth... After i added the 1 Item(Chandru) the list have to be look like as follows 1.)Chandru, 2.)John, 3.) Tony 4.) Vasanth. Hope Now u Better Understood of my query :)
AnandSharmaUK 21-Feb-13 4:43am
Seems to me like you want to have the last added student at ID=1. If thats the case, you have to do a foreach loop and re-assign the IDs for all the items. So if there are 4 items in the list and you add a new item, replace(update) the item with the newly added value and do the same for all the items. You can use custom workflow or event receiver to achieve this. It doesn't sound the best solution to me but let me know if you want the code for doing this. Hope this helps.
Member 9837094 21-Feb-13 23:20pm
Hi.. Thanks again for ur reply... It will helpful for me... If u have the code part for achieving this means share with me...
AnandSharmaUK 22-Feb-13 5:55am
Sure, I can do that. Can you tell me how do you want to deal with the deletion scenario. What happens when you delete any item, how you going to handle that missed item ID which will be deleted?
Also, it will be good for you to write your business scenario if you want an efficient solution. I still do not understand the need of what you are asking. Thanks.
Member 9837094 25-Feb-13 4:29am
Hi... Thanks for spedning ur valuable time for me.. No need to delete any item from the list... if i try to add one element to the list containing 10 elements it have to be added in the top of the list (ie) as a 1'st Element.. so totally 11 elements, Again i try to add another element it have to be added at the top of the list... Now its totally 12 elements... Hope Now you understand my query... If u have any further doubt i am ready to send screenshots... thanking you...
AnandSharmaUK 25-Feb-13 4:33am
I understand your requirement now, can you also explain WHY do you have such requirement? What are you trying to achieve by implementing this? When you say, you want the latest added item to the top of the list, why is that required in your scenario? Screenshots will be appreciated.
Member 9837094 26-Feb-13 4:00am
Hi anand... I am new to sharepoint my project Manager assigned some basic Tasks to me... It's one of the task... we desining one of the Intranet Portal its come under there... If u have a any solution for this please share it.. Thank u...
Member 9837094 4-Mar-13 23:21pm
If have any solution please guid me..
AnandSharmaUK 5-Mar-13 5:19am
Replacing IDs programatically for items isnt a solution for your problem. IDs are internal numbering for SharePoint items, we can design our view in such a way that we see data how we want to. If you want to see the latest added items on the top, you can sort if on Created Date(Descending) by going into the view. Follow below mentioned steps:
Go to Library settings
Create View > click on Standard View
Select the columns you want to see in the view
In the Sort column, select Created Date in the dropdown and select Descending radio button
Member 9837094 6-Mar-13 6:22am
Thanks for your reply and guidance... I got the answer for this...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100