.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

Custom Columns - Fill values based on value selected in a lookup column

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :SharePoint


I am working with Sharepoint 2007. I have a list of 130 buildings located in six different cities and three different provinces. I imported this list from an Excel spreadsheet. I also have a document library that contains various files associated with these buildings. I've added a custom column to the document library that contains a lookup field to the name of each building. I also have two additional custom columns that have the city and province. What I would like to accomplish is to have the city and province columns automatically be set based on the name of the building selected, such that these values are taken from the same row of this list as the building name.

Hopefully my question makes sense.

Thank you, James

View Complete Post

More Related Resource Links

Auto populate custom fields with values based on user selected in People Editor



I have a requirement wherein I want to populate the currently logged in user in people editor field of my custom web part and based on the user in people editor field, Also I should be able to select any other user if needed. I need to fill some other custom fields as well. I am able to get this quite easily. But suppose I remove the current logged user's name from people editor and enter some other name and then click on Check Names, then how do I change the custom fields based on the new user ?

    PeopleEditor peNameofFileRequestor = new PeopleEditor();
    TextBox txtPhoneNumber;
    TextBox txtDepartmentName;
    SPContext cnxtCurrent;

    protected override void CreateChildControls()

      cnxtCurrent = SPContext.Current;
      SPUser usrCurrent = cnxtCurrent.Web.CurrentUser;

      peNameofFileRequestor.MultiSelect = false;
      peNameofFileRequestor.SelectionSet = "User";
      peNameofFileRequestor.AutoPostBack = true;

      System.Collections.ArrayList entityArrayList = new System.Collections.ArrayList();
      PickerEntity entity = new PickerEntity();
      entity.Key = usrCurrent.LoginName;
      entity = peNameofFileRequestor.ValidateEntity(entity);

      Hashtable htEntityDa

Calculated column based on other columns in Lookup list selection


.. if that makes any sense.

I have a list with with lookup column to another list. that list has other columns.

I want to add a calculated column on the parent list, that set it's value to column from another list, but based on my selection in the lookup column of the parent.

Possible? presuming the calculated column  gets set when I submit and not interactively? what if edit the data and change my selection?


Configure BDC column to have multiple values selected


How do I Configure BDC column to have multiple values selected and make multiple entities data available in the same column.  Currently it supports only single value for an item.  This requirement is crucial need some solution immediately.

wss2.0 update/delete/hide lookup column that does not display any values


Hi All,

I have a document library that contains a Category column that is a lookup field. This is a default column that is a required field when uploading documents to the document library. The Category column is empty and I am unable to amend, hide, make it not required or delete it.

I have gone to Modify settings and columns -> clicked on the Category field to edit, but there is no option to amend the content or delete it. I am only able to amend the Column name and Description.

Since then, I have amended the column name to eg. Category1 and created a new Category field as a lookup and linked it to the correct list.

The problem I am facing now, is that I cannot hide, delete or make the Category1 (old Category) field NOT required. Either I would like to update the original field to display the correct values or alternately hide, delete or make the column not required.

Please help.

How do you create a custom BDC data field that allows for multiple selected values?

I need help creating a custom data field using the BDC column as a base.  We need to allow for multiple selected values instead of just a single one.  I can't find anything on the net which shows how to do this.

gridview help on each dynamic row solve this show values based on all columns

<asp:GridView style="Z-INDEX: 101; LEFT: 1px; POSITION: absolute; TOP: 183px" id="Gridview1" runat="server" Width="613px" Height="127px" ForeColor="Teal" Font-Size="12pt" Font-Names="Palatino Linotype" Font-Bold="True" Visible="False" BorderColor="Transparent" AutoGenerateColumns="false" CellSpacing="2" GridLines="None" OnRowCreated="Gridview1_RowCreated" SelectedIndex="5" ShowFooter="true" OnRowDataBound="Gridview1_RowDataBound"><Columns>  <asp:TemplateField HeaderText="ItemCode"><ItemTemplate> <asp:DropDownList id="DropDownList1" tabIndex=16 runat="server" AutoPostBack="True" DataValueField=" ItemCode " DataTextField=" ItemCode" ></asp:DropDownList></ItemTemplate></asp:TemplateField>  <asp:TemplateField HeaderText="ItemName"><ItemTemplate> <asp:DropDownList id="DropDownList2" tabIndex=16 runat="server" AutoPostBack="True" DataValueField="ItemName" DataTextField="ItemName" ></asp:DropDownList> </ItemTemplate> </asp:TemplateField>  <asp:TemplateField HeaderText="Category"&

Infopath 2007 Repeating Table - Multiple Value Column Text - Hiding Rows based on Column text values

Infopath 2007 browser based form Full Trust Example: I have a repeating table (FruitChoice) that has multiple columns. Both drop down list point to sharepoint list data sources. Choose your tree ft. drop down list – 6Ft Choose your Department drop down list - 103 This repeating table is conditional on the drop down values. This works great. Trees     Fruit       Cost   Date Ordered    Date Delivery Department 6Ft        Peaches                                                        103 3Ft        Apples                                                          102 3Ft        Peaches         &

Infopath 2007 Repeating Table hide row based on Text values of column

Infopath 2007 browser based form Full Trust Example: I have a repeating table (FruitChoice) that has multiple columns. Both drop down list point to sharepoint list data sources. Choose your tree ft. drop down list – 6Ft Choose your Department drop down list - 103 This repeating table is conditional on the drop down values. This works great. Trees     Fruit       Cost   Date Ordered    Date Delivery Department 6Ft        Peaches                                                        103 3Ft        Apples                                                          102 3Ft        Peaches         &

Lookup columns in a SharePoint Custom list

Hi, I would like to know the maximum lookup columns we can create in a SharePoint Custom list. Thanks and regards, Usha   

restrictions on additional columns available for addition with Lookup column?

Can a choice column be added as an additional field when creating a Lookup column? I was able to do this in the beta version but have been unable to in RTM. The column does not appear in the list of availabe columns to add as additional fields.

Create Lookup Site Column based on External List (SharePoint 2010)


I've got an External List and I want to create a Site Column, which is Lookup to a column in my external list. If I tick any of the columns in 'Add a column to show each of these additional fields' and click OK i get the following error message:

[NullReferenceException: Object reference not set to an instance of an object.]
  Microsoft.SharePoint.SPBusinessDataField.IsInDefaultView() +58
  Microsoft.SharePoint.SPBusinessDataField.CreateSpFieldForBdcType(String bdcName, Boolean hidden, Boolean readOnly, Boolean idField, SPAddFieldOptions op) +809
  Microsoft.SharePoint.SPBusinessDataField.AddNeededSecondaryFields(String wssNames, String[] oldNames, String[] newNames, SPAddFieldOptions op) +315
  Microsoft.SharePoint.SPBusinessDataField.OnAdded(SPAddFieldOptions op) +240
  Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op, Boolean isMigration, Boolean fResetCTCol) +759
  Microsoft.SharePoint.SPFieldCollection.Add(SPField field) +61
  Microsoft.SharePoint.ApplicationPages.FieldNewPage.Save() +513
  Microsoft.SharePoint.ApplicationPages.FieldNewPage.BtnOk_Click(Object sender, EventArgs e) +46
  System.Web.UI.WebControls.Button.OnClick(EventArgs e) +114
  System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +139

Mapping custom values and columns to destination table **Newb question**



I am copying data from one source to destination SQL CE table using the data flow task. I have two extra requirements which I am not sure how to achieve.

1.)  One source column needs to be mapped to two destination columns. In the column mapping dropdown the column name disappears after mapping it to one destination column.

2) some custom values for columns need to be added, which are not present in source. For e.g. a default value for some destination columns which is not present.

Any pointers would be extremely appreciated. Thanks,

Ganesh Ranganathan
[Please mark the post as answer if it answers your question]

Auto Populating SharePoint List Columns based on value in one column

   I have a SharePoint List where I want to auto populate the value of some of the columns from another List based on a field "Title" which is primary & unique....
   I want to auto populate them when clicking "New Item"  and entering data... you put the "Title" value and it should match the Title value from another List and auto-populate some the columns...

   Please any idea would be highly appreciated....

Thanks in advance

Hiding Columns in Matrix (RS 2005) Report Based on Columns' Values



Is there a way to hide automatically columns in a Matrix type raport in RS 2005.  The columns I want to hide have only 'N/A' values in them because there is no data available to populate them.  Here is the example:

  Fall 2010 Fall 2009

Content Type or Lists Lookup Column can't show additional fields which are Choice or lookup columns


I am trying to create some content types, but this also happens when creating new columns in a list.

Ok, here is my setup (which is the most basic way to replicate the issue):

List 1: Department List
Columns: Department Name (Single Line of Text)

List 2: Document Owners
Columns: Document Owner (single line of text), Department (Choice or Lookup from Department List), Email (single line of text), Lookup Field (Calculated).

Content Type: Quality Document
Columns: File Name, Title, Document Owners (Lookup from Document Owners List), Email (pulled in with Document Owner), Then i want to also pull in Department from the Document Owners list.

That is where my problem is.  When i select the Document Owners List as the list to get the information from, there isn't the option under "Add a column to show each of these additional fields" to pull in the Department column.  This occurs if i use a Choice in the Document Owners list, or if i do a lookup from the Department List.

My preferred method of implementing this system would be to have a multi-value lookup field in the Department List for Document Owners so that the Owners are attached to the Department, and if the owners change for the department they also change for the document that is for said department.  But, i run into the same issue that i c

Gridview column based on other columns


I realize this is a simple question.

I have a gridview with 3 columns, price, tax, and total (for example).

  I want the total column to contain price + tax. 

I've set all three columns to be templated, although maybe they don't need to be.  This grid is read-only. 

I'd like to do it in code and not in a Bind, because there are some other calculations I need to do for other columns and it's easier for me to do it in VB. 

Do I do this in pre-render for the label in column 3? If so, how do I access the contents of the other columns in that row? 



Segregating Measure values based on the dimension value into separate columns.


Hi Hopefully you can help me with another problem I'm having.  I'm trying to design a regular SSRS report using a cube as data source here is where I run into difficulties.  This is a financial type report so it has attributes such as Actuals, Forecast,Plan etc.  These attributes reside in a cube in a dimension called "PROCESS".  The measures is of course dollars.  So what I need is to somehow segregate dollars for actuals into one column forecast into another etc etc in my query designer so my dataset has 3-4 distinct dollar columns on which I can build my report. I thought I could accomplish it by using a calculated member functionality but I can't find anything there that will let me filter the values by "PROCESS" dimension.  I've also tried to create separate datasets filtering dollars the way I need them in each however report will not let me have fields that belong to two different datasets.  Any thoughts on how to solve this issue.  Hopefully using GUI instead of MDX editor. 


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