:: Forum >>

How to place a check box and dropdown in grid control

Any one can help me how to place a checkbox and dropdown in grid.and get the data in dropdown and check box selection for all rows.Alex cold u help me regarding this.
sree
Wednesday, January 10, 2007
http://www.activewidgets.com/grid.howto.selections/selecting-rows-with-checkboxes.html
http://www.activewidgets.com/javascript.forum.17441.2/combo-box-help.html
Alex (ActiveWidgets)
Wednesday, January 10, 2007
Hello Alex,

we have a few issues in getting what we wanted Can you please look into the below code and suggest us where we are being mistaken?
We are trying to get the data dynamically from an SQL server database and using this java script code under an aspx page. we were ablet o populate the data into the grid and were able to make all the cells editable.

What we were unable to get is the check boxes on the first column. The performance is also NOT quote upto the mark. The code under the multi-row-marker page is basically what we want to replicate and get the data dynamically populated data to function the same way.
We want some specific columns to be completely editable. We are currently evaluating the AW version 2.0.1 and hope to get this and a few other (I get into other issues one by one) issues we had completed before we can buy a developer license.

Appreciate your response.

<script src="D:\Local\aw.js"></script>
<link href="D:\Local\aw.css" rel="stylesheet"> </link>
<script>
//strHtml is the sting variable from which we get data from sql sever database dynamically
var myCells = [<%= strHtml%>];

var myHeaders = ["hdr1","hdr2", "hdr3", "hdr4", "hdr5","hdr6"];
var obj = new AW.UI.Grid;
obj.setSize(990,400)
obj.setCellText(myCells);
obj.setHeaderText(myHeaders);
obj.setColumnCount(6);
obj.setRowCount(10);
obj.setCellEditable(true);

obj.onCellDoubleClicked = function(event, column, row)
{
obj.setSelectionMode("single-cell");
obj.setCurrentColumn(column);
};

obj.onCurrentRowChanged = function(index){
obj.setSelectionMode("multi-row-marker");
};

obj.onSelectedRowsChanged = function(arrayOfRowIndices){
window.status = arrayOfRowIndices;
}
document.write(obj);
</script>

Sree
Thursday, January 11, 2007
Alex,
When I change the celldata to static and add the template, it seem to be working... But not sure what I am doing wrong in calling the data, what we have is the check box does NOT show up in the above code..

Could
obj.setCellTemplate(new AW.Templates.Checkbox, 0);

make all the difference ?

Thanks,
Sree
***************************************
<script>
var myHeaders = ["hdr1","hdr2", "hdr3", "hdr4", "hdr5","hdr6"];
var obj = new AW.UI.Grid;

obj.setCellData(function(c, r){return c + "." + r});
obj.setSize(990,400)
obj.setHeaderText(myHeaders);
obj.setColumnCount(6);
obj.setRowCount(10);
obj.setCellEditable(true);

obj.onCellDoubleClicked = function(event, column, row)
{
obj.setSelectionMode("single-cell");
obj.setCurrentColumn(column);
};

obj.setCellTemplate(new AW.Templates.Checkbox, 0);

obj.onCurrentRowChanged = function(index){
obj.setSelectionMode("multi-row-marker");
};

obj.onSelectedRowsChanged = function(arrayOfRowIndices){
window.status = arrayOfRowIndices;
}
document.write(obj);
</script>
Thursday, January 11, 2007
Alex,
When I change the celldata to static and add the template, it seem to be working... But not sure what I am doing wrong in calling the data, what we have is the check box does NOT show up in the above code..

Could
obj.setCellTemplate(new AW.Templates.Checkbox, 0);

make all the difference ? Can you please confirm ?
***************************************
<script>
var myHeaders = ["hdr1","hdr2", "hdr3", "hdr4", "hdr5","hdr6"];
var obj = new AW.UI.Grid;

obj.setCellData(function(c, r){return c + "." + r});
obj.setSize(990,400)
obj.setHeaderText(myHeaders);
obj.setColumnCount(6);
obj.setRowCount(10);
obj.setCellEditable(true);

obj.onCellDoubleClicked = function(event, column, row)
{
obj.setSelectionMode("single-cell");
obj.setCurrentColumn(column);
};

obj.setCellTemplate(new AW.Templates.Checkbox, 0);

obj.onCurrentRowChanged = function(index){
obj.setSelectionMode("multi-row-marker");
};

obj.onSelectedRowsChanged = function(arrayOfRowIndices){
window.status = arrayOfRowIndices;
}
document.write(obj);
</script>
Sree
Thursday, January 11, 2007

This topic is archived.


Back to support forum

Forum search