View Full Version : Getting the text value of a DataGrid cell
Hi everyone!
I have a quick question about the DataGrid.
I realize that getSelectedIndex() will return the ID of the row in focus on the grid, but how do I get the text value of a focused cell within the row?
Thanks in advance,
Joe
sandhyanayak
12-16-2004, 11:53 AM
Hi Joe!
Just write this event handler and change the instance of the grid as per ur convienent and see what will dispy it.
myListener.cellPress = function(event)
{
var colName=mcGrd.getColumnAt(event.columnIndex).colum nName
var cellValue=mcGrd.selectedItem[colName]
trace("cellValue: "+cellValue)
};
dwalsh9x
01-06-2005, 03:33 PM
I do it this way, which seems a little more straightforward.
myDataGrid.addEventListener("change", myDataGridChange);
function myDataGridChange(eventObj:Object):Void {
myTextArea.text = myDataGrid.selectedItem.ColumnName;
}
zhier81
01-08-2005, 08:30 AM
dwalsh9x:you don't get the text value of the selected item!
|
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.