Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Render gridview as <div> instead of table

enter image description here

I am looking for some code snippet which will render a gridview into <div> instead of table.
Anyone can help me on this?

I need to draw a graph like the one I have attached and need some features like select the graph area with mouse and provide copy paste operation.

like image 271
Saanch Avatar asked Oct 25 '22 06:10

Saanch


1 Answers

I think you should use the ListView control introduced along with DotNet framework 3.5.

The ListView is a template driven control which means that it will not render anything by default. By default, the developer must completely specify the HTML he/she wants to render in the form of templates (should specify the HTML that should be rendered within the LayoutTemplate ).

See the code project url below to get implementation details..

http://www.codeproject.com/KB/webforms/CompleteListView.aspx

Also refer the following msdn video,

http://www.asp.net/aspnet-35/videos/the-listview-control

UPDATE: Since your project is using DotNet Framework 2.0 you should use a Repeater server control to acheive this

The Repeater control has no built-in layout or styles; you must explicitly declare all HTML layout, formatting, and style tags within the control's templates.

But paging,sorting etc will be a bit difficult using Repeater. The ListView is an updated version of Repeater with the mentioned functionalities as well..

Hope this helps you..

like image 147
Harun Avatar answered Oct 27 '22 11:10

Harun