Is it possible to set a DataGrid colum as hyperlink?

Is there a way to display a hyperlink text in an SfDataGrid column so when the user clicks on that cell, the user will be taken to that site on a web browser?

Also, is it possible to set SfDataGrid columns so users can manually resize columns themselves while the program is running?


2 Replies

NY Nirmalkumar Yuvaraj Syncfusion Team August 21, 2023 09:38 AM UTC

Hi Bob,


S.No

Query

Comment

1

Is there a way to convert those strings into a clickable hyperlink

 

Converting text from a DataGridTextColumn to HyperLink text is not feasible. it's possible to load a hypertext within the DataGridTemplateColumn .We've provided the code snippet and sample for your reference.

 

Code snippet:

XAML :

<syncfusion:DataGridTemplateColumn MappingName="UgLink">

    <syncfusion:DataGridTemplateColumn.CellTemplate>

        <DataTemplate>

            <local:HyperlinkLabel Text="User Guide documentation"

                Url="{Binding UgLink}"

                HorizontalOptions="Center"/>

        </DataTemplate>

    </syncfusion:DataGridTemplateColumn.CellTemplate>

</syncfusion:DataGridTemplateColumn>  

 

C#

public class HyperlinkLabel : Label

{

    public static readonly BindableProperty UrlProperty = BindableProperty.Create(nameof(Url), typeof(string), typeof(HyperlinkLabel), null);

 

    public string Url

    {

        get { return (string)GetValue(UrlProperty); }

        set { SetValue(UrlProperty, value); }

    }

 

    public HyperlinkLabel()

    {

        TextDecorations = TextDecorations.Underline;

        TextColor = Colors.Blue;

        GestureRecognizers.Add(new TapGestureRecognizer

        {

            Command = new Command(async () => await Launcher.OpenAsync(Url))

        });

    }

}

 

 

I hope this helps! Please let me know if you have any further questions or if there is anything else I can assist you with.

2

 is there a way to make columns manually resizable so the user can resize each column at runtime based on their needs?

As of now, DataGrid does not have support for ColumnResizing. We have already considered your request as a feature. We will implement this feature in any of our upcoming releases. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We appreciate your patience and understanding until then. You can follow up with the below feedback for further details, 

 

Feedback link :  https://www.syncfusion.com/feedback/46248/provide-support-for-column-resizing-in-maui-datagrid


Regards,

Nirmalkumar


Attachment: SfDataGridSample_cd3e1e33.zip


SD Sethupathy Devarajan Syncfusion Team November 25, 2024 06:22 AM UTC

Hi Bob,
 

We are glad to announce that our Essential Studio 2024 Volume 1 Main Release V 25-1-35 is rolled out and is available for download under the following link.

 

https://www.syncfusion.com/forums/187257/essential-studio-2024-volume-1-main-release-v25-1-35-is-available-for-download

 

Furthermore, we are pleased to inform you that support for the "Column Resizing" feature has been incorporated in our 2024 Volume 1 release. To leverage this enhancement, please update the DataGrid package to version 25.1.35.


For detailed information and documentation on the "Column Resizing" feature, you can refer to our User Guide documentation.

 

UG documentation:  https://help.syncfusion.com/maui/datagrid/column-resizing

 

We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.

 

Regards,

Sethupathy D.


Loader.
Up arrow icon