Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Jason Perry   on Oct 31 In Asp.net Category.

  
Question Answered By: Rochelle Elliott   on Oct 31

<PleaseForgiveMyIgnorance>
I am very new to ASP.NET, and this question intrigues me cuz I am sure there is a simple solution.

To solve this question I made my own page that dynamically added DataGrid controls to the page then inserted the title, every 5 rows of the DataTable that populated the DataGrid. It got complex and messy, so that wasn't elegant enough.

I am sure it would be possible to declare a new class inherited from System.Web.UI.WebControls.DataGrid and you would modify either the method .RenderControl or the method .Render and change the contents of the string being fed to the HtmlTextWriter to force a custom [title] row  every nth row.

If you got fancy, you could probably put in a couple properties to define the HTML of the title row and the rows on which the title row should appear.

Would that be the right approach? If it is.. can someone post any code sample (vb.net if possible) that shows a webcontrol having it's contents modified when being rendered?

Share: 

 

This Question has 10 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on datagrid Or get search suggestion and latest updates.


Tagged: