.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

setting up a default value in a

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

I have a lookup field in one of my lists.  When I have it in a New Item form, I am having troubles setting default value in that dropdown list.

When it's less than 20 items, sharepoint renders it as a regular dropdown list. However, the lookup table has more than 20 items, it gets rendered in some funky thing that is made to resemble a dropdown list.  The issue is that when it's a real html SELECT tag, i can use javascript to set the default selected value.  However, if it gets rendered as that other type of object, I have no idea to set the default/selected value.  How do I do this?  

I can force it to show as a dropdown list using sharepoint Designer, but then when it does the insert, nothing gets inserted.  I have no idea why this occurs. All want is a default value in that form field, but it seems very confusing, with little documentation.

Here is the generated code:

<SharePoint:FormField runat="server" id="ff5{$Pos}" ControlMode="New" FieldName="ItemID" __designer:bind="{ddwrt:DataBind('i',concat('ff5',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@ItemID')}" />
<SharePoint:FieldDescription runat="server" id="ff3description2{$Pos}" FieldName="ItemID" ControlMode="Edit&q

View Complete Post

More Related Resource Links

Setting the default start page in godaddy hosting?


 How do you set the start page with godaddy hosting? I can see no way of doing this! You do not seem to have access to the IIS settings that allow you to change it!

Setting default localization



I ever thought that I can set a default localization if the users one (which is set in the browser) isn't available.

I've implemented my localresource files for localization. The start.aspx.resx contains all texts and elements for German use and the start.aspx.en.resx for English users. When I switch the language in the browser settings from German to English everything works fine and the english text is displayed. But when I switch to an other language which is not German or English, it takes defaulty the german resource files.

I've set

UICulture="auto:en-US" Culture="auto:en-US"

as well, but it didn't assume the .en resource file automatically. (For example when I enter the website and switch the browser language to French or Italian it should take the english resource files.)

Thanks and regards,

Setting Managed MetaData default values on site creation

I am working on a project where the requirement is to have specific document content types.  I have therefore create a site columns feature which creates all my columns, I have a Site Contentypes feature which creates all my content type and I have list templates based on my content types.  I also have created a couple of Site definition features which create specific list instance based on my list template As part of my content types I have created a few Managed Metadata fields which I wanted to set defaults for on the creation of my sites.  I have therefore created a feature which is right at the end of the WebFeatures section in my ONET.xml.  This features enumerates through all lists, looking for specific column names(managed metadata columns) and looks to set these to specific values.  The code to set the default value on the field is: TaxonomyField documentCategoryField = (TaxonomyField)library.Fields["Document Category"]; if (documentCategoryTerm != null) { documentCategoryField.DefaultValue = documentLibraryDefault.ToString(); documentCategoryField.Update();                                                     }                         &n

What lists and what column types allow for setting "column default value settings"

There is a new setting for lists in 2010 called "Column default value settings". What lists does this setting apply to (I think just lists with a base template of Document Library)? And for what column types is it available? It was available on a "Single line of text" column but not a lookup column. Thanks in advance!

RsClientPrint add-on does not hold Default Printer Setting

 The default printer paper size is A4 in user PC but when the print icon is pressed in the report viewer control, the paper size is shown as Letter. Is there any way to capture the correct paper size as per the default printer?   Thanks,

Why do I get default error page desipite setting customErrors mode="Off"?


I could never figure it out -  set  <customErrors mode="Off" /> in all web.config files that exist under Interpub/wwwroot, but still get default error page. Which web.config does SharePoint use?

Setting the default value of one row based on the value entered by the user in another row in the Re

Hello Everybody,
I have designed an InfoPath form where I have 4 columns (Question, Answer, Score, and Comments) in a repeating table. I have added 10 rows in the repeating table by going to Tools --> Default Values. Answer is a radio button with choices of Yes, No and N/A. When a user is filling out the form, is it possible to set the answer of one or more related questions to "N/A" and make them read only (the user shouldn't be allowed to select the answer for these questions) depending upon the answer of another question? Please let me know how to go about doing this.

Thanks in advance for your help!!

Setting textbox background-color changes the default border



I've got a textbox that I'm temporarily applying a class to to give it white text on a white background.  For some reason when I apply that class, the border style changes from the default single, gray, flat border to an inset, 2px, gray border. I messed around with different combinations of styles and colors and it seems as though setting any background-color on the textbox causes the border to change. Where does the default border style come from and why is it changing?

Setting a Default Image for the FileUpload Control





I am trying to find a way of setting a default image(e.g. file path) for the FileUpload control so that a default image can be used if a user did NOT choose to upload an image.




Setting default parameters in dataset-populated pick lists


Visual Studio 2008 with R2 added. At this point I'm only using Preview (undeployed reports).

While I can easily set a parameter when the user has to supply a value for the report parameter, it is not at all clear how to set the defaults (and expect them to work) when setting the Available Values to be populated from a DataSet--with or without multiple values. I have seen the suggestion to use the pick-list dataset as a way to populate the default values list but this does not work.

I understand how to create a query that can accept "all" as an alternative input parameter to return all rows from the product, but shouldn't we be able to selectively choose from the list of valid parameter values by adding them as values in the list of defaults?


William Vaughn
Mentor, Consultant, Trainer, MVP

"Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)"

Please click the Ma

Visual Studio 2008 Default setting


I am creating new website on visual studio 2008 , i am facing following viewing problem.

1. on Default.aspx code

when i am going to drug and drop a table  follwing code sample is auto generate, spaces is replaced by dots but these dots does not effect or display run time i think visual studio default setting is changed. but i had tried to set default setting but no effect  so how can i solve it

....................District Name


Setting default webpart chrome style

Is there anyway to have all webparts in a site default to a certain style...(Title and Border) ? I'm having a hard time finding anything in the onet.xml

Setting a default value for a Unit type parameter


I want to include an optional parameter in a function statement that is of the type Unit. For example:

Public Shared Function NewTable(Optional ByVal TableWidth As Unit) As Table

Optional parameters require a default value, but I cannot figure out how to set a default value for a Unit type. Help! Thanks!

Default ASP.NET Architecture

In providing an architectural approach, some assumptions are made concerning the project goals. These assumptions should be used as a litmus test to determine if the described architecture may be an appropriate fit for your ASP.NET application.

default constructor SelectList




dont have a  default constructor

new SelectList() :(

Setting Screen Resolution



  I am developing a website in asp.net.How can i make my web pages view same in different screen resolutions.I am using 1024*768 resolution

How to change the default page base class?


I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.



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