Hiding the hyperlink  URL in a DataGrid

Hi All,
    i am new to the development of .net iviews for the Portal.we have a table that consists of the links to the different reports, i am displaying this contents in a Datagrid using hyperlinkcolumn of the grid.when the user clicks on the hyperlinkcolumn a new explorer will open with particular report.here the problem is my manager dont want the url to be appeard at the bottom of browser when user places mouse over that hyperlink column.
  if any one can let me know how to hide the url, that will be very helpful to me.
Thanks,
Regards,
Murali.

Hi Murali,
I've often heard people suggest Microsoft built the DataGrid as a control for use in their demos to promote .NET - it's nice but not terribly useful in its native form. I'd probably have to agree with that point of view.
About the only way you can really achieve what you want is to catch the ItemDataBound event of the DataGrid control and add the relevant JavaScript attributes there. The ItemDataBound event fires as each item within the data source is being bound to the DataGrid, creating the contents of each row in the grid. With this event we're able to modify the HTML output as it's being created for output to the browser.
Note that the ItemCreated event does a similar thing and is fine to use in this scenario, provided you don't want access to the underlying piece of data being bound to the grid, because it's not available at that point. For this reason, I'd suggest you use the ItemDataBound event so if you need to add data-related information in later on (such as changing the status message to a text description of the link that's stored in your data source) you can.
Anyway, here's some sample code (written in VB.NET) that would do the trick; put this in your component's code-behind file:
    ' dgdTest is the name of the DataGrid control; change this to the name of your control.
    Private Sub dgdTest_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles dgdTest.ItemDataBound
        If e.Item.ItemType = ListItemType.Item Or _
            e.Item.ItemType = ListItemType.AlternatingItem Or _
            e.Item.ItemType = ListItemType.SelectedItem Then
            ' For each row that is output, add the onmouseover HTML attribute
            Dim cell As TableCell = e.Item.Cells(0) ' <--- change the index to the appropriate column index for your DataGrid
            If Not (cell Is Nothing) Then
                ' TableCell generated for the row of data exists
                Dim link As HyperLink = CType(cell.Controls(0), HyperLink)
                If Not (link Is Nothing) Then
                    ' HyperLink control added for the HyperlinkColumn exists
                    link.Attributes.Add("onmouseover", "window.status=' '; return true;")
                    link.Attributes.Add("onmouseout", "window.status=''; return true;")
                End If
            End If
        End If
    End Sub
You'll need to set the index on the <i>e.Item.Cells(0)</i> above to the relevant zero-based index of the column that's your HyperlinkColumn; I've used zero here as the first column in the DataGrid.
Note that we also check the Cells and Controls collections are valid objects to avoid a NullReferenceException.
You'll also need to change the name of the DataGrid control in the method declaration to the relevant name of your control.
Having said all this, have you considered other alternatives to the DataGrid? If you're just displaying data and not using the editing, paging or sorting features of the control, I prefer to use the Repeater. It gives you total control of the HTML that's output and would eliminate the need to stuff around with the ItemDataBound event in this scenario.
Hope this helps.
Cheers,
Mal.

Similar Messages

  • Apache: hiding the complete url

    I want that my url is not shown competely when I load an internal page in portal.
    Can anyone help me?
    Thank you

    Thank you Tom for your answer,
    but it's better if I explain my problems with an example:
    - the main page that I want became my portal home page has Url:
    "http://ntoracle.akros.it/servlet/page?_pageid=90&_dad=portal30&_schema=PORTAL30&_mode=3" and I think it doesn't correspond to a real page on my server because it's built dinamically.
    So I have create a new address
    "www.portal.akros.it" and redirect it to the previous address and this functions correctly but the redirection implies that the full "terrible" address is shown.
    I'd like that every internal page shows the short url url "www.portal.akros.it".
    Thank you

  • Insert the hyperlink URL file name underneath all images?

    Hi, I was wondering if I have an image with hyperlink
    attached, if I can use some sort of formatting code or something to
    not only show the picture, but also the name of the URL file
    associated with the picture. For example, my site is
    www.drcelly.com and I have a folder I named “lgtest”
    and within that folder I have all my images in, and also the HTML
    pages that are linked to the images. The page (screen shot below)
    showing all the pictures is titled “lg” so the
    directory to the following page is:
    http://www.drcelly.com/lgtest/lg.html
    screen shot-
    http://img.photobucket.com/albums/v229/mds33200/11.jpg
    As you can see, the selected picture (circled in red) is
    named “tp 1010.gif” and it has a hyperlink attached,
    named “c297.html”. (so if someone was to click that
    image, it would direct you to
    http://www.drcelly.com/lgtest/c297.html)
    Now the thing I need to do is to get the image to shop up
    just as it is now, however underneath the image I need a text
    description titled “c297.html” or even
    “c297”. I have several pages with several hundred
    images on it, and I would prefer to have the computer fill these in
    rather then manually entering each one separate. Does anyone know
    if its possible?
    Here is a sample of how I would like it to look (I manually
    typed the red data in by using a photo editor just to show how I
    would like it to look, my goal is to make it so I dont have to type
    the red data in):
    screen shot-
    http://img.photobucket.com/albums/v229/mds33200/2-3.jpg
    Any help / info would be appreciated! thanks.

    You would need custom javascript or server scripting to do
    this. HTML has
    no such facility.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "mds33200" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi, I was wondering if I have an image with hyperlink
    attached, if I can
    > use
    > some sort of formatting code or something to not only
    show the picture,
    > but
    > also the name of the URL file associated with the
    picture. For example, my
    > site
    > is www.drcelly.com and I have a folder I named ?lgtest?
    and within that
    > folder
    > I have all my images in, and also the HTML pages that
    are linked to the
    > images.
    > The page (screen shot below) showing all the pictures is
    titled ?lg? so
    > the
    > directory to the following page is:
    http://www.drcelly.com/lgtest/lg.html
    >
    > screen shot-
    http://img.photobucket.com/albums/v229/mds33200/11.jpg
    >
    > As you can see, the selected picture (circled in red) is
    named ?tp
    > 1010.gif?
    > and it has a hyperlink attached, named ?c297.html?. (so
    if someone was to
    > click
    > that image, it would direct you to
    >
    http://www.drcelly.com/lgtest/c297.html)
    >
    > Now the thing I need to do is to get the image to shop
    up just as it is
    > now,
    > however underneath the image I need a text description
    titled ?c297.html?
    > or
    > even ?c297?. I have several pages with several hundred
    images on it, and I
    > would prefer to have the computer fill these in rather
    then manually
    > entering
    > each one separate. Does anyone know if its possible?
    >
    >
    > Here is a sample of how I would like it to look (I
    manually typed the red
    > data
    > in by using a photo editor just to show how I would like
    it to look, my
    > goal is
    > to make it so I dont have to type the red data in):
    >
    > screen shot-
    http://img.photobucket.com/albums/v229/mds33200/2-3.jpg
    >
    > Any help / info would be appreciated! thanks.
    >
    >

  • How to represent # in hyperlink URLs

    I have a series of URLs that I want to use in hyperlinks, that all have a hash character in them. The hash character is necessary to load the page properly.
    However, when I enter the URL "as is", the hash becomes %23 in the address bar, and the page does not display correctly.
    The only method that works so far, is to replace the "#" with "&hash;".  This works, but leaves "&hash;" in the url, unchanged.  It also means I have to massage every URL.
    That's not really a problem for my current purposes, but am wondering of there is a way to end up with just # as the final representation in the address bar of the browser.
    What I've tried so far (in the hyperlink url):
    Fails:
    %23
    char(35)
    OK:
    &#35; (becomes &%2335;)
    &hash;
    Any ideas? :-)

    The hyperlink function is fine. It's just that if there is a hash in the resulting hyperlink, then when I click on it, the browser interprets the hash as "%23" and then the page doesn't load properly.
    Might be just that site, and/or just that browser.
    Here's a sample link:
    http://www.nlm.nih.gov/cgi/mesh/2012/MB_cgi?mode=&term=Body+Regions&field=entry# TreeA01
    Safari is my default browser.
    Obviously, if I copy that link into Safari, there's no problem.
    The problem lies in the interface between Numbers sending the link, and Safari interpreting what was sent.

  • Is it possible to change the default URL when creating new hyperlinks?

    I'm currently working to take a 128 page catalog that was created in InDesign for print and turn it into a interactive PDF to post on our companies website. The catalog contains thousands of part numbers and I'd like to link each one to its corresponding stock status page on our website that gives current availability and pricing for any particular customer.
    So say I'm dealing with part number "XXXX". When I go to add the hyperlink the default web address it spits out is " http://XXXX ". Instead of that, would it be possible to change the default to " http://forums.adobe.com/discussion/XXXX/1 ". Obviously I just used this website as an example, but it would save so much time if I could avoid having to type the exact same URL every time.
    Or maybe is there a quicker way to do this other than what I am currently trying?
    Thanks

    I've found some external software applications that will do it, so that leads me to believe its not possible within ID CC.

  • Hi, I'm making hyperlinks. They work for the main page of the webpage, but when I'm trying to redirect the hyperlink to a "sub page" of the webpage it is still going to the main page. (allthough I'm pasting the complete url address)

    Hi, I'm making hyperlinks. They work for the main page of the webpage, but when I'm trying to redirect the hyperlink to a "sub page" of the webpage it is still going to the main page. (allthough I'm pasting the complete url address)

    Hi! first of all, thank you so much for your help.
    I don't know about that panel you are talking about.
    what I do is RIGHT CLICK, INTERACTIVE, NEW HYPERLINK, and a window pops up, where I paste the address (images).
    Where says URL I paste the complete address that the "sub page" gives me.
    Is that correct? (for the main page of the wabepage works correctly)
    thanks!!!

  • Transporting of  the Hyperlink approach with the hardcoded url's

    Hi. VC guru's.
                       We have developed VC models with Hyperlink
    option with the hardcoded url's.
                      when we execute the model we could be able
    to get result. But our concern is
           1) There could be any issues we need to consider before
    we Transporting models with hyperlink option with hard coded url's?
          2) how we transport the Hyperlink approach with the hardcoded url's through the landscape?
          3) As per my understanding , Based on the target system  in the landscape we would have to adjust the hyperlinks. Not sure if the Portal transport system allows us to do that.
              Then in this situation what could we have to do?
                           Please provide your valuable inputs. we are
    waiting for your inputs. Points assured.
                           Thanks and Regards
                            Prabhakar. B

    Hi,
    The same method we used to pass parameters to the 2nd and 3rd i-views (Thread: Hi. Friends. Unable to Pass Parameters in Visual Composer) can be used here to pass parameters to the first i-view, one of which can be the address of the machine which is running the i-view.
    This means that the 1st i-view will have a start point with for example, the field "host_address", which can be stored in a datastore, and then the URL of the button will be dynamically built using this field.
    (for example the formula will be in the form of =datastore@host_address & "/irj/portalu2026")
    Alternatively we can use 2 parameters for the accurate address of the 2nd i-view and of the 3rd i-view.
    Hope this helps.
    Regards.
    Omer.

  • Why doesnt my hyperlink url enable when I click enable hyperlink? i-web either deletes the url or creates a different url

    Every time I create a hyperlink url and then enable it- the url deletes itself or switches to another url- please help ! thanks

    You mean the deletion occurs in the Inspector/Link/Hyperlink pane? Is it a link to an external Page?  Try the following:
    delete the iWeb preference file, com.apple.iWeb.plist, that resides in your Home()/Library/Preferences folder.
    go to your Home()/Library/Caches/com.apple.iWeb folder and delete its contents.
    launch iWeb and try again.
    OT

  • HT204093 I am following the instructions to hyperlink URL to an image in an email, but once I paste the URL, the "ok" button is not highlighted so I cannot complete the task. What is the problem and how do I get around it?

    I am following the instructions to hyperlink URL to an image in an email, but once I paste the URL, the "ok" button is not highlighted so I cannot complete the task. What is the problem and how do I get around it?

    I figured out if I took the http:// off the front of the URL, the "ok" button would highlight, but then link did not work. I tried just linking www.google.com to the image and the link did not work either. What gives?!

  • In Textedit, how do I copy a hyperlink url, but only copy the link location and not the link text?

    Suppose I have a list of hyperlinked internet URL's. I want to extract their Internet addresses -- the link locations --  which are essentially hidden in the link text. Is there any way to select and copy the list of hyperlinks, but only copy the link locations, and not the link text?
    For example, with the links:
    The White House
    Google
    One of my previous posts
    What I really want to copy are: "http://www.whitehouse.gov/", "http://www.google.com/", and "https://discussions.apple.com/thread/2737556".

    I figured out how to do it. First, copy the hyperlinks onto a blank RTF document in TextEdit and save the file.
    Second, open the file from within TextEdit, and make sure that the box "Ignore rich text commands" is checked in the open file dialog box. In the open document, the hyperlinks from my example in my first post will look like this:
    {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
    {\fonttbl\f0\froman\fcharset0 Times-Roman;}
    {\colortbl;\red255\green255\blue255;\red0\green7\blue232;}
    {\info
    {\author Garald P. Weller}
    {\*\copyright Garald P. Weller}}\margl1440\margr1440\vieww20000\viewh14400\viewkind0
    \deftab720
    \pard\pardeftab720\sa240\ql\qnatural
    \f0\fs24 \cf0 \
    \pard\pardeftab720\sa240\ql\qnatural
    {\field{\*\fldinst{HYPERLINK "http://www.whitehouse.gov/"}}{\fldrslt \cf2 \ul \ulc2 The White House}}\
    \pard\pardeftab720\sa240\ql\qnatural
    {\field{\*\fldinst{HYPERLINK "http://www.google.com/"}}{\fldrslt \cf2 \ul \ulc2 Google}}\
    \pard\pardeftab720\sa240\ql\qnatural
    {\field{\*\fldinst{HYPERLINK "https://discussions.apple.com/thread/2737556"}}{\fldrslt \cf2 \ul \ulc2 One of my previous posts}}\
    Third, use the Automator function, "Get URLs From Text," to create a service, which I called "Get URLs From Text," that receives text from any window, gets the URLs, and copies the result to the clipboard:
    Fourth, select the entire page above, and go to TextEdit > Services to activate the "Get URLs" service.
    Fifth, create a new TextEdit document, and paste the result.
    The output is exactly what I wanted, the URLs -- i.e., the link locations -- of the three web pages, without the link text.
    Another utility that will extract URLs is CopyPaste Pro, which has an innate ability to extract Internet addresses from either web pages or text pages.

  • How can I change the default URL in hyperlink inspector

    How can I change the default URL for link to external page in the Hyperlink Inspector?

    You can't change the default url in the inspector.. but an easier way to do it rather than editing the box everytime you need to build a link is to copy the url you want to link to and then highlight the text or image that users will click on and then click enable hyperlink.. when you do that whatever the last url you copied using "command" "C" will automatically be entered into that box and replace "livepage.apple.com"
    It saves alot of time if you are doing alot of links.
    Hope This Helps!

  • I want to change the update colour of any hyperlink URL after I have visited it

    I would like to change the highlight colour that my system applies after I have used any URL address link in the main display text. Currently it is a similar shade of blue to that of the original URL and I would like to change this to, say, red. Google tells me to edit one specific CSS file for making this change in Chrome, but I don't use Chrome!! A Windows Explorer search shows several hundred CSS files on my XP SP3 desktop running Firefox 34. Cana anyone help me please? Thanks in advance.

    ''LezLezLez [[#question-1036803|said]]''
    <blockquote>
    I would like to change the highlight colour that my system applies after I have used any URL address link in the main display text. Currently it is a similar shade of blue to that of the original URL and I would like to change this to, say, red. Google tells me to edit one specific CSS file for making this change in Chrome, but I don't use Chrome!! A Windows Explorer search shows several hundred CSS files on my XP SP3 desktop running Firefox 34. Cana anyone help me please? Thanks in advance.
    </blockquote>
    ''Thanks for your reply = this has worked for me. Regards. LezLezLez.''

  • Hiding the actual hyperlink in Smartform

    Hi,
        I have added the hyperlink in the smartform and it is working fine. The user does not want to see the actual hyperlink and want to see a generic text. In HTML,it is simple and any idea, how it is possible in Smartform?

    Hi
    I have a similar kind of requirement..
    Please could you tell me how did you achieve.
    Thanks
    Sushmitha
    Edited by: Sushmitha S on Nov 6, 2008 3:18 PM

  • How can I view the underlying URL to a hypertext link in text from galley or story mode?

    How can I view the underlying URL to a hypertext link in text from galley or story mode?

    click inside the hyperlink and open Window > Hyperlinks (in InCopy). The link is highlighted there. If you can't see it in the editable field, double-click the highlighted entry and it'll open in a dialog box.
    AM

  • Edit the hyperlink in the alert email (Modify my alert settings, View Issue Tracking)

    is it possible to add the external hyperlink in these emails instead of the internal hyperlink? 
    in example when I get a list tracking email there are hyperlink that get sent out with these tags Modify my alert settings | View Issue Tracking | mobile view  that use the internal url //servername how can I change it to use the external
    address //internetname

    Hi Joe, check out the following links for solutions:
    http://sharepoint.stackexchange.com/questions/13216/how-to-create-custom-email-alert-template-in-sharepoint-2010
    https://social.technet.microsoft.com/forums/sharepoint/en-US/e5ebc5a7-8295-49e4-a817-c31066e1ac3d/customize-the-sharepoint-2010-email-alert
    http://www.alectang.com/blog/archive/2012/05/16/how-to-customise-sharepoint-alert-email-template.aspx
    cameron rautmann

Maybe you are looking for

  • Ipod stolen  can they be found with the serial #

    I had to buy an ipod cause my old one was stolen. Is there anything I can do if some one tries to registerit I am a teacher and use it in class. Please help. I can get a cop to fill out a report

  • Copy pictures to e mail

    When I copy a picture to an e mail, the picture as an attachment changes to a word format.

  • Can someone explain how to resolve the error "Error al intentar cambiar los módulos"?

    I just reinstalled Lightroom 5, but when i run it, it show the message"Error al intentar cambiar los módulos", Does someone know how to fix that? Thanks!

  • Patch Seems Hanged

    Hi, EBS R12 AIX 5.3 DB 10.2.0.2 PROD I am applying patch 10327622 it seems stucked since two hours on worker number four it is showing status running, Rest of the worker on wait status. Suggest me. Thanks

  • Use Of @@PostConstruct JSF

    Hi All Can Any body explain be what is the use of @PostConstruct in JSF . How we can implement it. If any example ....it's better to understand ... With thanks