Here is a simple a quick way to display row number on your gallery
With(
{
_records: DataSource
},
ForAll(
Sequence(CountRows(_records)),
Patch(
Last(
FirstN(_records,Value)),
{rowNo: Value}
)
)
)
C#