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 I see datagrid1.deleteRow(), but no datagrid1.addRow. Anybody have any clever ideas? Thanks Rookie
With a bound DataGrid you can programmatically add new rows with a Select. Templates can be applied at the same time, etc. These two pages should help: http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/ctrlref/webctrl/datagrid/doc_datagrid.aspx http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx
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
thanks for the quick replies. I'm gonna test out my coding skills with the repeater. Should be interesting Thanks
you'll find out it's easy to use once you do it once. good luck. Joel Thoms DiscountASP.NET http://www.DiscountASP.NET
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.
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.