後面的按鈕我正在使用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