Skip to content

Replies

0
Aleksey
Aleksey answered on Nov 17, 2008 1:34 PM

Alex, thanks for you quickly answering my question and your piece of code. I am going to try it.

I have found the mean of doing it too. My solution is not elegant, but it works.

if (grid_.Rows.FilterRow != null)
                {
                    UltraGridCell cell = grid_.ActiveCell;

                    if (cell != null && cell.IsFilterRowCell)
                    {
                        bool needRestoreEditMode = cell.IsInEditMode;
                        cell.Activated = false;
                        cell.Activated = true;
                        if (needRestoreEditMode)
                            grid_.PerformAction(UltraGridAction.EnterEditMode);
                    }
                }

Repopulating values will be performed only for active filter cell if it's needed.

Alex. 

 

0
Aleksey
Aleksey answered on Nov 17, 2008 11:02 AM

Hi, Alex.

Could you provide me with sample of code you used as workaround. I have the same problem.
I have tried to use the means you told about.
>>My Workaround:
>>When I update the data source I also iterate through the filter row in the grid
>>clearing out all the valuelists so that all the dropdowns will be forced to refresh.
>>but nothing came out of it.
I tried to iterate through the filter row in the grid like this:
            if (grid_.Rows.FilterRow != null)
            {
                foreach (UltraGridFilterCell cell in grid_.Rows.FilterRow.Cells)
                {
                    //cell.ValueList //tried to clear…
                }
            }
but
I see that cell.ValueList does not have the methods for
clearing/removing its items and it is always null at this moment. I
tried to call this code after binding new values to datasource.
It sounds like the populating 'cell.ValueList' is performed on manually drop down a filter…

Thanks in advance. Alex.