Click here to Skip to main content
Rate this: bad
good
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
good
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?
  Permalink  
Comments
Member 9837094 at 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
good
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.
  Permalink  
Comments
Member 9837094 at 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 at 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 at 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 at 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 at 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 at 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 at 4-Mar-13 23:21pm
   
If have any solution please guid me..
AnandSharmaUK at 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 at 6-Mar-13 6:22am
   
Thanks for your reply and guidance... I got the answer for this...
Member 9837094 at 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...

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

  Print Answers RSS
0 OriginalGriff 370
1 Gihan Liyanage 338
2 Vinay Mistry 160
3 ChauhanAjay 160
4 syed shanu 125
0 Sergey Alexandrovich Kryukov 9,021
1 OriginalGriff 7,941
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2014
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