繁体   English   中英

如何关闭Telerik Radgrid的默认编辑模式?

[英]How do I close default edit mode of Telerik Radgrid?

我使用Telerik Rad Grid。 对于编辑我在下面添加的一条记录

OnEditCommand="Stackoverflow_EditCommand" and in the grid I wrote 

<telerik:GridButtonColumn CommandName="Edit" Text="Edit" CommandArgument="Id">
</telerik:GridButtonColumn>

从asp.net页面,当我单击编辑按钮时,有一些默认文本框以便编辑,但我不想向用户显示它们,我打开一个新窗口并从那里显示文本框。 所以我不想显示默认编辑行,我该如何防止呢?

您可以将其更改为弹出窗口窗体而不是原位编辑窗体。为此,您可以单击rad网格,然后转到属性窗口,找到MasterTableView展开它并找到EditMode,将EditMode更改为PopUp ..运行它,但不要忘记在运行时检查自动生成编辑列..希望它有所帮助。

如果您不想在radgrid中进行内联编辑,这可以正常工作。

<telerik:GridTemplateColumn >  
     <ItemTemplate>
       <img src="image/test.png" onclick="OpenPopup('<%#Eval("Id") %>');"/>
      </ItemTemplate>                     
</telerik:GridTemplateColumn>

现在像这样在javascript中创建像OpenPopup这样的函数

function OpenPopup(id) {

   window.radopen("Popups/Test.aspx?id=" + id, "PopupPage");//here "PopupPage" is id of your rad window
 }

现在您可以通过测试页面中的Request(“id”)获取id。

commandName更改为“编辑”以外的其他名称。 例如,使用“更改”。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM