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

How to disable GridTemplateColumn link button Client Side?

2 Answers 164 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 27 Mar 2015, 06:09 AM
Hi All,
Just wondering how can I disable Template Column Link button on Client side.
I wanted to change color, change cursor to default, not clickable and wont go to its link.
My code works for other databound column but for this template only through';
is working, all the rest is not applying at all.
Any info would be much appreciated.
Thanks in advance.

ASPX
<telerik:GridTemplateColumn HeaderText="Name" SortExpression="NAME" UniqueName="Name" HeaderTooltip="Name" DataField="NAME" HeaderStyle-Width="25%" ItemStyle-Width="25%" Exportable="true">
   <ItemTemplate>
      <asp:LinkButton id="lnkName" ForeColor="Blue" runat="server" Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "NAME"))%>' CommandName="LAUNCH_NAME" CausesValidation="false"></asp:LinkButton>
   </ItemTemplate>
</telerik:GridTemplateColumn>


JS
function isTaskNA(chk,idx) {
var chkNA = document.getElementById(chk);
var masterTable = $find("<%=GrdMain.ClientID %>").get_masterTableView();
var PN = masterTable.get_dataItems()[idx].get_cell("Name");
var row = masterTable.get_dataItems()[idx].get_element();
   if (chkNA.checked){
   row.style.color = 'gray';
   row.style.textDecoration = 'line-through';
   row.style.fontStyle = 'italic';
   PN.style.ForeColor = 'gray';
   PN.disabled = 'disabled';
   }else {
   row.style.color = 'black';
   row.style.textDecoration = 'none';
   row.style.fontStyle = "normal";
   PN.style.ForeColor = 'blue';
   }
}

2 Answers, 1 is accepted

Sort by
0
RJ
Top achievements
Rank 1
answered on 27 Mar 2015, 06:12 AM
How to remove this. On my first post there was an error so I created another thread and now it doubled.
0
RJ
Top achievements
Rank 1
answered on 30 Mar 2015, 01:34 AM
The other thread has been removed. Anyone has idea or workaround on this issue? Thanks again.
Tags
Grid
Asked by
RJ
Top achievements
Rank 1
Answers by
RJ
Top achievements
Rank 1
Share this question
or