Monday, August 16, 2010

Repeater and DataGrid?

I have an ASP .NET page (.NET 2 platform) which uses a Repeater control to present two DataGrids. The problem is the DataGrids aren't quite identical.





I need the first iteration through the repeater to populate one DataGrid using one table of data, while the next iteration needs to populate a DataGrid with a slightly different table (same structure except it has one additional column).





How can I accomplish this within the context of the Repeater? I need to somehow ';sneak'; into the loop which the repeater manages and be able to tell it which data set to use when.Repeater and DataGrid?
Sounds like you need to handle the Repeater's ItemDataBound event and/or ItemCreated event. Please refer to the msdn link:





http://msdn2.microsoft.com/en-us/library鈥?/a>





Also, consider upgrading your DataGrids to GridViews for improved functionality:





http://msdn2.microsoft.com/en-us/library鈥?/a>

No comments:

Post a Comment