Hierarchical grid writing to/from dataset, with dropdown column

1 reply. Last post: October 11, 2012 2:19 AM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Peter KeelerMember

I'm evaluating WebGrid for our use, and I'm trying to figure out if it can handle this use case. Can someone help?

Simplified situation:

I have a DataSet, which I have pre-populated, with at least three tables. Table 0 contains three value/text pairs that I want to use for a dropdown, in the form UnitTypeID/UnitTypeDescription. Table 1 contains four columns: UnitID, ParentUnitID, UnitDescription, and UnitTypeID. Table 2 has the same structure as Table 1, with a relationship between ParentUnitID in table 2 and UnitID in Table 1. I could potentially then have Table 3 and beyond, where ParentUnitID for table n links to UnitID in table n-1.

Ideally, this is what I want: Initially, all the rows in Table 1 should be displayed, with the UnitTypeDescription in an editable combobox in each row, so that the UnitTypeID in Table 1 will be updated if I change the combobox values. The other columns should not be editable. If I expand a row, it should show the child rows with the same column definitions, so that all the columns line up (so the UnitID column for parents and children will be visually lined up, etc). If a row does not have any child rows, it should not display a box to expand that row. Then when the user hits a 'Save' button elsewhere on the page, I need to update that dataset with the user's selections, and then the user can continue making edits.

If it is not possible to get the columns to line up, then I can live without that. But I need to have the dropdowns, programmatic hierarchy, and postback. None of the tutorial examples quite matches what I'm trying to do. Can someone show me a simple example of how I could do this?

All times are GMT -5. The time now is 1:49 AM.
Previous Next