后面的按钮我正在使用webforms。我首先学习了MVC。我有一个Telerik RadGrid,里面有一个MasterTableView,然后在这个MasterTableView中有几列。我想简单地禁用代码背后的一些按钮,但Visual Studio一直告诉我这些按钮不存在。在Google搜索中,我发现原因是因为这些按钮位于RadGrid内部。但是我没有找到任何访问它们的例子。Webforms:如何禁用Telerik RadGrid中的代码位于
的按钮是radgrid控件内,他们看起来是这样的:
<telerik:GridTemplateColumn HeaderStyle-Width="72px" HeaderText="Acciones" >
<ItemTemplate >
<div style="width: 100px">
<span style="position:relative;" class="grid-buttonColor1">
<i class="material-icons">create</i>
<asp:Button ID="btnEditReportDetail"
CommandArgument='<%# Item.ReportDetailId %>'
OnClick="btnReportDetail_Click"
runat="server"
Style="position:absolute; opacity:0; top:0; left:0; width:100%; height:100%;"
type="button"
causesvalidation="false" />
</span>
<span style="position: relative;" class="grid-buttonColor2">
<button
type="button"
style="background-color: transparent; border: none; padding: 0"
data-toggle="modal"
data-target="#MessageBoxModal"
onclick="ShowMessageBoxWithMessage_<%= ucMessagebox.ClientID%>('Confirmación', '¿Está seguro que desea eliminar la tarea?','DeleteTaskReports','<%# Item.ReportDetailId.ToString() %>')">
<i class="material-icons prefix">delete</i>
</button>
</span>
</div>
</ItemTemplate>
</telerik:GridTemplateColumn>
如何访问,以便在写代码背后的东西像那些按钮:buttonName.Enabled = false;
请!这真让我抓狂!
谢谢你们!
网格是否有服务器端数据绑定事件?如果是的话,我想你可以访问那里的按钮。只是一个狂野的猜测 – Etienne