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

New Message on BDOTNET

-----------------------------------------------------------
From: UnusualTonyMathew
Message 1 in Discussion

Hai,
I am Dynamically adding a Linkbutton to the Pager of a Datagrid. like this
private void golfsearchgrid_ItemCreated(object sender, 
System.Web.UI.WebControls.DataGridItemEventArgs e)
                {
                        
                        ListItemType itemType = e.Item.ItemType; 
                        
                        // Is it the pager? 
                        if (itemType == ListItemType.Pager) 
                        { 
                                // Extract the Pager 
                                TableCell pager = (TableCell)e.Item.Controls[0]; 

                                //Add Cell to Row to Hold Row Count Label 
                                TableCell newcell = new TableCell(); 
                                newcell.ColumnSpan = 1; 
                                newcell.HorizontalAlign = HorizontalAlign.Left; 
                                newcell.Style["border-color"] = 
pager.Style["border-color"]; //For a Seamless Look 

                                //Add Label Indicating Row Count 
                                LinkButton feature = new LinkButton(); 
                                feature.ID = "featureid"; 
                                newcell.Controls.Add(feature); 

                                //Add Table Cell to Pager 
                                e.Item.Controls.AddAt(0, newcell); 

                                //Subtract from Colspan of Original Pager to Account 
for New Row 
                                pager.ColumnSpan = pager.ColumnSpan - 1; 
                        }

                        
                }
private void golfsearchgrid_PreRender(object sender, System.EventArgs e)
                {
                        try 
                        { 
                                
((LinkButton)golfsearchgrid.Controls[0].Controls[0].FindControl("featureid")).Text = 
"Featured"; 
                                
((LinkButton)golfsearchgrid.Controls[0].Controls[golfsearchgrid.Controls[0].Controls.Count
 - 1].FindControl("featureid")).Text = "Featured"; 
                        } 
                        catch 
                        {} 


                }

the hyperlink gets added to the Pager successfully but, Page numbers goes out of the 
Datagrid Tabele. Please see the attached screen shot.
how did this happen?..can anyone Help me out with this?..
Thanx in Advance.
Tony


View Attachment(s):
http://groups.msn.com/BDOTNET/_notifications.msnw?type=msg&mview=1&parent=1&item=18524
-----------------------------------------------------------

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