0

How can I get the RowIndex when I add row dynamically or while binding it to DataSource?

Can anybody please suggest?

I am trying to add CustomAttribute in following way

col.Field("Name").HeaderText("Name").Width(90).CustomAttributes(custom => { custom.AddAttribute("name", "'{{ :RowIndex }}'"); }).Add();

TIA Manoj

Manoj Sethi
  • 1,898
  • 8
  • 26
  • 56

1 Answers1

0

Use this below code example for your requirement. Use jquery index for this.

col.Field("Name").HeaderText("Name").CustomAttributes(custom =>
                      {
                          custom.AddAttribute("name", "'{{:#index}}'");
                      }).Add();