views:

10

answers:

1

Scenario:

I am building a flexible discounting component, whereby discounts can be specified for different types of customers against different types of products (means tested). The discount categories, product types and discount rates are all configurable by the user and ideally I would like the user to be able to view and edit the discount relationships on a single screen i.e. Product Types down the left-hand side, Discount Categories along the top, with the assigned discount rate displayed in the corresponding "cell".

I am trying to find the best solution for displaying this data in tabular format. A repeater does not seem to fit the bill, nor does the data grid/list controls. The only option I can think of is to construct the HTML dynamically either server-side using loops and outputting to a literal control, or by sending the serialized data (in XML format) back to the client and using JavaScript to again dynamically build the matrix.

Any other ideas would be appreciated.

A: 

Hey,

Well, GridView would work if you dynamically generate the columns to display. Since you need full control, a server-side table control would work great here too, because you can programmably create each row/column. You'd have to create it on every page load, but VIewState will restore the contents after the fact...

Depending how complex, I do think you could get a repeater or ListView to work for this scenario too...

HTH.

Brian
Thanx. The application is fully AJAX enabled so no postbacks to worry about fortunately. I'm swaying towards manual row/cell creation as this provides me with the most flexible solution. There may be a need to provide additional information and links within each cell, which adds another layer of complexity if going down the standard .Net control route.
newc1
Well, you have options, you can use the hyperlink or linkbutton control, or inject the markup of the <a> tag as a string.
Brian