Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
re-group re-sort when drop down value changes
posted

Hello,

I have a column in a wingrid which has a drop down list. This column is also being grouped on. When the user selects a new value from the drop down I would like the row to appear in the appropriate group based on the value. I.e. It might look like to start:

Groupd by Status

(+)Active

-Row 1 Status Active

(+)Inactive

-Row 2 Statis Inactive

 

 If user changes status in row 1 to Inactive it should now look like this:

(+)Inactive 

-Row 1 Status Inactive

-Row 1 Status Inactive 

 

I have tried to simulate this by putting some code in AfterCellUpdate:

 this.ultraGrid.DisplayLayout.Bands[0].SortedColumns.RefreshSort(true);

 

This has an interesting affect. When the user selects the new value this is what it looks like:

 

(+)Inactive

-Row 1 Status Inactive

(+)Inactive

-Row 2 Statis Inactive

 It creates two groupings with the same value. I've checked and the grouped by values are exactly the same. If you drag the group by column out of the group by box and then drag it back in, they are still grouped in seperate headers with the same values.

Is there an easy and proper way to do this?

thanks!

James 

 

Parents
  • 255
    posted

    I have figured out the solution to this. I turns out that the grouping was based on the underlying 'value' of the text field not the display text. Because my valuelist had defauts for these(I.e. valuelistitem1, valuelistitem2) it was grouping based on those even though the values the user saw were 'Active' 'Inactive' etc. Changing the 'values' in the value list to reflect the 'display' text fixed this issue. Is there a way to tell the listbox to goup by displayed 'Text' instead of 'Values'? Is there a reason these are different for cells? I can understand it for dropdowns as these might actually be key values.

     

Reply Children