borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Structure of SQL Statements)Next Topic (Using getdate() from server) New Topic New Poll Post Reply
AndreaVB Forum : Database : SORT MSHflexigrid
Poster Message
Anitha_232
Level: Scholar

Registered: 03-03-2004
Posts: 47

icon SORT MSHflexigrid


Hi Please help me locate whats going wrong here...
Ive an MSHflexigrid (say, flex) filled up with data by setting the flex.datasourse property to a recordset. Also i hav some blank rows after these records
now next part is i am trying to sort it on the doubleclick event  of flex. i expect it to sort in ascending order, based on the column on which i have dblclikd...whatever be the datatype
for this what i have tried doing is use the flex.mousecol property . but it is giving me weird results (evrythg jumpg up and down)!!!
i understand that the rows that will be sorted are flex.row to flex.rowsel. since i am tryg to sort based on a single column at a time,i havnt givn much importance to the colsel property.. can u help me?

Thanx in advance

25-03-2004 at 05:07 AM
View Profile Send Email to User Show All Posts | Quote Reply
BRMC
Level: VB Lord


Registered: 28-11-2003
Posts: 210
icon Re: SORT MSHflexigrid

Hi,
try with



Private Sub MSFlexGrid1_Click()
Dim k
k = Me.MSFlexGrid1.ColSel

dim s
s=me.MSFlexGrid1.TextMatryx(yourrow,k)

'then

select case s

case "your header"
your recordset="SELECT....... ORDER BY yourconnectedfield"

end select


set MSFlexGrid1.datasource=yourrecordset

End Sub



hope this help

bye

____________________________
I don't mind not going to heaven
As long as they've got cigarettes
in hell

25-03-2004 at 11:17 AM
View Profile Send Email to User Show All Posts | Quote Reply
gandalf12
Level: Guest

icon Re: SORT MSHflexigrid

Hi,

I had a similar problem with the MSFlexgrid control, enter the following code in the double click event:

Private Sub MSFlexGrid1_DblClick()
MSFlexGrid1.Sort = 3
End Sub

You can change the type of sort by changing the value as

0 = No sort, 1= Generic Ascending, 2 = Generic Descending,
3 = Numeric Ascending, 4 = Numeric Descending,
5 = String Ascending, case-insensitive,
6 = String Descending, case-insensitive,
7 = String Ascending, case-sensitive,
8 = String Descending, case-sensitive,
9 = Custom; uses the Compare event to compare rows.

Hope that helps   

08-10-2004 at 09:36 PM
| Quote Reply
AndreaVB Forum : Database : SORT MSHflexigrid
Previous Topic (Structure of SQL Statements)Next Topic (Using getdate() from server) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder