adding Numerical sort to category property
Can anyone advise me how I would go about changing the 'Importance' property in the Category class, so that in the UI, insted of editing this value through a textbox field, a drop down list is instead used that displays the current 'Importance' as the selceted value within the range of 'Importance' values within the existing categories. Then if a new value is selected from the list, all the other existing category 'Importance' property values are accordingly incremented or decremented.
For example suppose I have the following scenario -
I have four category rows (each row representing a category object) in my database, and I choose to edit the details of the object whoose Id is '1'.
The UI page will allow the user to update the category class details. The ddl selected value for this object is '1', with the other list values being 2,3,4. If the user then selected the value '3', how would I update the 'importance' values in the other three objects (all the other existing category 'Importance' property values are accordingly incremented or decremented.)?
I'm wondering if in order to do this I need to created a new table that has a one to one relationship with the category class, containing a CategoryId and Importance Int cloumns. Then have this reflected in a new class called CatImportance, that is referneced via a new property in the category class of type CatImportance?
I'm I going about this in the wrong way?
Any help is appreciated.
Last edited by teabag99; March 27th, 2011 at 03:04 PM..
Reason: add more information because no one has posted a reply