Display data in a gridview using Items.Add in webforms

0

I am trying to show data that I bring from a database by the property of items.add but it is marking me an error that says:

  

"Items is not a member of gridview."

grilla.Items.Add(New 
ListItem(dtsBanco.Tables("Eventos").Rows(i).Item("vchTipoEvento").ToString, 
dtsBanco.Tables("Eventos").Rows(i).Item("intIDTipoEvento").ToString))

I would like to know if it is possible to show data in this way since I use the same function to show data in dropdown and it works perfectly.

    
asked by Hiram Ramirez 26.10.2018 в 21:40
source

1 answer

0

In the case of a GridView, it is not handled as Items (Elements) but as Rows (rows). Therefore, change Items by Rows.

    
answered by 21.12.2018 в 04:47