Problem with URL values in SPRadGrid webpart

7 posts, 0 answers
  1. Roger
    Roger avatar
    17 posts
    Member since:
    Aug 2012

    Posted 15 Oct 2012 Link to this post

    Hello

    Fields of type URL are not shown as normal links (with URL description as display text and URL address as href), but in form of http://www.xxx.com, URL description. When you click on the link, the view item properties window is opening instead of target address.

    How can you control the rendering of URL values in the grid?

    In the normal view of corresponding list in SharePoint the links are shown correctly.

    Thank you and best regards,
    Roger
  2. Roger
    Roger avatar
    17 posts
    Member since:
    Aug 2012

    Posted 16 Oct 2012 Link to this post

    Hello

    I have generated another view for my link list and bound the grid to this new view. Instead of using the field URL (URL with edit menu), I have selected the field URL. This field should be rendered correctly - I think, it's a computed field, which is used for display by corresponding views.

    When using this field, nothing is shown at all!

    Computed and calculated fields are quite common in SharePoint. Is this an issue for SPRadGrid webpart?

    Thanks and cheers,
    Roger

  3. Roger
    Roger avatar
    17 posts
    Member since:
    Aug 2012

    Posted 17 Oct 2012 Link to this post

    Hello

    Using JustDecompile I found the problem.

    It is concerning computed field URLNoMenu, which is used for display of URL fields (without editing functionalities).

    Unfortunately, most of computed fields get hidden. Only fields with following FieldReferences are shown:
    • LinkTitleNoMenu
    • _EditMenuTableStart
    • _EditMenuTableEnd

    These FieldReferences are not available for computed field URLNoMenu.

    This unwanted logic was found in function TrySwitchWithFieldReference.

    Is there nobody, who wants to show normal links in SPRadGrid webpart? Or is there a trick?

    Thanks,
    Roger
  4. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 18 Oct 2012 Link to this post

    Hello Roger,

    You are correct concerning the URL field with description - I can submit this as a bug to our development team, please, let us know if it is all right for you to have a Hyperlink field to be displayed with its description without the link and the link opening whatever url it contains?

    Looking forward to your feedback.

    Regards, Tsvetoslav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Roger
    Roger avatar
    17 posts
    Member since:
    Aug 2012

    Posted 20 Oct 2012 Link to this post

    Hi Tsvetoslav, Hello Computed field URLNoMenu should just show link to target URL - same behavior as in standard views of SharePoint. Question: What is the preferred way to adapt cell values (rendered HTML) dynamically in SPRadGrid depending on its current content or other attributes? I don't want to use any template column, because it should be really dynamic. I have already an extended TelerikSPRadGridWebPart and there is the possibility to attach event handlers to web part or SPRadGrid of web part. Best regards, Roger PS. Sorry, I have created this post with Safari Mobile and it seems that no line breaks are rendered!
  6. Roger
    Roger avatar
    17 posts
    Member since:
    Aug 2012

    Posted 24 Oct 2012 Link to this post

    Hello

    I could solve this issue by injecting following Javascript:
    var hyperlinks = $("tr.rgRow td a, tr.rgAltRow td a");
    if (hyperlinks.length > 0) {
        for (var i=0; i < hyperlinks.length; i++) {
            var hyperlink = hyperlinks[i];
            var lastIndex = hyperlink.innerHTML.lastIndexOf(", ");
            if (lastIndex > -1) {
                hyperlink.innerHTML = hyperlink.innerHTML.substring(lastIndex +2);
            }
        }
    }


    Cheers,
    Roger
  7. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 24 Oct 2012 Link to this post

    Hi Roger,

    Nice to hear you have a solution to this requirement of yours. As for the computed fields - I have received a note from our development team that this task is not that trivial and requires more time. The better display of computed fields will be included in the next Q release depending on time allotted to other development tasks with higher priority. Thanks for the understanding.


    Kind regards,
    Tsvetoslav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top