MasterGridViewElement Hyperlink

Posted by Community Admin on 04-Aug-2018 14:32

MasterGridViewElement Hyperlink

All Replies

Posted by Community Admin on 22-Aug-2011 00:00

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.

Posted by Community Admin on 24-Aug-2011 00:00

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 >>

Posted by Community Admin on 24-Aug-2011 00:00

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/"
            ;

Posted by Community Admin on 29-Aug-2011 00:00

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 >>

This thread is closed