This content has been marked as final. Show 4 replies
A gridrow can be added to Grid and not Canvas.
I feel you should have taken a different approach like states. however for your current situation you can try this;
private function addSelect():void
///Create Combo (select in your question, if I am right)
var combo:ComboBox = new ComboBox();
//create grid item and add combo to it
var gridItem:GridItem = new GridItem();
//create row and add item to it
var gridRow:GridRow = new GridRow();
//It seems you already have the grid, say its id is grid
This will add the combo to Grid.
I still feel in you current situation there should be a different way to achieve this functionality.
Thanx for ur reply. Actually my requirement is I have to add new row to Grid. What I did is I put the Grid inside of Canvas. ok leavae that one. Once again thanx for ur immediate reply. The u sent is just adding combobox to Grid item. How to add new row to Grid and how to delete selceted row / rows from Grid.
Thanks & Regards,
The code snippet I have sent is basically to add the combo to grid item and then item to row and eventually row to the grid.
Meanwhile the Grid does not have selected row property. You may like to consider dataGrid instead. though there can be work-arounds or sheepish ways to delete the rows from Grid. Important thing here is to identify which row is selected.
For example, if user has chosen some checkbox in a row then you may like to pass the id of the row with the values so that you can delete that row by saying grid.removeChild(rowid)
Thanx for ur suggestions. ok I got some idea on how to add and delete rows to Grid. Anyhow I will get back if I face any problems when I am doing. I am greatful to u.
Thanks & Regards,