This is a migrated thread and some comments may be shown as answers.

Problem with URL values in SPRadGrid webpart

6 Answers 74 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Veteran
Roger asked on 15 Oct 2012, 09:49 PM
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

6 Answers, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
Veteran
answered on 16 Oct 2012, 12:42 PM
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
0
Roger
Top achievements
Rank 1
Veteran
answered on 17 Oct 2012, 10:57 PM
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
0
Tsvetoslav
Telerik team
answered on 18 Oct 2012, 10:35 AM
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.
0
Roger
Top achievements
Rank 1
Veteran
answered on 20 Oct 2012, 07:46 AM
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!
0
Roger
Top achievements
Rank 1
Veteran
answered on 24 Oct 2012, 12:07 PM
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
0
Tsvetoslav
Telerik team
answered on 24 Oct 2012, 04:42 PM
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.
Tags
WebParts for SharePoint
Asked by
Roger
Top achievements
Rank 1
Veteran
Answers by
Roger
Top achievements
Rank 1
Veteran
Tsvetoslav
Telerik team
Share this question
or