We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to disable hyperlink within Syncfusion Grid control

Thread ID:

Created:

Updated:

Platform:

Replies:

103939 Jun 11,2012 06:18 AM UTC Jun 14,2012 11:05 AM UTC WPF 3
loading
Tags: GridControl
Mahendra
Asked On June 11, 2012 06:18 AM UTC

Hi,

I have a hyperlink control inside Syncfusion control and based on certain conditions I want to make it disable. Please do help me to resolve this problem.

Thanks,

SG

 


Rajasekar [Syncfusion]
Replied On June 12, 2012 10:30 AM UTC

Hi Mahendra

 

Thank you for your update.

 

You can achieve your requirement by using the below code snippet,

 

        this.dataGrid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);
        
        void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
        {
            if (e.Style.ColumnIndex==2)
            {
                e.Style.CellType = "Hyperlink";
                
                //you can enable and disable hyperlink cell link by using the Enabled property
                e.Style.Enabled = false;
            }

        }

 

Please let us know if you have any queries.

 

Thanks,

Rajasekar


Mahendra
Replied On June 12, 2012 11:18 AM UTC

Hi,
 
Code snippet which I am using right now:
 
<syncfusion:GridDataVisibleColumn MappingName="State" HeaderText="State" IsReadOnly="True">
                    <syncfusion:GridDataVisibleColumn.CellItemTemplate>
                        <DataTemplate>
                            <TextBlock IsEnabled="{Binding Path=Record.Data.IsEnabled}">     
                                <Hyperlink Command="{Binding Path=DataContext.NavigateToAttachmentCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type syncfusion:GridDataControl}}}"
                                            CommandParameter="{Binding Path=Record.Data.Id}">
                                    <TextBlock Text="{Binding Path=Record.Data.State}"/>
                                </Hyperlink>                               
                            </TextBlock>
                        </DataTemplate>
                    </syncfusion:GridDataVisibleColumn.CellItemTemplate>
                </syncfusion:GridDataVisibleColumn>
 
I have used Enabled property on XAML to enable/disable the hyperlink, but it is not working as expected.
 
Please provide me the solution for the same ASAP.
 
Thanks,
Sunil

Rajasekar [Syncfusion]
Replied On June 14, 2012 11:05 AM UTC

Hi Sunil,

Thank you for your update.

We have tested the reported issue but it is working fine from our side. Could you please check the below sample,

Sample: http://www.syncfusion.com/downloads/Support/DirectTrac/94735/SyncfusionGDC1411922025.zip

Please let us know if you have any queries.

Thanks,
Rajasekar


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;