1

I need to add a new page to an existing website that is all written in ASP.NET Webforms. This new page is to have a search feature that will return records in the form of a grid. However, there is the added requirement that to the left of each row in the results set there will be an icon that the user can click on to expand and see more results. If the user clicks on that icon then a new results grid will appear immediately under that row of the original results grid. This secondary results grid will show different information (i.e. the number and names of the columns will be different) from the primary grid that comes from a separate data source. I have tried to illustrate this in the picture below (apologies for the crappy MSPaint skills)

enter image description here

So the Orange rows are the primary Grid Results and the Green are the secondary grid that only becomes apparent if the Green + icon to the left of the primary grid rows is clicked on.

I have a few questions:

  1. Is it possible to do something like this using existing Server Control objects in ASP.NET WebForms (like for example GridView objects)? I'd like to stick with WebForms if possible to keep it consistent with the rest of the project but I realise that that may not be possible.
  2. If not then what would be a good way of doing this? I am open to using, for example, client-side coding and Web API on the server side if needs be, to achieve this although I'm not 100% sure how to go about this.
Sperick
  • 2,691
  • 6
  • 30
  • 55

1 Answers1

1

I think your best bet would be to look at using a TreeView, as at least from a design stand-point it meets exactly what you're describing:

MSDN Page

EDIT: As you want to display multiple columns in the TreeView I'm not entirely sure that it's possible without either creating your own custom control which may entail a lot of work, or the use of third party controls. There are however a few available online which should suit your requirements (Ref: This Answer):

JasperMoneyshot
  • 357
  • 3
  • 15
  • Thanks, I'll look into this – Sperick Jul 23 '18 at 11:51
  • I'm not sure if this is what I'm looking for. All of the examples that I see are returning a single piece of data at each node. I wish to return a collection of data. So in other words each node will have 8 or 10 columns of data (the same as a row of a grid) – Sperick Jul 23 '18 at 12:15
  • I'm not sure if that's entirely possible without using third party controls, I had a look around for some and updated the answer. – JasperMoneyshot Jul 23 '18 at 13:14