zedder
11-29-2008, 07:52 PM
is there a code to change the color of a selected cell into a datagrid
the listener here is able to get column index and row index so i have the cell coordinate. I would like to change the color on click.
please help.
var dgListener:Object = new Object();
dgListener.cellPress = function(evt_obj:Object) {
var cell_str:String = "(" + evt_obj.columnIndex + ", " + evt_obj.itemIndex + ")";
// trace("You clicked on the \"" + contact_grd.columnNames[evt_obj.columnIndex] + "\" column.");
trace("You clicked on the \"" + contact_grd.getItemAt(evt_obj.itemIndex).Audio);
contact_grd.getItemAt(evt_obj.itemIndex.Audio).set Style("borderColor",0x336699)
upuser=contact_grd.getItemAt(evt_obj.itemIndex).Us er;
uptool=contact_grd.columnNames[evt_obj.columnIndex];
updateit(); //change the cell color
};
the listener here is able to get column index and row index so i have the cell coordinate. I would like to change the color on click.
please help.
var dgListener:Object = new Object();
dgListener.cellPress = function(evt_obj:Object) {
var cell_str:String = "(" + evt_obj.columnIndex + ", " + evt_obj.itemIndex + ")";
// trace("You clicked on the \"" + contact_grd.columnNames[evt_obj.columnIndex] + "\" column.");
trace("You clicked on the \"" + contact_grd.getItemAt(evt_obj.itemIndex).Audio);
contact_grd.getItemAt(evt_obj.itemIndex.Audio).set Style("borderColor",0x336699)
upuser=contact_grd.getItemAt(evt_obj.itemIndex).Us er;
uptool=contact_grd.columnNames[evt_obj.columnIndex];
updateit(); //change the cell color
};