使用Telerik MVC网格在客户端上调整大小 [英] Resize on client with Telerik MVC grid

查看:52
本文介绍了使用Telerik MVC网格在客户端上调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

是否可以在Telerik MVC Grid的客户端代码中调整列的大小?我试图在JavaScript的onLoad事件中调整网格上的列。如果你能提供一个很棒的例子。我试过这个但它失败了。



Hello all,
Is it possible to resize a column in client code for the Telerik MVC Grid? I am trying to resize a column on the grid in the onLoad event from JavaScript. If you can provide an example that would be great. I have tried this and it failed.

grid.resizeColumn(this.PreferenceValue, grid.columnFromTitle(columnTitle);

推荐答案

hi


http://demos.telerik.com/aspnet-ajax/grid/examples/client/ resizing / defaultcs.aspx [ ^ ]


发现这是开箱即用的。不得不编写我自己的javascript函数来处理它。无法发布代码因为它归我所工作的公司所有。想想我会张贴这个,以便找到这个问题的任何人知道答案。
Found out that this isn't possible out of the box. Had to write my own javascript function to handle it. Can't post the code because it is owned by the company that I work for. Figured I would post that so that any one that finds this questions knows the answer.






我试图调整mvcgrid上的列:



Heres使用mycode:仍然不想调整大小



Hi,

Am trying to resize column on mvcgrid:

Heres mycode used:Still it does not want to resize











@ Html.Grid(Model).Named (GridResizing)。列(列=>

{

columns.Add(c => c.DogName).Titled(Dog Name)。SanitizeEnabled.ToString();

columns.Add(c => c.BreedName).Titled(Breed);

columns.Add(c => c.DogAge).Titled(Age);

columns.Add(c => c.DogOwner).Titled(Owner姓名);

columns.Add(c => c.DogSurname).Titled(Surname);

columns.Add(c => c。 DogColour).Titled(Coulour);

columns.Add(c => c.DogAddress).Titled(Address);



})。WithPaging(10).Sortable(true);



@Html.Grid(Model).Named("GridResizing").Columns(columns =>
{
columns.Add(c => c.DogName).Titled("Dog Name").SanitizeEnabled.ToString();
columns.Add(c => c.BreedName).Titled("Breed");
columns.Add(c => c.DogAge).Titled("Age");
columns.Add(c => c.DogOwner).Titled("Owner Name");
columns.Add(c => c.DogSurname).Titled("Surname");
columns.Add(c => c.DogColour).Titled("Coulour");
columns.Add(c => c.DogAddress).Titled("Address");

}).WithPaging(10).Sortable(true);


















谢谢





Thanks


这篇关于使用Telerik MVC网格在客户端上调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆