.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

HyperLinkField Javascript DispEx: clicking link shows Read Only/Edit dialog

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

I have a web part that uses an SPGridView to display the documents that match previously selected criteria.

The user needs to see the 'Read Only / Edit' dialog that is displayed when a document is selected directly from the document library.

My research shows that I need to call the Javascript DispEx function somehow. How do I do this in the HyperLinkField setup? Can I somehow call it in the DataNavigateURLFormatString? This code is my latest attempt (which doesn't work). The 'onclick=' appears in the hyperlink.

 Dim hfTitle As New HyperLinkField()
            hfTitle.DataTextField = "name"
            hfTitle.DataNavigateUrlFields = URL
            hfTitle.DataNavigateUrlFormatString = _
"<a onclick=" & Chr(34) & "return DispEx(this,event,'TRUE','FALSE','FALSE','SharePoint.OpenDocuments.2','0','SharePoint.OpenDocuments',',',','1','1','0','0x7fffffffffffffff')" & _
Chr(34) & "href={0}"

            hfTitle.HeaderText = "Name"

View Complete Post

More Related Resource Links

Customize Read Only/Edit Dialog box

Is there a way to customize the dialog box that comes up when you click on a file to open it?  

The box goes as follows:

You are about to open:
How would you like to open this file?
Read Only

It always defaults to Read Only, but I'd like to default it to Edit. 

Any ideas?  Thanks.

ASP.NET GridView - edit records using JQuery Dialog

There are many ways in which you could modify modular data in Grid View:
1. Inline by making rows editable when u click on Edit
2. By using separate pages for Edit
3. By using popups/dialogs for adding/editing

Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

Read Only / Edit Prompt window


Dear all,

As a default, my SharePoint farms are showing a pop up window from IE asking if users want to open the doc in read only or in edit mode. Is there a way to get rid of this window as chose one of the options for default? Where can I do this?

Thanks in advance.




Moved from WinXP to Win7 - don't see choice to open file in read only or edit mode


I just recently moved from Win XP Pro SP3 to Win 7 32-bit Pro. I am logging into domain X normally. Our Sharepoint 2007 server authenticates only on domain Y. So I start Internet Explorer with "run as different user" and provide my domain Y credentials. All fine. 

In win XP, after I did this, when I click on an Excel file on Sharepoint, I would get a dialog asking if I wanted to check out and edit or open as read only. 

In win7, I don't get that choice. The file simply opens, and I get a bar at the top which allows me to check out the file if I wanted to. 

How can I restore the functionality I used to have, with the dialog for checking out the file before opening it?

DataGridView>Edit Columns> Column Read Only property is unwilling to change

Hello, I am facing the following mystery: When changing the read only property of a column to false and reopening the "edit columns" window, it mysteriously turns back to true. Even when closing the designer and changing it in the designer code, the resulting execution does not allow edit, as well as when re-opening the designer you see true again.             this.numberDataGridViewTextBoxColumn1.DataPropertyName = "Number";             this.numberDataGridViewTextBoxColumn1.HeaderText = "Number";             this.numberDataGridViewTextBoxColumn1.Name = "numberDataGridViewTextBoxColumn1";             this.numberDataGridViewTextBoxColumn1.ReadOnly = true;//False is required We thought it might be related to data binding. rebinding the grid did not help as well. The is no other place in the code where it changes. Please advice, Thanks

"Only their own" allows users to edit, then shows access denied page

I am managing a WSS 3.0 portal.  I have created custom lists where a group has contribute permissions.  Under List Settings|Advanced Settings, when I set Edit Access to "Only their own" or "None", my test users can see the Edit Icon and the Edit Item menu option, and bring up the Edit Form.  When they click "OK", they get the Access Denied page.  My experience in that past is that they should not even been shown the option to edit, and they should get Access Denied if they somehow navigate to the EditForm.aspx page.  I even tested this on a brand new site, with three Links lists, each with different Edit Access Levels (All, None, Only their own).  I added one user with contribute permissions.  He had the same result: He could get all the way to EditForm.aspx, but got "Access Denied" when he submitted his changes.  What can I do to fix this?Christopher W. Douglas

Not always prompted for read-only or EDIT mode, when opening files with IE7, Sharepoint 3.0

Hello Everyone,   We use Sharepoint 3.0 and when I click on a document I get a pop up prompt that asks me whether I want to open the file in READ-ONLY or EDIT mode.   I use a machine with XP Pro that is running IE7.   A user called me today, also running IE7, and when he clicks to open a Sharepoint file he gets a different prompt - a simpler one that just offers OPEN or SAVE.   I don't care that his prompt looks different - the problem is that he is able to open the file, make edits, but then when he closes the file (using Excel) he isn't able to save his changes.   Excel only provides a save-as option for him.   This isn't a permission problem with his ID.   When I login to our Sharepoint 3.0 system as him, with his password (from my machine), I get the usual Read-Only / Edit prompt and when I open a file in EDIT mode I am able to save my changes with no problem.   Any thoughts on this?   Chris

Powerpoint ppsx files open as read only in sharepoint with not option to edit

With Powerpoint 20007 in sharepoint(MOSS 2007) the PPSX files are opening in read only mode with no option to edit to be found. 2nd issue is ppsx files do not open on any persons computer as a show.  Is it possible to change this? How do I change this so I can edit the slides? Current "bad" solution is to save to local drive than upload them over the location  on sharepoint. This post was redirected by moderator from: http://social.answers.microsoft.com/Forums/en-US/pptshare/thread/9674b463-2195-4bbd-a2e7-526b8cfa4491

Client Javascript runs, but then page errors out when clicking on a control that uses postback

Using this script on a button click <script language="javascript"> function printdiv(printpage) { var headstr = "<html><head><title></title></head><body>"; var footstr = "</body>"; var newstr = document.all.item(printpage).innerHTML; var oldstr = document.body.innerHTML; document.body.innerHTML = headstr + newstr + footstr; window.print(); document.body.innerHTML = oldstr; return false; } </script> After it is done, I can't click on my calendar control.  I was hoping to add somethign that would force a refresh in the script, but nothing I do works. Any thoughts?  Thanks! 

Custom Edit form - close modal dialog and navigate to page

Hi, I created one custom edit form for my document library, replaced default save and cancel buttons with input buttons and added the form action to them. Then I set my page as default edit form. When I click edit button, my custom form opens in modal pop up. When I try to save the item by clicking new save button, item gets saved but pop remains as it is. Now, I want the modal pop up to get closed and navigate to page other than the parent page with some parameters after I click save button. How can I achieve this? Thanks!!

Ignore javascript error in modeless dialog

my problem is: 1. in Internet Option, i check Disable script debugging (Internet Explorer) and uncheck Display a notification about every script error 2. in my program, i open a Modeless dialog and have a script error in Modeless dialog my problem is Why i checked Disable script debugging (Internet Explorer) and Display a notification about every script error option, but error message still display? May i ignore javascript error in modeless dialog? thanks for your support!    

Clicking on "Shared Documents" gives link to download instead of opening document library

Hi, I hope someone can help! All of a sudden (I don't know if someone has changed something!), whenever anone clicks on a link to open the "shared documents" document library in a specific site within our sharepoint site, instead of opening the document library, it instead gives a download dialog for a zip "AllItems.aspx" as a zip file. Anyone got any iteas what could have gone wrong and how to correct the issue?   Many thanks for any help!

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.

gridview hyperlinkfield link to point on another page

I have several gridviews on an aspx and each has a hyperlinkfield.  All of them redirect to another page with a single gridview.  I am trying to figure out how to get each hyperlinkfield to redirect to the actual point on the receiving page with the corresponding value. In the sample data below, I need to be able to click on 'def' and open aspx page 2 to the point on the page where 'def' is located.  All values still need to be visible.  Sorry for this sad sample, but I wasn't sure how else to explain.  Can anchors be used in gridviews???  If so, how?  Please advise. aspx page 1: (gridview1) hyperlinkfield1             field2                field3 abc                              f2data1             f3data1 def                               f2data2             f3data2   (gri

Refresh Parent Page List after Edit Item Modal Dialog Save/Close

I am calling the Edit Item URL (EditForm.aspx?ID=x&IsDlg=1) via javascript code to bring up the Edit Item Modal Dialog. This works fine and dandy. But what callbackfunction should I invoke after the Save so that the parent list is refreshed? Is there a better way to do it than call reload on the entire parent frame? It almost looks like there should be a way to refresh just the list. Any help appreciated. Thanks, Jake.

Edit Item Link

Does anyone know if it's possible to create a hyperlink that would be identical to the "Edit Item" button when you're displaying a list item?   I want to get rid of the toolbar all together and just have a hyperlink for editing the current item.  I could just take the address that the Edit Item button leads to, but it goes to the specific Item ID.  I want to make it so that hyperlink changes to the Item ID of the list item that's currently being viewed. Does that make sense?  Any help is appreciated!  
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