.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

Hide edit button on editform based on whether the user is item's creator

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

Hi Everyone


I would like to hide/show the edit button on a list item's edit form based on whether the user is the item's creator.  The reason I want to do this is because SharePoint's out-of-the-box behaviour is such that when a user edits someone else's item, the Access Denied page pops up AFTER the user makes his/her edits and presses ok.


My users want the edit button to be hidden so they don't have to go through the steps of making the edits, press ok, and then find out their access is denied.


I have done some research, and the approach I have arrived at is to create my own edit item user control, which has my own cutom code which checks if the user is the creator, and then hide/show the edit button.  I have 2 questions surrounding this:


1) Can anyone provide some advice or resources on the web which describes how to best implement an edit form user control and then integrate it into SharePoint so that the user control is only used on my particular list, and doesn't affect anything else in the site collection.


2) Can anyone suggest another approach perhaps requires less custom development effort than the custom user control approach?

View Complete Post

More Related Resource Links

How can I change XSL in WSS 3.0 for Search Layout - I need to add a button\link "Edit Item"?

Hi, WSS 3.0 on SQL Server 2008 for Workgroups Does anyone know where the xsl file is to change the Search Layout (NOT MOSS) and/or do you know of any links that are useful? Thanks. John.

I need to hide the print button when user clicks print

using vb.net/asp.net 2005.when the user clicks on a linkbutton I am displaying records from my gridview, popping up a new window so that the user can print the records being displayed in the gridview, dvName is the name of the dive that encloses the gridview and gvName is the name of my gridview.The display and print functionality is working fine but the problem is that I am trying to hide the print button from being printed.  When the user clicks on print then all records (good) and the print button (not good) are being printed, here is the javascript that displays the records and the print button.function printDiv(dvName, gvName) { try{ var sOption="toolbar=no,location=no,directories=yes,menubar=no,"; sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; var countRows = 0; var gridview = document.getElementById(gvName); if(gridview != null) { countRows = gridview.rows.length; if (countRows > 0) { countRows = countRows - 1; } } var sWinHTML = document.getElementById(dvName).innerHTML; var winprint=window.open("","",sOption); winprint.document.open(); winprint.document.write('<html><LINK href=MyStyleSheet.

SharePoint Edit Form Shows Field Tabs over Field Item - How Can I Hide These


I am working with a custom edit form in SharePoint designer and I notice that when the form is displayed it shows the form field title in the column on the left and also in a tab directly above each field in the column on the right.  My question is how do I remove those tabs? IOW I just want to show the form field title on the left and the form field on the right; I don't want those grey tabs above the form field.

Tom Molskow SharePoint Architect - If I solved the issue please propose my reply as the answer - Thanks!

Show/Hide fields on InfoPath based on context User Group Membership

I am reading a book on SharePoint 2010 Development by Wrox and although it is a good book, the InfoPath section is limited. I am Googling to see if I can find anywhere where i can perhaps have this type of functionality to hide and show a specific field based on their Group Membership?
Victor Palma

How to hide the list column based on user login in SharePoint 2007

Hi, I have two different SharePoint group named 'Sales' group and 'HR' group. In a SharePoint list i have 10 columns. out of it i want to display 8 column for 'Sales' group and to show all the column for 'HR' group. I want to do this base on the user login. How can i achieve this?. Am using SharePoint 2007.

EditForm.aspx submit button prompts user to open/save document.


I'm not sure if anyone can help since I'm dealing with a slightly modified Edit Form and a custom work flow, but here it goes.

I am testing a SharePoint 2010 deployment which uses our 2007 production content database. Most of the database attachment process went okay, but I'm seeing something weird now on my EditForms. Whenever a user uploads a document to a particular document library, we send the user to an edit form to collect some meta data for some custom fields. As soon as you click the submit (OK) button, the form prompts you to open/save the file, as if you were trying to open it from the within the library. Once you handle that pop up, the form is then 'dead'. It doesn't redirect you as it should and the submit/cancel buttons no longer work (yet they are active).

Here's where it gets weird(er). If you try to upload a document from within the library itself, no problem. My issue only happens when you get to the upload page via a dataview of the library from a subsite (which is just a filtered dataview with a site specific filter, nothing too crazy). The link takes you to the normal OOB Upload.aspx just as if you were to get there from the document library itself, but for some reason navigating to it from the dataview (even though it takes you to the same page with the same list ID in the query string) the subsequent editform (again, same form

Hide userControl inside the user controls' button Click



I created simple web usercontrol ABC with Yes/No button.In Current pages submit Button Click it popup's ABC user control. ABC user controls Yes button Click it executes some serverside function.But I want to close/hide this user control after the Yes button Click ( like confirm box in javascript).But its not hiding after setting the visible property to false. Is there any way to implement this...


Edit Item takes user to their personal website


I have created a custom edit form for a custom list.  Initially I noticed there was no Edit Link on the Display Form.  I checked the List properties in Sharepoint Designer and noticed that there was no entry in the default edit form.  I set the default for the correct content type (Item).  While the Edit link is now appearing on the Display form, when a user selects the Edit Item from the drop down menu on any view, the user is taken to a completely different page and not the Edit form as expected.

I am using Sharepoint Server 2007 with Sharepoint Designer 2007.

Thanks in advance


helpdesk service requests - how to add edit item button on dispform.aspx using sharepoint designer 2


I have made changes to a service requests list edit form using designer 2007. It gave me an message about this change will move it alway from site definition or something like that. Then the link to the Eidt form lost. Users cannot see the "Edit Item" button on the dispform.aspx. And when right click on the item ->edit item link will bring users to the default.aspx.

Is there a way to put the link back? Or is there a programming way to reslove this issue? any references I can read?

many thanks........

How to let user edit selected gridview columns, not entire row



I've got a gridview I would like to let the user edit a couple of columns.  Seems like everything I'm coming across so far makes the entire row editable.  

Hopefully the solution isn't too complicated.  Can someone point me in the right direction?


show sub item to user



         I have a form where I took 2 dropdownlists. In 1st ddl I displayed all Religions and in 2nd DDL I displayed related castes. When my user filled the form so everything saved it. But when user logged in I unable to show him his choosen caste. Religion I displayed throgh RellgionId. But I don't understand how to do that?


      Can anyone tell me where I am doing mistake?



Insert data based on gridview user value on row.. how to



I have three column comes from database table(Table1) and one column is for entering data for the user let us consider it look like this 

ItemNo ItemName Qty  uservalue

001       A               50       20

002       A               20       5

003       B               50  

004       C               60      10

005       D               40 

006       E               90      15 


If its 300 row from database to gridview it will show 50 record with page navigation..

What i need is i need to insert data in to database table which gridview row has user value..

The output of the another table(Table2) will look like this after insert

ItemNo ItemName   uservalue

001       A                    20

002       A                      5  

Forms based users being prompted for windows authentication login for My Sites photos in user lists

Here's an issue I didn't see coming for our forms based authentication users. 

We have a web application extended to an external url to handle forms based authentication for users outside of our domain. Our setup looks like this...

Internal Users/Windows Authentication - moss.domain.com
External Users/Forms Based - mossext.domain.com
My Site for Internal Users - mysites.domain.com

When our forms based users are accessing user lists, or discussion pages that display user pictures, they are getting a windows authentication login for our internal users (mysites.domain.com) who have populated their my site with personal photo.

How do we fix this? 

Not able to edit user profile in share point


Hi ,

I am new to share point, and not able to edit user profile data in sharepoint2007. I am getting an error "can't edit the property try with user profile services".

I have ran full crawl still getting the same problem. Also let me know how I can fetch data from Active Directory to share point 2007.



listview 3.5 bind dropdownlists edit item template VB.NET


I am trying to do this with many issues of data binding doubling the amount and not setting selectedValue on dropdownlist. I have read some posts and they help but I am missing a crucial piece. My problem is that my dropdownlist is doubling the amount of records for the dropdownlist. Instead of "YES;NO;SELECT A VALUE", I am getting "YES;NO;SELECT A VALUE;YES;NO;YES;NO". My database is correct with the UPDATE part but the rebind after update is failing horribly.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack Then
            If Session("ACTIVETAB").ToString() = Session("SUBCONTRACTSATABNO").ToString() Then
            End If
        End If
    End Sub

    Public Function loadlookups(ByVal id As String, ByVal e As System.Web.UI.WebControls.ListViewItemEventArgs) As DataTable
        Select Case id
            Case "ddlCertReceived"
                dt = GetLookupTable("SubcontractsA", "Sub 1 Cert Received")
                Dim ddlCertReceived As DropDownList = _
                CType(e.Item.FindControl("ddlCertReceived"), DropDownList)
                ddlCertReceived.DataSource = dt
                ddlCertReceived.DataTextField = "lup_text"

How to dynamically hide stock edit/display form?


How can I dynamically hide/show the stock edit or display form of a list item?

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