0

I have an Ultrawebgrid with a valuelist column called WorkCategory (statically loaded with values at Page_Load).

When the user selects a value for WorkCategory (captured at AfterCellUpdated event), a second ValueList called WorkSubCategory is created and loaded on the following cell, based on the WorkCategory valuelist's selected value and populated for the user to also select.

When the grid is loaded, while the WorkSubCategory column values are displayed correctly, when clicking on the cells themselves to choose another value, no valuelist dropdown is shown, because this is not created until the WorkCategory dropdownlist changes value. This is frustrating for the users, because if they want to change the work sub category, they have to first change work category to another value, then change it back to the desired value, and then access the drop down list on the Work Sub Category column.

What I would like to do is to have both value lists loaded and available at *page_load*, so as to enable editing of the WorkSubCategory valuelist without having to change the WorkCategory column's value first. I have tried to do that in code-behind in method called on Page_Load; while the grid loads ok, clicking on the WorkSubCategory column throws a nasty javascript exception.

Any ideas on how this can be achieved? Which event should I hook this up to?

user1012598
  • 417
  • 1
  • 8
  • 18

1 Answers1

1

Use BeforeEnterEditMode for the cell containing the ValueList that is dependent on another value and then it will not matter if the value was set on the server or the client. For having the value list be dependent on another value in the row, the logic still needs to be on the client as server side you can only set one ValueList for the column. How to change valuelists from one row to another has an example of this.

alhalama
  • 3,218
  • 1
  • 15
  • 21
  • So what you are suggesting is to use the BeforeEnterEditMode event of the dependent cell, then at that point create the value list and populate it according to the value of the previous cell? Will this work? – user1012598 Nov 21 '12 at 06:02
  • Yes, if you look at the example in the link that is what is being done. – alhalama Nov 21 '12 at 17:52