bioshock Posted June 12, 2008 at 07:17 PM Report Share #190944 Posted June 12, 2008 at 07:17 PM Boas, o meu problema é seguinte: Sempre que eu crio um novo registo este é adicionado à datagrid, o problema é que esta poem o valor no fim da tabela e eu quero que começe no inicio. Tenho esta linha de código: For i = 0 To totalreg - 1 FileGet(filenum, tabela, i + 1) With tabela Registo.DataGridView1.Item(0, i).Value = .id Registo.DataGridView1.Item(1, i).Value = .name Registo.DataGridView1.Item(2, i).Value = .pass Registo.DataGridView1.Rows.Add() End With Next Se alguém me poder ajudar, agradecia. Cumps e obrigado. Link to comment Share on other sites More sharing options...
vitortomaz Posted June 12, 2008 at 08:17 PM Report Share #190965 Posted June 12, 2008 at 08:17 PM tenta usar o Insert(Int32, DataGridViewRow) Inserts the specified DataGridViewRow into the collection. http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
bioshock Posted June 12, 2008 at 10:56 PM Author Report Share #191002 Posted June 12, 2008 at 10:56 PM tenta usar o Insert(Int32, DataGridViewRow) Inserts the specified DataGridViewRow into the collection. Boas amigo, tentei fazer o que me disseste, mas para além de não saber aonde por isso, esse comando não me dá..obrigado pela ajuda. Link to comment Share on other sites More sharing options...
vitortomaz Posted June 13, 2008 at 01:39 PM Report Share #191067 Posted June 13, 2008 at 01:39 PM Cria uma DataGridViewRow e depois insere-a com o Registo.DataGridView1.Rows.Insert(0,row) o 0 é a posição onde queres inserir... ou seja, no inicio 👍 PS: não testei http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
axt3k Posted July 18, 2008 at 03:46 PM Report Share #200069 Posted July 18, 2008 at 03:46 PM eu uso isto DataGridView1.Rows.Add(Liga1.Tables("OpenSQL2").Rows(i).Item("contador") PS: o i é o numero da linha.. como uso um cotador... tenho o i se keres adicionar so 1 linha usas o (0) www.lsantos.info Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now