By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Sorting a datagrigview

P: n/a
Hi,

I sort my datagridview with : dgWrk.Sort(dgWrk.Columns(3),...
and it works perfect. Now, I want it sorted on 2 columns. How did I do
that ? I've try dgWrk.Sort(dgWrk.Columns(3)+dgWrk.Columns(4)+ ...
but I have an error in the code editor.

Thanks

--
Ami Calmant
Stéphane
Nov 6 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Stéphane Miqueu schrieb:
Hi,

I sort my datagridview with : dgWrk.Sort(dgWrk.Columns(3),...
and it works perfect. Now, I want it sorted on 2 columns. How did I do
that ? I've try dgWrk.Sort(dgWrk.Columns(3)+dgWrk.Columns(4)+ ...
but I have an error in the code editor.
Hi Stéphane,

AFAIK, the '+' operator won't work here and the Sort(...) method can
only get 1 column, no collection. Doesn't it work when you just call
dgWrk.Sort(dgWrk.Columns(3))
dgWrk.Sort(dgWrk.Columns(2)) ?

(Maybe you need a dgWrk.update() call between the .sort())

Nov 6 '06 #2

P: n/a
Norman Chong a présenté l'énoncé suivant :
Hi Stéphane,

AFAIK, the '+' operator won't work here and the Sort(...) method can
only get 1 column, no collection. Doesn't it work when you just call
dgWrk.Sort(dgWrk.Columns(3))
dgWrk.Sort(dgWrk.Columns(2)) ?

(Maybe you need a dgWrk.update() call between the .sort())
Well done Norman, it was just under my nose. I was doing the sorting in
the wrong order : col3 then col4 whereas col4 THEN col3 is doing just
fine.

Thanks !

--
Ami Calmant
Stéphane
Nov 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.