How Can I Define IP Address Field in SharePoint List - sharepoint

I'm creating a list using visual studio 2010, I want the list to contains I-P-Address field which i figured out is not available out of the box, so i guess i need to define that field.
how can i define that field type pro-grammatically?
Edit: I followed the tutorial Here to create Custom Field but when i was adding list from visual studio i tried to change type to Ip Address but i couldnt find it!
thanks in advance.

I don't think this is Visual Studio 2010 you are using. A list wizard like you are showing is not part of VS2010, but rather one of the upcoming features of the new Visual Studio - or you might be using some Add-In. You will most probably not be able to see your custom field type in a dropdown box like that in any case. You can use the regular declerative way to create a list with your fieldtype (or programatically).
In short: Use the declerative way (or programmatic way) to declare your list. VS 11 won't be able to show your custom field type - that would be pretty magic as your field type could do pretty much anything (custom field renderers, validation etc.) - no way you could just "display" that in a wizard.

Related

A minimal code webpart that displays a single picked item from a list

I'm not sure this is possible, but figured I´d give it a shot. First a few pre-requeistes and environment details:
I´m using SharePoint 2010, SharePoint
Designer 2010, VS 2010
I want to create as little code as
possible, preferably, create it all via UI or Designer
use out of the box components as much
as possible
Here is What I want to do:
Have a custom list with custom columns (easy part)
Create a webpart with an edit interface to select a single item from this list
This same webpart when visible would display the contents of this selected item in a given layout
I know I can do this creating a custom web part and code it all from scratch, I guess my main question is, is there a way to do this with less code and more out of the box components in SP2010. If not, I guess I'm left with lots of C# code.
Any tips, or pointers in this direction will be most welcome. Thanks in advance.
I think what you're looking for is the Data Form Web Part.
Unfortunately, I can't find any good tutorials for 2010, but hopefully the steps should be similar to setting it up in 2007.
Thanks all for the update. In the end, i had to create quite a bit of code to get this to work:
created a web part that enumerates
the content type,
creates a light box that has a picker
then stores the ID of the content in a column
Not the easiest way,but the only way I could get it working. Thanks again!

SharePoint 2010 Error when creating list view

I have a custom list definition created via visual studio 2010. I would like to create a calendar view of this list using the web interface. When I attempt to create the view however, I am greeted with a helpful error message of:
Error
Cannot complete this action.
Please try again.
About the problem:
When I attempt to duplicate this error while running Fiddler2, I see a response of 404 Not Found when attempting to access /_vti_bin/owssvr.dll?CS=65001 using the HTTP POST verb.
No errors are logged in the ULS logs.
If I create a new custom list and attempt to reproduce the issue by adding two date columns and creating the calendar view, everything works as expected.
The schema.xml file defining the list is fairly large, with close to 25 fields.
I am using custom templates for the new, edit, and display forms.
I have defined a new custom view showing a subset of the columns in schema.xml
Does anyone know of any "gotchas" or things to look for in my list definition that could be related to this issue at all?
Has anyone encountered this issue before, and know of a way to fix it?
Failing those, what more can I do to debug this?
To avoid overflowing this question with large code blocks, you can view my list definition here:
Elements.xml - http://pastebin.com/97ucAedZ
Schema.xml - http://pastebin.com/2brpMJgT
ListInstance Elements.xml - http://pastebin.com/gnCXVpmh
I agree with moontear. I think your Content Type ID is invalid. If you are building off a Custom List template, I would expect your Content Type ID to be:
<ContentType ID="0x0100781A2C74BF4bfd81AE710DB1EACAE745"
Name="$Resources:Item"
Group="$Resources:List_Content_Types"
Description="$Resources:ItemCTDesc"
Version="1">
To inherit from Item, you should have 0x01 then 00 followed by a Guid. You have the right number of characters, if you use 00 instead of 70.
For more information, see Content Type IDs.
In cases like this, i usually take these steps:
Create List/View manually in MOSS.
Export list as template and try to
find out what is wrong in my
template.
Start with clean template, add one field etc at a time, test, repeat until error emerges.
Your xml seems ok, so i think it will be another MOSS 'gotcha' or 'aha' moment.

How to Update SharePoint feature (List Template Views)

I have a sharepoint 2007 feature that contains a list template, however if I change my schema.xml the change doesnt apply
I tried deactivating and uninstalling the feature so i could install it again but that didn´t work.
Also based on this question:
How to update SharePoint feature?
I tried modifying the Version in the feature and reinstall but that didnt work either
¿How can I accomplish a feature update?
Thanks in advance
EDIT: I found that the only thing that isn't updating is the view element, I mean, if I change the display name it gets updated with the above procedure, but if I change a view it isnt updated
With SharePoint 2007, the "Version" is not really useful.
Your problem is that the list based on your template is already "provisionned" : Is has been created with a certain version of your list template and is not updated when you update your list template. This is "By Design"
I think you have to create a new list based on your list template....
Regards,

Template item in simple SharePoint list

We don't do any SharePoint development, but I was wondering if there's a way in the web UI to create the ability to copy an existing list item as if it were a template.
I don't think there is any way to do that without at least some code or using SharePoint Designer. In code it is fairly simple to do, but I don't think this is what you are asking for.
You could switch to datasheet view and then use copy & paste, but that isn't really a great solution either.
You could use a SharePoint Designer workflow to create duplicates of an item through the WebUI, there is an example of this here.
We have this capability as part of our product. The product is called Smart List Lite, it is free and it also install a new custom field type called Item Copy Field, I think this is what you need
http://www.infowisesolutions.com

Sharepoint form with linked lists

I am new to Sharepoint and I want to make sure I am on the right path.
I am in a highly restricted environment and would rather do this in Visual Studio but am currently in the position where I have to try to get this to work using just the web interface and Sharepoint Designer.
I have created multiple lists that I plan on using in a relational way. I have designed this to mimic a relational database.
I have been able to link these lists for multiple item views and single item views, but need to be able to create items and modify items and so I need to be able to also link these lists and use them in a form.
Is this even possible?
If not, how do I handle updating these items?
Lastly.....
Am I going about this all the wrong way?
Thanks!
Tim
It is possible to do so using visual studio, not sure about SharePoint designer. I've been doing something fairly similar for a client myself however I am able to use visual studio to develop my features and even then it's been a pain.
Part of the issue is that various controls in SharePoint make the assumption about query variables and their meaning to the control (the ListFieldIterator comes to mind on this one). Trying to edit two different list's items on a single page is possible but I don't think it could (or should) be done through the desinger.
Can you get away with two separate forms/pages? If so that makes life much easier where you could do some kind of linking/forwarding between the pages. If you have to have a single page that represents both lists and their many items things get much more difficult. For the later you will almost certainly have to use Visual Studio since you will have to handle quite a bit of the server side logic.
Depends on how restricted you are. If you have access to the server via RDC, you could create these lists bases on a custom schema. All of this can be done using notepad.
A possible solution (that i've heard of but never tried):
a) Create your feature folder, and 2 schema files
b) Get a copy of a basic list schema, engineer it to match your requirements.
c) At the bottom of the schema, you can specify which aspx page is called when i) editing ii) viewing the list. Look at the default out of the box page that is usually referred to, make a copy (customblabla.aspx) and point your list schema to that file (obviously store it along with the out of the box aspx file.
Since you have control over this aspx file, you may able to tweak it do exactly what you want.
Sorry if this doesn't work...

Resources