This is a migrated thread and some comments may be shown as answers.

Add new item with filter activated

3 Answers 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
CLAUDIO ROSSI
Top achievements
Rank 1
CLAUDIO ROSSI asked on 30 Mar 2011, 12:59 PM
If i try to add one new element to the RadGridView with filter set for one or more columns and defaults for new item correspond to filtered elements , the new element isn't diplayed and can't be edited ....
There is a way to edit new item with filters activated ?

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 31 Mar 2011, 09:16 AM
Hello CLAUDIO ROSSI,

You can try this setting ShowInsertRow to true. The new row should be visible despite the filters. Let us know if there are problems.

Kind regards,
Ross
the Telerik team
0
Florian
Top achievements
Rank 1
answered on 28 Feb 2012, 02:25 PM
I have the same problem:

The grid view has a column of type string. I filter it with let's say "starts with A". I make an new entry with the insertion row, lets' say "Abc". After adding the row, it is not shown. I open the filter dialog and the "Abc" is listed in the distinct values. I make a change in the dialog which leads to the same filter and the row ist shown. The same problem exists when filtering by disting values.

The grid view is linked with a RadServiceDataSource, which has changes now. (That's ok, of course.)

Now I delete the filter, but the rows are still filtered until the changes are saved or canceled.

Is it not indented to add new row while filters are active?
0
Florian
Top achievements
Rank 1
answered on 02 Mar 2012, 11:09 AM

Finally I found a workaround for this bug:

Reset the FilterDescriptors in RowEditEnded:

private void gridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
{
    FilterDescriptorCollection filters = new FilterDescriptorCollection();
    filters.AddRange(gridPartner.FilterDescriptors);
    gridPartner.FilterDescriptors.Clear();
    gridPartner.FilterDescriptors.AddRange(filters);
}

Now the added item does not fanish (if it meets the filter criterion).
Tags
GridView
Asked by
CLAUDIO ROSSI
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Florian
Top achievements
Rank 1
Share this question
or