About .NET Dave |  Advertise |  Contact Us |  FAQ |  Link2Me |  Webmasters |  Manage My Submissions
 
 
    Cool Stuff |  Hot Stuff! |  Newsletter |  What's New? |  Rotor Source Code
   
Server Intellect ASP.NET Web Hosting

  Dynamically Add Rows inside a Datagrid Rate this Resource  1  read reviews write a review report an error printer friendly version
A code snippet posted on aspngbeta list about dynamically adding rows to a datagrid.
Extended Description 
protected virtual void ItemCreated(Object o,DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Item)
{
DataGrid dg = (DataGrid)o;
TableCell tc = new TableCell();
tc.Controls.Add(new LiteralControl("foo"));
DataGridItem di = new DataGridItem(e.Item.ItemIndex+1,0,ListItemType.Item);
di.Cells.Add(tc);
Table t = (Table)dg.Controls[0];
t.Rows.Add(di);

}
    Total Views:2664 | Today:96 Total Hits:320 | Today:1


Customer Reviews

Bug? 1/21/2005
a reviewer from NY, USA writes
What is the "o" at the end of the line?
DataGrid dg = (DataGrid)o;


Is this your resource?
To add the following Ratings and Review bar to your website    Review this Page       

Copy and paste one of the following blocks of code to your webiste.


This first block of code ueses javascript to pop up a dialog box, so the web surfer can enter a review without ever leaving your website.

Or you can use this block of code.


This block of code DOES NOT use javascript, and will open a new window to 123aspx.com

 

 

 

 


WinForms Development Components


ASP.NET Shopping Cart Software

DotNetNuke Modules

ASP.NET Shopping Cart Software
  Hosted By:
  Check Out:
  #1 .NET Email
  .NET Email Validation
Back to Top   Last Updated: 2/9/2010 3:36:32 AM
© 2010www.123aspx.com All rights reserved. Terms of Use.   email comments: support@123aspx.com  or use our online form.