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


Post New Web Links

Making foreign key entities not show on List screen

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net
 

Hi,

I have the following db design:

Table: Person

PersonId

LastName

FirstName

:

Table: Student

PersonId references Person table

Grade

School

 

On a list screen of Student, the Person is showing up as a dropdown search criteria.  Is there a way to remove the person search criteria from the List Screen?  I am using Visual Studio 2010.

 

Thanks,

TinaC99




View Complete Post


More Related Resource Links

Is it possible to show the displaying name instead of value in list?

  

Hi,I just created a custom field type to show all the users of the site.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.WebControls;

namespace WSS.CustomContentFields
{
  public class UserFieldControl : BaseFieldControl
  {
    protected DropDownList ddlUsers;
    protected override string DefaultTemplateName
    {
      get
      {
        return "UserFieldWebControl";
      }
    }
    public override object Value
    {
      get
      {
        EnsureChildControls();
        return this.ddlUsers.SelectedValue;
      }
      set
      {
        EnsureChildControls();
        this.ddlUsers.SelectedValue = (string)this.ItemFieldValue;
        
      }
    }
    

    protected override void CreateChildControls()
    {
      if (this.Field == null || this.ControlMode == SPControlMode.Display)
        return;
      base.CreateChildControls();
      this.ddlUsers = (DropDownList)TemplateContainer.FindControl("ddlUsers");
      if (ddlUsers == null)
        throw new Exception("Error: cannot load .ascs file");
      if (!Page.IsPostBack)
      {
        SPSite siteCollection = new SPSite(SPContext.GetContext(System.Web.HttpContext.Current).Site.Url);
        SPWeb site = siteCollection.OpenWeb()

Making an Exchange Distribution List an Approver for a Workflow step

  
I have a client that has an Exchange Distribution List populate by a team of specific stakeholders. They want a workflow that includes the Distribution List as an approver so that everyone in that DL has to approve before it moves on to the executive steering committee. What are the proper steps to making an Exchange DL a approver to a workflow in MOSS?  silly rabbit, tricks are for kids!

How to show list contents in two different sites

  
hello, how can i show list items in a two different sites..if i have a announcement list in my main site how can i show the  contents of the same list in another site ? i know we can use the webpage viewer but its not a good choice i want to show the list as same as it displayed on my source page...thanx

Show total items for GridView in List.aspx or GridViewPager

  
Hi, Is there a solution to show total items in Grid View in List.aspx or GridViewPager Eg. Record: 1 - 20 of 231 

Show value from Lookup List inside a view

  
I've got a Categories list, a Product list with a Category field defined as lookup value. The Product list is used in an OrderLine List. How can i show the category value from the selected Product in the OrderLine view? I tried calculcated columns, but they don't work on lookup columns. Would this be possible by creating a custom FieldType? (without performance problems, i assume there's a reason why calculated values don't work on lookup columns) Thanks Marco

Show and hide items in the list as per permission (depend on the permission)

  

Dear all,

In sharepoint 2010

How I Show and hide items in the list as per permission.

i.e the user can fill the most fields in the list and we need to prevent him to see manager's fields in the same list.

Thanks


Unable to connect to local host service when a splash screen is show before start the services

  
Hi all:


I want to show a splash screen before start the local host services, the host can be open without error, however the client (Form1) is not able to connect to the service. Without the splash screen, every thing work fine. Any idea why ?

Here is the code.



Imports System.ServiceModel


<ServiceContract()> _
Public Interface IHelloWorldService
   <OperationContract()> _
   Function SayHello(ByVal name As String) As String
End Interface

Public Class HelloWorldService
   Implements IHelloWorldService

   Public Function SayHello(ByVal name As String) As String Implements IHelloWorldService.SayHello
      Return String.Format("Hello, {0}", name)
   End Function
End Class

Module Module1
   Private host As ServiceHost
   Private frmSplash As Form

   Sub Main()
      AddHandler AppDomain.CurrentDomain.AssemblyLoad, Addres

How to show list of dates a vehicle wasn't driven.

  

I have a table (ConsecDates) containing 1 field (Date). That table has a listing of consecutive dates for approx 2 years in it.

I have another table containg the Invoices for trucking jobs. This file contains an Invoice date field.

I need to know which dates an individual truck did NOT drive.

Is there any way to draw that information out of the Invoice table ?

 

Thanks in advance

tattoo


Using a list from one site as the lookup (foreign key) on a list on another site

  

The scenario: The site "S1" in site collection "SC1" contains a list "L1". I want to use list "L" in a lookup column "L2.C" in a list "L2" in a site "S2" in another site collection "SC2." Both sites are within my company's internal network.

What's the easiest way to do this? Searches of both TechNet and the Internet failed to help.


Create View in an External List that Gets a Field from Another External Content Type via Foreign Key

  

I currently have two tables in a SQL Server 2k8 database: Locations and Customers

The fields in the Locations table are:

  • LocationName
  • StreetAddress
  • City
  • State
  • ZIP
  • CusotmerID (foreign key joined to Customers table)

The fields in the Customers table are:

  • ID (primary key)
  • CustomerName
  • CurrentBalance

Through SharePoint Designer, I have both tables set up as External Content Types of the same names as the tables and have created External Lists for each External Content Type. All CRUD operations are working perfectly. I added the proper Assocaiation and I've set CustomerName to be the Title of the Customers External Content Type. I can currently use a picker for CustomerID in the Locations List and CustomerName is displayed properly. Also, the default DispForm also correctly displays the CustomerName for any single Location record.

However, I would like to modify the default ReadList so the foreign key (CustomerID) will show the Title field of Customers (CustomerName). However, I am running into trouble finding out how to do this.

Any help with this issue would be greatly appreciated!!

Thanks!


how to make webpart only show top list item?

  
Our office is new to SharePoint (including me!).  On our new SharePoint intranet I want to create a SharePoint Tips list.  I then want to put a WebPart on the home page that only shows the most recent tip added to the list.  I can't figure out anyway to configure that.  Thanks for suggestions.

Column to show count of attachments uploaded for each List item in MOSS 2007

  

We have two requirements:

First, we need a column which shows the count of attachments that are for uploaded each item, the list structure is like below:

No. Of Files Attached Title Category Description Owner

Join Entities in BDC For Business Data Field In List

  

 

I'm having a devil of a time joining two tables for a BDC to be used as a Business Data field in a list. I've seen plently of examples  connecting two tables to use with web parts, however i haven't seen anything about using an association in a list. Before i continue to beat myself up i need to know that this is possible.

 

If that's confusing here's what i'm trying to do.

I have two tables Locations and Region. I need the Region_Name from the region table based on the Location_Id (primary key) from the Location table. Locations is connected to Region by Region_id as a foreign key.

 

Any help would be immensely appreciated.


Basic List Definition steps - cannot get columns to show up in New, Edit, etc.

  

Can someplease explain (since the MSDN docs don't) all the necessary stuff required to make a custom List Definition?  I'm trying to make a List Definition and in the schema.xml I've added some custom columns, as well as existing site columns, and I cannot get anything but the default items (from VS creation itself), like Title, to show up.  Some things I've tried:

1 - Yes, "ShowInNewForm", "ShowInEditForm", and "ShowInDisplayForm" are all set to True

2 - I've tried making an inline Content Type for these new columns (i.e., not a new ContentType element, just inside the Schemal.xml file)

I cannot ever get the custom columns to ever appear on anything other than a View.  Also, how the heck do you hide/get rid of the Title column if you don't need that?

 


data view web part unable to show data from list in subsite

  

Hello all,

In 2007, I never had any issues with doing this. In 2010, I created a web part that looks at the Pages list and pulls a few columns and as long as I am within the site, it works fine. But I need to call information from the Pages list in a subsite and display that information on the parent site default page.

In 2007, I made this work by changing ListID to ListName and DefaultValue="Pages" and then change the WebURL to DefaultValue="/SubsiteName/" then place it anywhere and it found it. Now if I change the ListID to ListName and default value to Pages I get an error that the web part cannot be imported. if I try using the actual ListID and change the WebURL to the subsite, I get an error that the web part is looking for a list that does not exist. This worked so easily in 2007.

Any one able to tell me what's going on? Or have a solution?


Metadata properties set in list item, but don't show up in the DIP.

  

Hi folks,

I'm creating a document programmatically on the server side and using SPFileCollection.Add(...) to create it using the binary contents and a hashtable of the metadata properties.

This works great in SharePoint.  The SharePoint list item picks up the metadata properties and a new document item is created in the library with the proper metadata for all of the fields.  If I view the properties or go to edit the properties in SharePoint, all of the metadata is correct.

However, when I open the document in Word, it seems that none of the managed metadata fields (taxonomy field types) "stick".  The values are only for the managed metadata fields.

In SharePoint, if I change any of the fields and do a save on the list item and then open the document, the taxonomy fields "stick" when I open the document again.

I've opened up the document to view the XML and it seems that the custom properties XML doesn't change from pre-update to post-update.

I've also tried calling SPListItem.SystemUpdate(...) and SPFile.Update(), but this has yielded no results so far. 

So in summary:

  • All fields except for managed metadata fields "stick"
  • All fields show up fine in SharePoint in view and edit mode
  • Managed metadata fields are blank when Word document is open

data view web part unable to show data from list in subsite

  

Hello all,

In 2007, I never had any issues with doing this. In 2010, I created a web part that looks at the Pages list and pulls a few columns and as long as I am within the site, it works fine. But I need to call information from the Pages list in a subsite and display that information on the parent site default page.

In 2007, I made this work by changing ListID to ListName and DefaultValue="Pages" and then change the WebURL to DefaultValue="/SubsiteName/" then place it anywhere and it found it. Now if I change the ListID to ListName and default value to Pages I get an error that the web part cannot be imported. if I try using the actual ListID and change the WebURL to the subsite, I get an error that the web part is looking for a list that does not exist. This worked so easily in 2007.

Any one able to tell me what's going on? Or have a solution?


Categories: 
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