Tried below but still getting the horizontal grid lines drawn for all rows when 
i start scrolling down :(

1.
============================================
override protected function drawHorizontalLine(s:Sprite, rowIndex:int, 
color:uint, y:Number):void { 
     if(indexToItemRenderer(rowIndex) != null) { 
         var myObj:Object = indexToItemRenderer(rowIndex).data; 
         var g:Graphics = s.graphics; 
         if (myObj.name == "John") { 
             g.lineStyle(1, 0x0000ff); 
             g.moveTo(0, y); 
             g.lineTo(width, y); 
         } else { 
             g.lineStyle(1, 0x000000); 
             g.moveTo(0, y); 
             g.lineTo(width, y); 
         } 
     } 
} 
----------------
2.
======================

 override protected function drawRowBackgrounds():void { 
              super.drawRowBackgrounds(); 

             var rowBGs:Sprite = 
Sprite(listContent.getChildByName("rowBGs")); 
             var lineCol:uint = getStyle("horizontalGridLineColor"); 

             if (!rowBGs) 
             { 
                 rowBGs = new FlexSprite(); 
                 rowBGs.mouseEnabled = false; 
                 rowBGs.name = "rowBGs"; 
                 listContent.addChildAt(rowBGs, 0); 
             } 
             var g:Graphics=rowBGs.graphics; 
             var curRow:int = 0; 
             var n:int = listItems.length; 

             while (curRow < n) 
             { 
                 try { 
                     var myObj:Object = listItems[curRow][0].data; 
                     if (myObj.phone == "555-219-2270") { 
                         g.lineStyle(1, 0x00ff00); 
                     } else { 
                         g.lineStyle(1, lineCol); 
                     } 
                     g.moveTo(0,rowInfo[curRow].y+1); 
                     g.lineTo(width,rowInfo[curRow].y+1); 
                 } catch (e:Error) { 
                     trace(e.getStackTrace()); 
                 } 
                 curRow++; 
             } 
             while (rowBGs.numChildren > 0) 
             { 
                 rowBGs.removeChildAt(rowBGs.numChildren - 1); 
             } 
         }
======================================

Please let me know if anybody knows about this asap.. Thanks in advance....


Thanks & Regards,Venkat.




________________________________
From: venkateswarlu naidu <[email protected]>
To: [email protected]; [email protected]
Sent: Tue, 15 December, 2009 9:40:03 PM
Subject: [flexcoders] drawing horizontal line in ADG based on data

  
Hi Guys,

Hope everybody is doing good.
I have a problem in drawing horizontal line in Advanced datagrid based on some 
data of the row (ex: data.label=' XXX').
I tried overriding drawHorizontalLine , it did work but when you start 
scrolling everything gets messed up.

Can anybody help me how to solve this?

Appreciate your help.

Thanks & Regards,
Venkat.

The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo. com/

 


      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/

Reply via email to