Scrolling the grid
I have the grid displaying the way I want, with the following code in my aspx file. THe javascript array is create by server-side code:
<body>
<%
// write the data arrays out. see the codebehind aspx.cs
// for scriptstr initialization.
Response.Write(scriptstr);
%>
<script>
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// set number of rows/columns
obj.setRowProperty("count", myArray.length);
obj.setColumnProperty("count", 5);
// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myArray[i][j]});
obj.setColumnProperty("text", function(i){return myCols[i]});
var alternate = function(){
return this.getProperty("row/order") % 2 ? "threedface" : "white";
}
var row = new Active.Templates.Row;
row.setStyle("background", alternate);
obj.setTemplate("row", row);
document.write(obj);
</script>
</body>
Great. This is from your examples, and works fine. The only problem is, I do not have any scroll bars. How do I place a limiting window around the grid so I get scroll bars?
Thanks
<body>
<%
// write the data arrays out. see the codebehind aspx.cs
// for scriptstr initialization.
Response.Write(scriptstr);
%>
<script>
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// set number of rows/columns
obj.setRowProperty("count", myArray.length);
obj.setColumnProperty("count", 5);
// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myArray[i][j]});
obj.setColumnProperty("text", function(i){return myCols[i]});
var alternate = function(){
return this.getProperty("row/order") % 2 ? "threedface" : "white";
}
var row = new Active.Templates.Row;
row.setStyle("background", alternate);
obj.setTemplate("row", row);
document.write(obj);
</script>
</body>
Great. This is from your examples, and works fine. The only problem is, I do not have any scroll bars. How do I place a limiting window around the grid so I get scroll bars?
Thanks
RichF
September 8,