adding rows into a datagrid

Discussion in 'ASP.NET 2.0' started by Rookie, Sep 28, 2006.

  1. I having been looking for a way to insert additional rows into a datagrid in asp.net 2.0. I am pulling data (a list of events: date, title, etc...)from a sqldatasource and displaying it a datagrid.

    I want to be able to insert a row the is formatted differently from the rest that helps visually group the events by dates.
    For example

    [​IMG]

    I see datagrid1.deleteRow(), but no datagrid1.addRow.

    Anybody have any clever ideas?

    Thanks
    Rookie
     
  2. I don't think you can do what you are trying to do with the datagrid, you might need to use a repeater and manually create the html rows in the table.


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  3. thanks for the quick replies. I'm gonna test out my coding skills with the repeater.

    Should be interesting [​IMG]


    Thanks
     
  4. Joel, I haven't tried myself yet but I saw something similar done from a SQL Server 2005 Pivot Table indexed with templates in a ASP.NET v2.0 datalist, looked impressive and I keep meaning to create some shaped data to try it.
    Problem is I'm ever forgetful. [​IMG]
     
  5. Could you post the link to the example you are talking about (if you still have it)?

    Thanks
     
  6. I will indeed.

    Note:
    Wehad been experimenting with this for a large Finance group who wanted to step away from Crystal Reports.
    Previously they had been using an Oracle World, which can easily generate reports like the one illustrated here.
    SQL Server fed Crystal Reports canbut we had to use the object model controls for Pivot Tables and it was messy.
    So the idea was to use the .NET Framework and SQL Server SPs to shape the data then format it.
     

Share This Page