eduardosuruagy Posted September 18, 2019 Share Posted September 18, 2019 How to delete a column from a stringgrid? Link to comment Share on other sites More sharing options...
Sherzod Posted September 18, 2019 Share Posted September 18, 2019 1 hour ago, eduardosuruagy said: How to delete a column from a stringgrid? Hello, Sorry, can you please explain in more detail? Link to comment Share on other sites More sharing options...
eduardosuruagy Posted September 18, 2019 Author Share Posted September 18, 2019 2 hours ago, Sherzod said: Olá, Desculpe, você pode explicar com mais detalhes? I have a 10 column stringgrid and would like to exclude column 9 for example, can i do this? Try the code below but it has no effect: UniStringGrid1.Columns.Delete (9); Link to comment Share on other sites More sharing options...
eduardosuruagy Posted September 19, 2019 Author Share Posted September 19, 2019 21 hours ago, Sherzod said: Olá, Desculpe, você pode explicar com mais detalhes? Can you help me? Link to comment Share on other sites More sharing options...
fcarvalho4 Posted September 19, 2019 Share Posted September 19, 2019 procedure TMainForm.btn1Click(Sender: TObject); begin UniStringGrid1.BeginUpdate; try UniStringGrid1.Columns.Delete(3); UniStringGrid1.ColCount := UniStringGrid1.ColCount - 1; finally UniStringGrid1.EndUpdate; end; end; Link to comment Share on other sites More sharing options...
fcarvalho4 Posted September 19, 2019 Share Posted September 19, 2019 procedure TMainForm.btn1Click(Sender: TObject); begin UniStringGrid1.BeginUpdate; try UniStringGrid1.Columns.Delete(9); UniStringGrid1.ColCount := UniStringGrid1.ColCount - 1; finally UniStringGrid1.EndUpdate; end; end; Link to comment Share on other sites More sharing options...
eduardosuruagy Posted September 19, 2019 Author Share Posted September 19, 2019 3 minutes ago, fcarvalho4 said: procedure TMainForm.btn1Click(Sender: TObject); begin UniStringGrid1.BeginUpdate; try UniStringGrid1.Columns.Delete(9); UniStringGrid1.ColCount := UniStringGrid1.ColCount - 1; finally UniStringGrid1.EndUpdate; end; end; unfortunately it doesn't work, it always takes the last column Link to comment Share on other sites More sharing options...
Sherzod Posted September 19, 2019 Share Posted September 19, 2019 2 hours ago, eduardosuruagy said: Can you help me? I will check and let you know. Link to comment Share on other sites More sharing options...
fcarvalho4 Posted September 19, 2019 Share Posted September 19, 2019 I confirm! Try to use the UniGStringGrid Temp or an ArrayMatrix. Delete the column and then rewrite stringrid without this column! An example attached! UniStringGrid.zip Link to comment Share on other sites More sharing options...
eduardosuruagy Posted September 19, 2019 Author Share Posted September 19, 2019 6 minutes ago, fcarvalho4 said: Eu confirmo! Tente usar o UniGStringGrid Temp ou um ArrayMatrix. Exclua a coluna e reescreva stringrid sem essa coluna! Um exemplo em anexo! UniStringGrid.zip Link to comment Share on other sites More sharing options...
fcarvalho4 Posted September 20, 2019 Share Posted September 20, 2019 stringGrid.mp4 Link to comment Share on other sites More sharing options...
fcarvalho4 Posted September 20, 2019 Share Posted September 20, 2019 unigui ver 1.90.0.1509! Link to comment Share on other sites More sharing options...
fcarvalho4 Posted September 20, 2019 Share Posted September 20, 2019 Sorry, I uploaded the wrong zip file! UniStringGrid.zip Link to comment Share on other sites More sharing options...
eduardosuruagy Posted September 20, 2019 Author Share Posted September 20, 2019 2 hours ago, fcarvalho4 said: Desculpe, enviei o arquivo zip errado! UniStringGrid.zip Thank you so much for your help, but I don't think This is the correct way to delete a column. Imagine I have to delete 10 columns? I will have to keep copying from one StringGrid to another several times. Thank you anyway!!! Link to comment Share on other sites More sharing options...
eduardosuruagy Posted September 24, 2019 Author Share Posted September 24, 2019 On 19/09/2019 at 13:01, Sherzod said: Vou verificar e lhe aviso. Please can you help me with this question? Link to comment Share on other sites More sharing options...
donlego Posted September 24, 2019 Share Posted September 24, 2019 maybe you can hide the column or set column width to 0 i use this for set the width Grid2.ColWidths[1]:=0; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now