in a RadGrid for asp.net project I use this script to resize a grid to the sum of width of grid's columns:
<ClientSettings>
<ClientEvents OnGridCreated="GridCreated" />
</ClientSettings>
function GridCreated()
{
//resize radgrid to fit columns
this.MasterTableView.Control.style.width = "";
this.Control.style.width = this.MasterTableView.Control.offsetWidth + "px";
}
The same code does not work in a new RadGrid for asp.net ajax project. I get the js error message:
this.MasterTableView.Control is null or not an object
Must I do the grid resizing differently in radgrid for asp.net ajax?
<ClientSettings>
<ClientEvents OnGridCreated="GridCreated" />
</ClientSettings>
function GridCreated()
{
//resize radgrid to fit columns
this.MasterTableView.Control.style.width = "";
this.Control.style.width = this.MasterTableView.Control.offsetWidth + "px";
}
The same code does not work in a new RadGrid for asp.net ajax project. I get the js error message:
this.MasterTableView.Control is null or not an object
Must I do the grid resizing differently in radgrid for asp.net ajax?