1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / MasterGridViewElement Hyperlink

MasterGridViewElement Hyperlink

4 posts, 0 answered
  1. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    22 Aug 2011
    Link to this post
    Is there a way to add a hyperlink to the MasterGridViewElement Title?

    I managed to insert a hyperlink by wrapping the title like this "<a href="">Title</a>" but then it tells me the resource for the title is invalid.
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    24 Aug 2011
    Link to this post
    Hi Kristian,

    In what part of the site do you insert this? What is the template that you modify?

    Kind regards,
    Lubomir Velkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    24 Aug 2011
    Link to this post
    This is in the DefineBackendContentView class for the Module Definitions

    // Title
                var ctitleTemplateBuilder = new System.Text.StringBuilder();
                ctitleTemplateBuilder.Append(@"<a href=""Sitefinity/Content/MyModule"" class=""sf_binderCommand_filterByTag");
                ctitleTemplateBuilder.Append(@""">MyModuleViewTitle</a>");
                var rfqsGridView = new MasterGridViewElement(backendContentView.ViewsConfig)
                {
                    ViewName = MyModuleDefinitions.BackendListViewName,
                    ViewType = typeof(MasterGridView),
                    AllowPaging = true,
                    DisplayMode = FieldDisplayMode.Read,
                    ItemsPerPage = 50,
                    ResourceClassId = typeof(MyModuleResources).Name,
                    SearchFields = "Title",
                    SortExpression = "Title ASC",
                    Title = ctitleTemplateBuilder.ToString(),
                     
                    WebServiceBaseUrl = "~/Sitefinity/Services/Content/MyModule.svc/"
                };
  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    29 Aug 2011
    Link to this post
    Hi Kristian,

    I believe the Title value is a name of a resource, not the actual string. We changed the way the configuration are defined now - we use FluentApi instead. Here is an example:

    1.var fluentDetailView = fluentContentView
    2.                .AddDetailView(viewName)
    3.                    .SetTitle("EditDocument")
    4.                    .LocalizeUsing<DocumentsResources>()
    5.                    .SetExternalClientScripts(externalScripts)
    6.                    .SetServiceBaseUrl("~/Sitefinity/Services/Content/DocumentService.svc/")
    7.                    .SetAlternativeTitle("CreateItem");

    Here EditDocument is a resource entry in DocumentsResources.

    Greetings,
    Lubomir Velkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

4 posts, 0 answered