New topic: 

ignore a row in a sorted listbox

<http://forums.realsoftware.com/viewtopic.php?t=41317>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        bigbear          Post subject: ignore a row in a sorted 
listboxPosted: Fri Nov 04, 2011 1:23 pm                         
Joined: Wed Mar 15, 2006 7:32 pm
Posts: 218                I have a listbox full of data that I want to sort. I 
am using the following, which works ok:

Code:  
ListBox1.SortedColumn=1
 ListBox1.Sort 


however, row 0 of my listbox is a header row that I do not want to have sorted 
with the other rows. Is there a way to make it ignore row 0 in the sort?      
_________________
RealBasic 2007 Rev.1 on MacBook Pro 10.6.1
and
RealBasic 2007 Rev.1 on Win XP  
                             Top                timhare          Post subject: 
Re: ignore a row in a sorted listboxPosted: Fri Nov 04, 2011 1:47 pm            
             
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 10382
Location: Portland, OR  USA                Implement the CompareRows event and 
always return -1 when comparing row 0 to anything else.

Code:If row1 = 0 then
  result = -1
  return true
end
if row2 = 0 then 
  result = 1
  return true
end
// otherwise, compare as usual
return false
   
                             Top                DaveS          Post subject: 
Re: ignore a row in a sorted listboxPosted: Fri Nov 04, 2011 4:15 pm            
                     
Joined: Sun Aug 05, 2007 10:46 am
Posts: 3280
Location: San Diego, CA                or use my Listbox Header class as 
detailed in other posts here....      
_________________
Dave Sisemore
MacPro, OSX 10.6.8 RB2011r3
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to