GridDesktop 9.0.9.0 (Auto-Filter): All columns are filtered

Hello,


Some question about the Auto-Filter function :

When i filter on a range like “C1:D1” to “C4:D4”, autofilter applys on all the columns. I want just the selected columns to be filtered.
See attachement for steps

I use that code, is that OK ? :

public void EditFilterSpecial()
{
try
{
if (gridDesktop1.Worksheets.Count <= 0) return;
Aspose.Cells.GridDesktop.Worksheet ws;
int ActShIndex = gridDesktop1.Worksheets[gridDesktop1.ActiveSheetIndex].Index;
ws = gridDesktop1.Worksheets[ActShIndex];

int StartRow = 0, StartColumn = 0, EndRow = 0, EndColumn = 0;

CellRange cr = ws.GetLastSelection();
if (cr == null)
{
GridCell gc = ws.GetFocusedCell();
StartRow = gc.Row;
StartColumn = gc.Column;
EndRow = ws.RowsCount;
EndColumn = gc.Column;
}
else
{
StartRow = cr.StartRow;
StartColumn = cr.StartColumn;
EndRow = cr.EndRow;
EndColumn = cr.EndColumn;
}

Aspose.Cells.GridDesktop.RowFilterSettings rf = ws.RowFilter;

Workbook workbook = new Workbook(m_xmlSSFilename);
Aspose.Cells.Worksheet worksheet = workbook.Worksheets[0];

if (!bfilter)
{
// Creating AutoFilter by giving the cells range of the heading row
m_cr.Copy(cr);
// ExEnd:1
rf.EnableAutoFilter = true;
worksheet.AutoFilter.SetRange(StartRow, StartColumn, EndColumn);
ws.AddAutoFilter(StartRow, StartColumn, EndColumn);
rf.HeaderRow = StartRow;
rf.StartRow = rf.HeaderRow;
rf.EndRow = EndRow;
bfilter = true;
worksheet.AutoFilter.Range = worksheet.AutoFilter.Range;

for (int i = 0; i < (EndColumn - StartColumn + 1); i++)
{
worksheet.AutoFilter.AddIconFilter(i, IconSetType.ArrowsGray3, 0);
string strButtonText = “”;
/if(ws.Cells.GetCell(StartRow, StartColumn + i).Value != null)
strButtonText = ws.Cells.GetCell(StartRow, StartColumn + i).Value.ToString();/
ws.Controls.AddButton(StartRow, StartColumn + i,
ws.Columns[StartColumn + i].Width, ws.Rows[StartRow].Height,
strButtonText, true);
Aspose.Cells.GridDesktop.Button bt = (Aspose.Cells.GridDesktop.Button)ws.Controls[StartRow, StartColumn + i];
CellControl cc = ws.Controls[StartRow, StartColumn + i];
bt.Image = getFilterImage();
}
worksheet.AutoFilter.Refresh();
}
else
{
StartRow = m_cr.StartRow;
StartColumn = m_cr.StartColumn;
EndRow = m_cr.EndRow;
EndColumn = m_cr.EndColumn;

for (int i = 0; i < (EndColumn - StartColumn + 1); i++)
{
ws.Controls.Remove(StartRow, StartColumn + i);
}

worksheet.AutoFilter.ShowAll();
worksheet.AutoFilter.Refresh();

rf.HeaderRow = -1;
rf.StartRow = -1;
rf.EndRow = -1;
rf.EnableAutoFilter = false;

ws.RemoveAutoFilter();
ws.UnFreezePanes();
bfilter = false;
worksheet.AutoFilter.Range = null;
worksheet.AutoFilter.Refresh();
}
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
}

Hi,


Thanks for the sample code segment and screenshots.

We appreciate if you could provide us a simple WinForm project (runnable) with template file and other resource files to evaluate your issue properly, it is hard to test your issue based on your provided code segment as we are not sure for some of the variables/ objects and modules without your underlying file(s). You may zip the project and post us here, we will check it soon.

Thank you.

See project attached

Hi,


Thanks for the sample project.

After an initial test, I observed the issue as you mentioned by using your sample project. I executed your project. I inserted some header text into A1: D1 range of cells, then I added some values (string/numeric, etc.) into A2:D4 cells. I selected the range (C1:D4) and click on “Filter” icon/button, it applies to all the columns even on empty columns (i.e., on cells E1, F1, G1 and so on).

I have logged a ticket with an id “CELLSNET-44798” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.
Hi,

This is to update you that we have resolved the issue logged earlier as "CELLSNET-44798". We will soon share the fix here after ensuring the quality and incorporating other enhancements.

Thank you
Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET (Latest Version) and let us know your feedback.

Hi,


It’s still not working with Aspose.Cells.GridDesktop V16.10.1.0

Hi,


Thanks for your feedback and using Aspose.Cells.GridDesktop.

We will test your issue soon and update you. It will be helpful if you could share your GridDesktop WinForm application instead of code. This will enable us to quickly replicate the issue and in case of error, reopen the issue. Thanks for your cooperation in this regard. Have a good day.

I have already gives you a nsample project

Hi,

Thanks for your posting and using Aspose.Cells for GridDesktop.

Do you mean this sample project found at this post in your other thread?

https://forum.aspose.com/t/25517

Attachment: AsposeProject.zip

Hi,

Thanks for using Aspose.Cells.GridDesktop.

I have attached the upgraded sample project that uses the latest: Aspose.Cells for .NET (Latest Version) and also attached the screenshot. I am unable to find AutoFilter button on your application because it is not in English.

Also, in your second post of this thread, the project you provided is now missing.

Post Reference:

AsterYRI:

See project attached

Where is the original project with which the issue i.e. CELLSNET-44798 was logged?

Hello,


See an image of my toolbar.
From left to right :
1-Insert Row
2-Insert Column
3-Remove Row
4-Remove Column
5-Format
6-Sort
7-Remove Duplicate
8-AutoFilter
9-Freeze Pane
10-Unlock Pane
Hi,

Thanks for the explanation of toolbar items and using Aspose.Cells.GridDesktop.

Please also explain this point with screenshot. Because according to your toolbar items, there is no such thing like AutoFilter.

So how to replicate this point.

AsterYRI:

When i filter on a range like "C1:D1" to "C4:D4", autofilter applys on all the columns. I want just the selected columns to be filtered.

The issues you have found earlier (filed as CELLSNET-44798) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.