Here’s the code to delete a row in a DataGrid or AdvancedDataGrid. ActionScript is needed for the delete function.

Assuming this is how your XML data looks like

Using "mydataprovider" as dataprovider for the AdvancedDataGrid, the code would look like this.

Every row has an extra column where the delete link is displayed for you to delete a row. The action takes place in the click property of the LinkButton component where we call the deleteRow() function to do the row deletion.

Flex users may get this error message quite a lot of times. That error message can pertain to either a method or a property. The cause? I came upon this problem because I used an inline Item Renderer for a DataGrid Column. I tried to access a variable not within the DataGrid component. This is because your Inline Item Renderer does not know what exists in your main application. Take this sample

This took me awhile to locate a solution. Luckily there is. Using outerDocument to call methods and/or variables will solve the problem. e.g. outerDocument.method_name()

There is no direct way to set a DataGrid column’s header text to, say, change its font type (bold, italic, etc) or even its alignment. You would have to use a bit of CSS and place it within the tag of your MXML file.

For example, to set a header text’s font type to bold and text alignment to center, use the following code below

and then, within the DataGridColumn’s property headerStyleName, assign the .centerbold style to it.

Related Posts Plugin for WordPress, Blogger...