Hi ErkangHui,
the datagrid itself can't generate a serialnumber.
You'll need to add an attribute to the entity you're showing in the datagrid2. Where you can add a serialnumber in that attribute on creation of the new object.
In the string utils of the community commons there is a randomHash function, which you could use to generate the serialnumber, or create your own function.