Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting in FlexGrid

Status
Not open for further replies.

abdullauthan

Programmer
Apr 20, 2000
64
0
0
SA
I'm trying to sort the contents of a FlexGrid as soon I add values to a row in it. But, I want to exclude the first column which I use for Serial No.(1,2,3,...). When I sort it with the flexgrid.Sort method by the second column, it includes the 1st column in the Sort and changes the Serial No. order (ex : 2,1,3,...). Is there any way I can exclude the first column for sorting?
 
abdullauthan,<br><br>I suggest you avoid the problem:<br>Add and sort your rows, leaving column 1 empty.<br>Then number column one when all the adding and sorting is complete.<br><br>&nbsp;<br>&nbsp;<br>&nbsp;
 
Thanks for the reply!<br><br>I'm doing that. But if there is more entries, like 30 or more, rebuilding the serial no (column 0) is taking a while. Is there any way to exclude column 0?
 
each time you add a value to you Grid Sort it <br>&nbsp;MsflxGrid.AddItem &quot;2&quot;<br>&nbsp;MsflxGrid.AddItem &quot;1&quot;<br>&nbsp;MsflxGrid.Sort = 1<br>&nbsp;MsflxGrid.AddItem &quot;3&quot;<br>&nbsp;MsflxGrid.Sort = flexSortGenericAscending<br><br>Constant&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Value <br>flexSortNone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br>flexSortGenericAscending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 <br>flexSortGenericDescending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br>flexSortNumericAscending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3<br>flexSortNumericDescending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4 <br>flexSortStringNoCaseAsending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5<br>flexSortNoCaseDescending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6<br>flexSortStringAscending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7<br>flexSortStringDescending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8<br>flexSortCustom&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top