-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: rags_rao
Message 4 in Discussion

 datagrid is rendered as html table in the browser. s o u can do almost anything that 
u can do with a html table. i'v never used prev,next in DG. but here's code to  add 
pipe (|) between page numbers(1 | 2 | 3 ...). this may help u. u have for the item 
(<tr>) that is of type ListItemType.Pager. and loop thru its child controls (<td> s) 
and set title attribute of td's    
public void grid_ItemCreated(object sender ,DataGridItemEventArgs e) 
{  
DataGridItem item = e.Item; 
if(item.ItemType!=ListItemType.Pager) return; 
TableCell pager = (TableCell)item.Controls[0];//pager is tr; pager.control[0] is a td 
in which page nos are populated 
for (int i = 0; i < pager.Controls.Count; i ++)//loop thru all the elements in pager 
{ 
Control pagerItem = pager.Controls[i]; 
//Note: every odd item is an &nbsp; ;even items hold page nos ..... current page no is 
a label and other are link buttons 
if(i%2!=0)  
{ 
LiteralControl spacer = pagerItem as LiteralControl; 
spacer.Text += "<span style='color: #cccccc'>|</span>&nbsp;"; 
continue; 
}  
if (pagerItem is LinkButton) 
{ 
LinkButton btnOtherPageNo = (LinkButton)pagerItem; 
btnOtherPageNo.ForeColor=Color.CornflowerBlue;  
btnOtherPageNo.Style["TEXT-DECORATION"]="none"; 
} 
else 
{ 
Label curPageNo = (Label)pagerItem;  
curPageNo.ForeColor=Color.Crimson;  
} 
} 
} regards, Raghunandan R Comm Star,MCAD

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to