开发者

Telerik MVC Grid - Enable editing clientside

I know this is a rather specific question - but I wasn't able to find any help in the Telerik MVC Grid documentation开发者_C百科.

I was wondering if anyone was aware of a way to trigger a grid into "edit mode" via a client-side event. I was having issues with the toolbar and thought this might be possible through jQuery / JavaScript.

        $('#addName').click(function () {

            var grid = $("#NamesGrid").data("tGrid");

            //Enable Editing here?

            return grid;

        });

I am using server-side binding - so hitting a Controller action wouldn't really be an issue, if I had to do a .post or something like that.

Thanks


After a bit of exploring through source - you can accomplish this by adding the following:

 $('#addName').click(function () 
 {
      window.location = "[ControllerAction]?[NamesGrid]-mode=insert";
 });

Obviously this example was for a grid inside of a popup window - but hopefully this could help others if they ran into similar issues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜