I need to develop a webpart which takes data from list and populate in spgridview. The webpart should look like in the image atached. I am able to display the column 1 i.e one image for each row but How do I create the column 2 , which have several rows to be displayed from the list?

enter image description here

  • I love the artist's rendering of a SPGridView. :) – Kit Menke Oct 11 '11 at 14:05
  • Need some details.. The Column 2 contains how many rows? and those rows are from the same list? any conditions or grouping needed? – Shantha Kumar Thambidurai Oct 11 '11 at 14:39
  • no conditional grouping needed . column 2 contains 3 rows and inside each row there is need of 4-5 row. – Nikhil J Oct 12 '11 at 4:58

I'm not sure what you are using as the DataSource for your SPGridView but lets assume a DataTable object.

I would just generate the HTML you need (list?) and update the rows in the DataTable.

Then, I would use a regular 'ole BoundField with HtmlEncode set to false so that the HTML displays in the SPGridView column.

  • the sp list is datasource and i m using data table .any link would be appreciated – Nikhil J Oct 12 '11 at 4:59

I was able to achieve this by Grid view template field property . Created a table with my required structure and attached it with template field

Check this link for other option which is helpful : http://www.c-sharpcorner.com/UploadFile/a577f3/5120/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.