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

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

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

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :SharePoint
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?

View Complete Post

More Related Resource Links

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


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?



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

ListItem Dynamic DropDownList based on custom list entries.

I utilized the following solution to get the drop down list on the page and populate it dynamically, but it doesn't save the selected value back to the SPListItem object. Does anyone have a better solution possibly for this? http://geekswithblogs.net/SoYouKnow/archive/2010/01/21/sharepoint-populating-drop-down-list-field-with-data-from-different.aspx

ComboBox Display list does not update if a datasource is a boxed string

I have a combo box databound to a BindingSource bound to a List<Holder> it has Holder.Name as its display value. I also have a text box bound to Holder.Name but if I change the text in the text box it will not change what is displayed in the combo box. Changing selected items and changing back will show the updated text in the text box but will still have the old value displayed in the combo box. How do I make the item in the combo box update? namespace Sandbox_Form { public partial class Form1 : Form { public Form1() { InitializeComponent(); lstBroken = new List<Holder>(); lstBroken.Add(new Holder("test1")); lstBroken.Add(new Holder("test2")); bsBroken = new BindingSource(lstBroken, null); cmbBroken.DataSource = bsBroken; cmbBroken.DisplayMember = "Name"; txtBroken.DataBindings.Add("Text", bsBroken, "Name"); lstWorks = new List<string>(); lstWorks.Add("test3"); lstWorks.Add("test4"); bsWorks = new BindingSource(lstWorks, null); cmbWorks.DataSource = bsWorks; txtWorks.DataBindings.Add("Text", bsWorks, null); } } public class Holder { public Holder(string name) { Name = name; } public string Name { get; set; } } }

how to change the permissions list items using the workflow?

How to change the permissions list items using the workflow? Or how to instull SPDActivities on sharepoint 2010?

How can I get a user list based on a specific profile property.

Hi,I am trying to query a DB and get a list of users based on a specific boolean property stored in the aspnet_profile for that user.I am aware that it wasn't possible a few years ago (http://forums.asp.net/p/988051/1277359.aspx), but was wondering whether that had changed in recent releases, or it was still not possible without trawling through the entire list of users and testing them one by one.  (My DB may become way to big for that.)Thanks in advance for any help.Regards,Ben

set the Report URL property to a specific report dynamically based on the selection in the list.

Hi I want to use  embedding the Report Viewer Web Part in a Web page, and I know we  should set the Report URL property to a specific report. but  is there a way by which we can set the url  dynamically based on the selection of the report  from  the list How can I customize this  feature Any Help on this is appreciated. Thanks

how to add a datasource to a custom list form

hi, is this possible? if i create a new item form in SPD 2007 using custom list form, is it possible to add my own datasource to this new item form and use my own tables?

change focus on controls in sharepoint list newform.aspx

hi all. i have newform.aspx where i hav required fields . when i say ok to enter the values the required field valiedates and shows error messages. but the problem is that the focus where it is suppose to get placed is promting in differnet place. can i change the focus of the controls inside newform.aspx or editform.aspx?jayaraja

How do I change Associated task list in a workflow

Hi, I use Sharepoint Designer 2010. How do I change Associated task list in a workflow that I just made. I didn't see any settings where I could adjust the associated task list! Please help.   Regards, Luka

Change order for list view drop down

I may be overlooking something obvious, but I have not been able to find an easy way to sort the views available in the view drop down for lists.  We're migrating to 2010 from WSS 3.0 and currently, the view drop down is sorted alphabetically.   Help?

Dynamic list item title based on date created & regional settings?

I have a list of things that doesn't *need* a title.  However, because sharepoint uses Title for links, RSS etc  I tried generating a title in an event handler.   This would work great if I wasn't basing it on a date field: public override void ItemAdding(SPItemEventProperties properties) { DateTime dt = Convert.ToDateTime(properties.AfterProperties["TestDate"]); properties.AfterProperties["Title"] = dt.ToShortDateString(); base.ItemAdding(properties); } In testing, this sets the title to "8/9/2010" when I selected 8/10/2010 in the date picker.  I figure this is because of the regional settings of my test user.  I can probably correct the title value for 'test user' but that won't fix 'test user in mongolia' who would still see two different values. So What I would like is to have the Title always display the value MyDate in the uesr's locale.  So the field needs to be dynamic not only at edit/update time, but at display time. Does anybody know if this can be accomplished, and more specifically how?

Updating a list item based on the value of a different list item

Ok, I've searched everywhere and have gotten mixed information about whether this is possible with standard Sharepoint functions.  I new at Sharepoint, but I'm doing this to help out the department which is short of help right now.  Here's what I'm intending to do - We need a small ticketing system to track software requests.  I created a basic list that accomplishes this fine.  I created another list with criteria that software must meet in order to be approved called software evaluations.  I made a "choice" column called approval status in both lists that have the following options: Approved, Pending, Rejected.  I'd like the softwarerequests.approvalstatus to mirror whatever the softwareevaluations.approvalstatus column value is.  I created a workflow using SPD and it's seemingly easy to use.  I attached it to the softwarevaluations list and set the following as the matching criteria: if softwareevaluations.approvalstatus = "approved" then softwarerequests.approvalstatus = "approved". It mentions that the values aren't unique, but I accept anyway.  It doesn't do anything and I'm thinking it might be because it doesn't know what "issue" to reference.    I feel I'm all over the place right now, so it might be easier if someone just asks me what you need to know to help.

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!

dropdown list box with datasource assigned in code but need to also manually add an item?

helloI have some dropdown list boxes that I need to fill with data from a database but I also need the first option to be "Show All"... So I need to combine using a datasource and manually adding an item to the top of the list. I have tried two different ways with no luck:1. with the appendDataboundItems = true, on aspx page, and below code in codebehind://lstClass.Items.Clear();                 //lstClass.Items.Add("Show All");                 lstClass.DataSource = finalQuery.Select(i => i.CategoryClass).Distinct().ToList();lstClass.Items.Clear();lstClass.Items.Add("Show All");lstClass.DataSource = finalQuery.Select(i => i.CategoryClass).Distinct().ToList();2. with appendDataboundItems = false, on aspx page, and below code in codebehind:lstClass.DataSource = finalQuery.Select(i => i.CategoryClass).Distinct().ToList();lstClass.Databind(); lstClass.Insert(0, "Show All"); so what method *should* work when you need to combine a datasource with manually added items?

List Instance based on Asset library

HI Guys, There are three content type associate with Asset library but now i want to create a list instance based on Asset Library but i dont want these three content type i want only the custom content type i have created. I know how to do this in browser interface but i want to do in VS2010. I Know i have to create listinstace item type i did that then i dont know what i have to do in order to hide all out of box content types associate with asset library. Please assist me with thisThanks Ron

Updating an item in one list based on data from another

I thought I understood this fairly well, but it seems that I am missing something.  I have created a change management site that uses a calendar list to mark upcoming changes to our IT systems.  I have also created a second list to track some information about the change items that I don't want to show up on the calendar, such as what the outcome of the change was or if the change process was properly followed.  So I have the calendar list and another list called results.  I know that there needs to be a unique identifier that each list item will have in common, so in the results list I created a column called Change Number.  When a new change item is created in the Change Management calendar a workflow runs that notifies some people that a new change has been submitted, and the last step in that workflow creates a new list item in the results list and sets the Change Number field to be equal to the current item ID field.  That part is working right now.  When I create a new change item I can open the results list and see that there is a new item and it has the proper number in the Change Number field. What isn't working is when I try to take actions in other workflows that use data from both lists.  An example is notifying the creator of the change that it has been approved.  When the list item is changed a workflow starts that
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