I want to make the first cell of the new row added to be editable by default. On scrolling the datagrid down to the selected row the first cell is not set to edit mode. If row is visible by default i.e there is no need for scrolling then first cell is made editable.
Following is the code function enterNewRow(event:Object):Void { var newRowIndex = datagrid.dataProvider.length; var model:Object = new Object(); model.date = new Date(); model.amount = 0; model.editable = true; datagrid.addItemAt(newRowIndex, model); _wait = setInterval(this, "focusNewRow", 300); } function focusNewRow():Void { clearInterval(_wait); var newRowIndex = datagrid.dataProvider.length-1; var focusedCellMap = {columnIndex: 0, itemIndex:newRowIndex}; datagrid.vPosition = newRowIndex; datagrid.focusedCell = focusedCellMap; //Override previous focussed cell location. datagrid.setFocus(); datagrid.focusedCell = focusedCellMap; } Pradeep On 6/28/05, Manish Jethani <[EMAIL PROTECTED]> wrote: > On 6/28/05, Clint Modien <[EMAIL PROTECTED]> wrote: > > To calculate the vPosition of a particular row you could use (current > index > > of the row you want to scroll to) * (the height of a row) to be able to > set > > the vPosition of the DataGrid > > Actually, for the DataGrid, the vPosition is the row index (not the > pixel value). > > > > -- > Flexcoders Mailing List > FAQ: > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > > ________________________________ > YAHOO! GROUPS LINKS > > > Visit your group "flexcoders" on the web. > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > ________________________________ > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/