.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to change the view of SharePoint List based on field?

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :SharePoint

hi all,

I have different sites in my sharepoint application. in every site i have one list, this list have one field called location. When i open this list in purticular site at the time users  will see only the items where the location filed is equal to the site name.

So please suggest me how we can achieve this?



View Complete Post

More Related Resource Links

Auto-populating a field based on SharePoint Contacts List

Hello! Hopefully a quick question for you gurus :) So, I have two relevant fields in my InfoPath 2007 form: A drop-down list called Contact Name, and a text field called Contact Phone Number.  Contact Name is populated through a SharePoint Contacts List, retrieving their Full Name from that list. What I'd love to have happen is, when the user selects a name from the Contact Name list, have the form auto-populate the Contact Phone Number based on the phone number of the selected name from the SharePoint Contacts List. I tried to set a rule in Contact Name to, when the field is Not Blank, populate the Contact Phone Number with the phone number from the Contacts List, but all that does is populate the field with the top-most phone number, not the one matching the selected name. Any way to do this more accurately, and preferably without custom code? (Client has an explicit requirement to not have any custom code on the form or its associated workflow)   Thank you so much!

How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition

Hi Friends... 
Here i write this Code for Retrieving Data Form SharePoint List to Data Grid view (st_attendance) in Visual Web parts....  But it doesn't work Properly....

SPWeb web = SPContext.Current.Web;
            SPList list = web.Lists["Student Profile"];
                string caml = string.Format(@"<Where><Eq><FieldRef Name='Academic Year' /><Value Type='Text'>{0}</Value></Eq></Where>",DropDownList2.Text );
                SPQuery query = new SPQuery(list.DefaultView);
                query.Query = caml;
                SPListItemCollection items = list.GetItems(query);
                st_attendence.DataSource = items;
                Controls.Add(st_attendence );

How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition

Hello Friends,

I am Srinivas, I want to know the How to retrive the Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition.

Example: I want to retrive Students information from Lists to Grid View based on the Condition(based on 'Academic year' or 'Class' and 'Section'). In Student Status Page Grid view should be show the Student Details in their Status.

please any body help me



How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition


Hello Friends,

     I am Ali, I want to know How to retrive the Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition.

Example: I want to retrive Students information from Lists to Grid View based on the Condition(based on 'Academic year' or 'Class' and 'Section').         In Student Status Page Grid view should be show the Student Details in their Status.

please any body help me



How to retrieve Data from SharePoint List to Data Grid View in Visual WebParts based on the Conditi


Hi Friends..

I am Srinivas Devi

I want to retrieve data from SharePoint List to Data Grid View using Visual Web parts. I want know how to write a LINQ query for retrieve data from Share Point List to Grid View based on two or More Conditions.

Like based on Employee Number, Employee Department etc...

Please Help me Sir..

Thank U Sir..



SharePoint calculated field based on other list values


Hello Everybody!

I have a repeating list that seems like that

List 1

Title    Number


A        10

B        11

A        11

B        9


I need to create a list with a field that contains each different titles from list 1 (A + B) and another column with the sum of the numbers associated with A or B in list 1.

List 2

Title     Number


A         21

B         20


My problem is that I don't know which method using to do that.

Calculated field can only use list field (not external list), infopath can get this but I don't know how to do it.

I wanted to know if someone has an issue other than developing. Because my client doesn't want to pay for a development.

Thank you very much!!!!


Data Form Web Part - Sharepoint Dropdown List as a field in Edit View - Possible?


Hi guys,

I'm building a Sharepoint page with a data form web part that uses custom SELECT and UPDATE statements with an SQL Server connection in order to retrieve and store records of information.

I'm getting along fine, records seem to update how they should etc, but I've ran into a problem with one thing: Sharepoint dropdownlists in 'Edit Template'

So the issue is this: if I replace a textbox field with a dropdown list that is populated with a separate SQL datasource, the dropdown list seems to be unable to show the current value of the field.

E.g. I have a dataview which has a field "FruitID", which I can update just fine by setting the ID value to different numbers. The SQL datasource uses the FruitID to display a list of all available Fruits, (e.g. 1 = Banana, 2 = Apple, 3 = Cherry, etc).

If i open the dataview in editmode, the default value in the dropdown is null, despite the real value of the field being "2", which should show "Apple" in the dropdown.

I can select a fruit and click save, and it will update just fine. But the initial display needs to show the correct value to start with.

Is there a custom binding I should be coding to make this work? I can't configure dropdown <items> on an individual level as they are populated from the SQL server. I can't set "SelectedI

Querying a SharePoint List: Creating a Report Parameter based on a SharePoint List field

I have been struggling with this problem over a week now and am at my wits end.   I have created a RS(2005) report and am currently querying data from a SharePoint List.  If anybody is interested in seeing how I set it up I follow this simply walk through on Code Project.  http://www.codeproject.com/KB/reporting-services/ReportFromSharePoint.aspx.  

I need to create a custom report parameter and reference a field that I have created in my SharePoint list.   When I run the report I would like to 'Filter' the result set with the value selected in the report parameter field.  I have looked anywhere and everywhere and don't know if I am over complicating this problem but I have yet to find a solution. 

Please and Thank you
Software Engineer

how to hide/display controls in NewForm.aspx based on dropdown value in SharePoint list



I have 1 dropdown in my sharepoint list with other columns. If dropdown value equal to 'xyz' i need to display some other controls, otherwise these controls should be hidden.

I know we can achieve this with javascript. If any one can provide code or sample then it will be appreciated. or is there any other alternative methods to do this ........

Thanks & Regards, Neerubee

Video: Field and List Item Validation in SharePoint 2010

SharePoint supports the ability to create Excel-like field validation formulas to validate field data in a list, which greatly reduces the amount of custom code that a developer must create and deploy. (Length: 1:44)

How to read a column of a sharepoint list to a text string field of infopath form?

My infopath form used to read these email addresses from a web service and web.config file. Now i would like to get these user email addresses from a contact list in a sharepoint server. I am trying to do this without writing any codes. Here is what i have done so far: 1. Adding a new "data connection to receive data from SharePoint library or List" where i selected Email Address column of the contact list. 2. I added a new Text Field and define a new rule with "Query using a data connection" defined above. When i try to access the newly created Text field above it always return empty as if the Query attached to it did not executed at all. What did i do wrong? Is there a better way? Thank you in advance for your help.

Read data from BLOB field and write to sharepoint list

Hi, I want to read the data from BLOB field and write it into sharepoint list item. Please provide some pointer to archive above objective.   Thanks in Advance.

Calculated date field displays differently in List View and Data View web parts

In SharePoint GUI I created a simple custom list with a calculated Date/Time field (Due).  The calculation is =[Created]+7.  I'm trying to display this data on a page using a DVWP.  But first, for testing purposes, I also created a second calculated Date/Time (TestCreate) field in my custom list that is simply =[Created]. In the List View from within SharePoint, the dates show as expected (for example): Created = 8/12/2010 3:45 PM Due = 8/19/2010 3:45 PM TestCreate = 8/12/2010 3:45 PM In SharePoint Designer, I added a Data View web part and the above three data elements (each configured to display mm/dd/yyyy hh:mm:ss tt).  I see the time displayed for the example list item as: Created = 8/12/2010 3:45:30 PM Due = 8/19/2010 10:45:00 AM TestCreate = 8/12/2010 10:45:00 AM I've tested a couple scenarios and the calculated fields always display five hours in the past (along with dropping the seconds).  It seems like the DVWP is returning the date in a different time zone (with no seconds).  The lcid is set right (1033).  I didn't see any time zone settings for the DVWP specifically.  I'm basically stuck.  Could someone help me figure this one out. Thanks.

How do you change the datasource for a list based on another? ie a secondary list being a filtered

I'm actually using Sharepoint 2007, but am hoping this forum will help.  We want to be able to create a list based on a filtered view of another list.  I can create a Filtered List in Designer, but evidently this is saved as a query object on the server and not as another list that can be selected when using the basic Sharepoint tools.  In other words, it's only visible when in Designer.  This means that in order to use this for say a lookup column in another list object, I have to modify the datasource tags for the EditForm and NewForm.aspx pages within Designer.  Also, it means that adding a column would constantly require use of Designer.  We need this to be simple as not all those tasked with administrating pages will know how to do this.  I thought it would be easier if I could simply source a secondary list with the filtered list I created in designer.  In other words, make a secondary list source be that of a queried view of a master list.  Then this list could be used with all the simple tools provided.  Is this possible?  If so... how?

scrollbar is not showing for sharepoint list with group by view

Hi, have created a Share point 2007 list having a huge data. I have created a group by view by grouping the data with category. My requirement is to show the data as web part on a page. When i did so, while expanding the group inside the web part, the web part is expanding. I want to keep the height and width of the web part fixed so that the layout of the page will not be ugly looking. But though I am putting the option for fixed height and width in the web part setting but I am not able to see the scroll bars. Where as I can see the height and width are fixed but could see a few data instead of all the data with scroll bar.   Please advice me if there is any solution or workaround.Deeptyranjan

Cannot access parent site list from subsite in XSLt List View webpart in sharepoint designer 2010

Hi    We are using sharepoint 2010  for internet facing sites for our big client in healthcare domain .  I am using XSLT list view webpart in sharepoint designer 2010 for retrieving contents from sharepoint list & displaying it by using XSLT List view webpart in publishing sites. We are having lot of list in rootsite collection, If i am creating pages by using XSLt list view webpart in root site collection I can access the list,View and Display in Pages by XSLT List view webpart. Now the requirement is i have to access the list in roosite collection(parent site) from subsites.  In Sharepoint designer 2010, while i am inserting XSLT list view webpart, i could not find datasource to access the list that exist in rootsite collection(Parent site) from subsite. Below is the the code i am using for accessing the list& view from parent site & creating the pages in parent site by using xslt list view webpart,now i wants to access parent site list from subsite by using XSLT list view webpat in subsite pages.  Pls let me know what i have to change in the code level <WebPartPages:XsltListViewWebPart runat="server" Description="The list for the conditions details" ListDisplayName="" PartOrder="2" Default="FALSE" HelpLink="" AllowRemove="True" IsVisible="True" All

How do I get the Sharepoint 2007 KPI to use the "Calculation using all list items in the view"

I have a custom SP list that contains a numeric column in the list and the view selected for the KPI. The option to calculate using all items in the view is grayed out.  Sometimes SP will let me create a KPI like this, then I go back to the webpart and the indicator has reverted back to just a simple count of the number of items in the list.  I want to use the "calculate all items" from a numeric column and have my KPI stay that way? Any thoughts?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend