Quantcast
Viewing all 198 articles
Browse latest View live

Commented Unassigned: An empty row is created when filtering on blanks rows [1338]

In your Test Sample, at starting there is one empty row :

![OneEmptyRow](http://i.imgur.com/eFUOHwQ.png)

Then filter on empty rows :

![FileringEmptyRows](http://i.imgur.com/qJqAjz3.png)

Press "Ok" to apply filter. Then clear filter. And now there is a new empty row that have been created :

![TwoEmptyRows](http://i.imgur.com/x0flxe9.png)
Comments: ** Comment from web user: Zubyme **

Catch it
try to fix


Commented Unassigned: An empty row is created when filtering on blanks rows [1338]

In your Test Sample, at starting there is one empty row :

![OneEmptyRow](http://i.imgur.com/eFUOHwQ.png)

Then filter on empty rows :

![FileringEmptyRows](http://i.imgur.com/qJqAjz3.png)

Press "Ok" to apply filter. Then clear filter. And now there is a new empty row that have been created :

![TwoEmptyRows](http://i.imgur.com/x0flxe9.png)
Comments: ** Comment from web user: Zubyme **

try change method of ADGVFilterMenu to this
public static IEnumerable<DataGridViewCell> GetValuesForFilter(DataGridView grid, String columnName)
{
var vals =
from DataGridViewRow nulls in grid.Rows
__where nulls.IsNewRow == false__
select nulls.Cells[columnName];

return vals;
}

Commented Unassigned: An empty row is created when filtering on blanks rows [1338]

In your Test Sample, at starting there is one empty row :

![OneEmptyRow](http://i.imgur.com/eFUOHwQ.png)

Then filter on empty rows :

![FileringEmptyRows](http://i.imgur.com/qJqAjz3.png)

Press "Ok" to apply filter. Then clear filter. And now there is a new empty row that have been created :

![TwoEmptyRows](http://i.imgur.com/x0flxe9.png)
Comments: ** Comment from web user: Zubyme **

```
public static IEnumerable<DataGridViewCell> GetValuesForFilter(DataGridView grid, String columnName)
{
var vals =
from DataGridViewRow nulls in grid.Rows
where nulls.IsNewRow == false
select nulls.Cells[columnName];

return vals;
}
```

Commented Unassigned: Filtering on numbers returns no result when num2 is greater than num1 [1347]

The method OKButton_Click in class SetFilterForm should be :

```C#
case FilterType.Integer:
case FilterType.Float:

String num = this.val1contol.Text;

if (this.filterType == FilterType.Float)
num = num.Replace(",", ".");

if (this.FilterTypeComboBox.Text == this.RM.GetString("setfilterform_filtertypecombobox_equal"))
this.filterString += "= " + num;
else if (this.FilterTypeComboBox.Text == this.RM.GetString("setfilterform_filtertypecombobox_between"))
{
double num1;
double num2;
if (double.TryParse(num, out num1) && double.TryParse(this.val2contol.Text, out num2))
{
if (num1 > num2)
{
this.val1contol.Text = num2.ToString();
num = num2.ToString();
this.val2contol.Text = num1.ToString();
}
}
this.filterString += ">= " + num + " AND " + column + "<= " + (this.filterType == FilterType.Float ? this.val2contol.Text.Replace(",", ".") : this.val2contol.Text);
}
```
Comments: ** Comment from web user: DCourtel **

I agree with you, Mathematically, there is no numbers >5 AND <1. But you say that because you know that your prog query DATAs like this.
Lambda users only see the UI. And they ask for numbers between 5 and 1. In their mind, they want to show 2,3,4. Especially, if data are sorting "From bigger to smaller".

You should either, take care of this automatic inversion, or either, make the UI more clearer for the "between" case.

Updated Wiki: Documentation (RU)

Advanced DataGridView

v1.0.6
RUEN

Содержание

  1. Описание
  2. Инструкция
  3. Классы и методы
  4. SearchToolBar
  5. Локализация
  6. Пример

Описание

back

Инструкция

back

Классы и методы

AdvancedDataGridView.cs
Основной класс
publicclass AdvancedDataGridView : DataGridView
Автоматически добавляет фильтр при добавлении нового столбца
public Boolean AutoGenerateContextFilters {get; set;}

При фильтрации дат значения часов, минут, секунд и миллисекунд отбрасываются
public Boolean DateWithTime {get; set;} 

К дереву дат в фильтре добавляются фильтр часов, минут, секунд, миллисекунд
public Boolean TimeFilter {get; set;}

Итоговая строка сортировки
public String SortString {get; privateset;}

Итоговая строка фильтра
public String FilterString {get; privateset;}

Событие возникает при изменении SortString
publicevent EventHandler SortStringChanged;

Событие возникает при изменении FilterString
publicevent EventHandler FilterStringChanged;

Включает фильтр для Column
publicvoid EnableFilter(DataGridViewColumn Column)

Включает фильтр для Columnс заданными настройками DateWithTimeи TimeFilter, если фильтр уже включен, то только меняет настройки DateWithTimeи TimeFilter
publicvoid EnableFilter(DataGridViewColumn Column, Boolean DateWithTime, Boolean TimeFilter)

Скрывает фильтр для Column
publicvoid DisableFilter(DataGridViewColumn Column)

Загружает фильтр и сортировку для таблицы
publicvoid LoadFilter(String Filter, String Sorting = null)

Удаляет все сортировки. Если FireEvent = true, то возникает событие SortStringChanged
publicvoid ClearSort(Boolean FireEvent = false)

Удаляет все фильтры. Если FireEvent = true, то возникает событие FilterStringChanged
publicvoid ClearFilter(Boolean FireEvent = false)

Поиск по отфильтрованным ячейкам.
  • Возвращает первую DataGridViewCellу которой FormatedValueсовпало с ValueToFind.
  • ColumnName - имя столбца в котором осуществляется поиск, если null, то поиск по всем столбцам.
  • ColumnIndex - номер столбца с которого начинать поиск. Если ColumnIndex!=ColumnName.Index, то поиск начинается со следующей строки. Если ColumnIndex>0и ColumnName!=null, то поиск идет только в столбцах с Index>ColumnIndex.
  • isWholeWordSearch - искать слово целиком.
  • isCaseSensitive - учитывать регистр
public DataGridViewCell FindCell(string ValueToFind, string ColumnName = null, int RowIndex = 0, int ColumnIndex = 0, Boolean isWholeWordSearch = true, Boolean isCaseSensitive = false)

ADGVColumnHeaderCell.cs
DataGridViewColumnHeaderCell, который содержит кнопку для фильтра
publicclass ADGVColumnHeaderCell : DataGridViewColumnHeaderCell

ADGVFilterMenu, который привязан к DataGridViewColumnHeaderCell
public ADGVFilterMenu FilterMenu { get; privateset; }

Событие возникает когда нажимают на кнопку фильтра
publicevent ADGVFilterEventHandler FilterPopup;

Событие возникает когда у привязанного FilterMenu меняется SortString
publicevent ADGVFilterEventHandler SortChanged;

Событие возникает когда у привязанного FilterMenuменяется FilterString
publicevent ADGVFilterEventHandler FilterChanged;

Минимальные размеры ячейки, которые должны быть чтобы хватило места для размещения кнопки фильтра
public Size MinimumSize {get; }

Активный стиль сортировки FilterMenu
public ADGVFilterMenuSortType ActiveSortType {get; }

Активный тип фильтра FilterMenu
public ADGVFilterMenuFilterType ActiveFilterType {get; }

Итоговая строка сортировки FilterMenu
public String SortString {get; }

Итоговая строка фильтра FilterMenu
public String FilterString {get; }

Включен или нет FilterMenu. Когда фильтр отключен кнопка фильтра не отображается.
public Boolean FilterEnabled {get; set;}

Возвращает или устанавливает FilterMenu.DateWithTime
public Boolean DateWithTime {get; set;}

Возвращает или устанавливает FilterMenu.TimeFilter
public Boolean TimeFilter {get; set;}

Вызывает SetLoadedFilterMode(Boolean Enabled)
publicvoid SetLoadedFilterMode(Boolean Enabled)

Конструктор. oldCell - оригинальная ячейка DataGridViewColumnHeaderCellдля замены
public ADGVColumnHeaderCell(DataGridViewColumnHeaderCell oldCell, Boolean FilterEnabled = false)

back

SearchToolBar

back

Локализация

back

Пример

back

Commented Unassigned: Filtering on numbers returns no result when num2 is greater than num1 [1347]

The method OKButton_Click in class SetFilterForm should be :

```C#
case FilterType.Integer:
case FilterType.Float:

String num = this.val1contol.Text;

if (this.filterType == FilterType.Float)
num = num.Replace(",", ".");

if (this.FilterTypeComboBox.Text == this.RM.GetString("setfilterform_filtertypecombobox_equal"))
this.filterString += "= " + num;
else if (this.FilterTypeComboBox.Text == this.RM.GetString("setfilterform_filtertypecombobox_between"))
{
double num1;
double num2;
if (double.TryParse(num, out num1) && double.TryParse(this.val2contol.Text, out num2))
{
if (num1 > num2)
{
this.val1contol.Text = num2.ToString();
num = num2.ToString();
this.val2contol.Text = num1.ToString();
}
}
this.filterString += ">= " + num + " AND " + column + "<= " + (this.filterType == FilterType.Float ? this.val2contol.Text.Replace(",", ".") : this.val2contol.Text);
}
```
Comments: ** Comment from web user: Zubyme **

you right, i do something in next release

Commented Unassigned: An empty row is created when filtering on blanks rows [1338]

In your Test Sample, at starting there is one empty row :

![OneEmptyRow](http://i.imgur.com/eFUOHwQ.png)

Then filter on empty rows :

![FileringEmptyRows](http://i.imgur.com/qJqAjz3.png)

Press "Ok" to apply filter. Then clear filter. And now there is a new empty row that have been created :

![TwoEmptyRows](http://i.imgur.com/x0flxe9.png)
Comments: ** Comment from web user: DCourtel **

Yes, looks like to fix the bug.
Thanks.

Created Unassigned: Feature request: If filter is disabled enable column sorting [1348]

It would be nice if when filtering is disabled then the column headers revert back to standard DataGridViewColumnSortMode.Automatic behavior, i.e. clicking on header sorts and shows sorting glyph.

e.g. when the IBindingListView.SupportsFiltering is false.

Great work BTW

Commented Unassigned: Feature request: If filter is disabled enable column sorting [1348]

It would be nice if when filtering is disabled then the column headers revert back to standard DataGridViewColumnSortMode.Automatic behavior, i.e. clicking on header sorts and shows sorting glyph.

e.g. when the IBindingListView.SupportsFiltering is false.

Great work BTW
Comments: ** Comment from web user: Zubyme **

ok, good idea

New Post: Thnx!

Thank you!

Отличный грид, то, чего часто не хватает!

New Post: What implementations of IBindingListView does this support?

Does the filtering just work with System.Data.DataView or do you know of any other implementations out there that have a comprehensive DataColumn.Expression implementation of the Filter property?

I use http://teamjohnston.net/blog/category/objectlistview in my https://rapiddevbookcode.codeplex.com/wikipage?title=EnumerableDebugVisualizer which does support DataColumn.Expression filtering, but not, alas, the IN clause you generate.

https://cslacontrib.codeplex.com/SourceControl/latest#branches/2010.11.001/Csla2Extensions/ObjectListView/CSharp/ObjectListView.cs might support it since it uses an underlying DataView but I haven tried it yet.

Just curious if anyone knows one out there that does.

Reviewed: 0.1.0.6 NY Edition (Jan 22, 2014)

Rated 5 Stars (out of 5) - Fantastic, easy to use and you've thought of everything. I have an issue getting the "date" filter to work like a date and is instead treating a date field as a text filter, but it is not critical for my application so i'm not planning on trying to figure out why...excellent work here!

Patch Uploaded: #15931

Zubyme has uploaded a patch.

Description:
Refactored NY edition by Davide Gironi (http://davidegironi.blogspot.it/)

Things added:
* Pragmatic Sort ASC / DESC a columns
* Enable or Disable Sorting or Filter capabilities for a single column
Things removed:
* Localization: months name are localized, other strings not, but all the string are contined in hashtable, it may be simply added.
* DateAndTime + Time: unified to DateAndTime, just one capabilities is enough, it also produce less confusion.

Code styling:
* i've try to follow Microsoft Framework design guidelines (http://msdn.microsoft.com/en-us/library/ms229042.aspx)
* also every files has a Licese region, check if it meets your needs

New Post: krypton datagridview

Hi

I have a krypton datagridview where i would love to implement this filter. Is there any way that i can keep the kryptondatagridview?

Thanks

Edited Unassigned: Filtering on date returns no result when date2 is before date1 [1346]

On a column that contains date, when you filter between two date, if the second date is before the first date, then no data are displayed.

![FileringOnDate](http://i.imgur.com/rhYSqg2.png)

In the OKButton_Click method of the SetFilterForm class you should write :

```C#
else if (this.FilterTypeComboBox.Text == this.RM.GetString("setfilterform_filtertypecombobox_between"))
{
DateTime dt1 = ((DateTimePicker)this.val2contol).Value;
if (dt.CompareTo(dt1) > 0)
{
DateTime tempDateTime = dt;
dt = dt1;
dt1 = tempDateTime;
}

if (this.timeFilter)
{
this.filterString += ">= '" + dt.ToString("o") + "'";
this.filterString += " AND " + column + "<= '" + dt1.ToString("o") + "'";
}
else
{
this.filterString += ">= '" + dt.ToShortDateString() + "'";
this.filterString += " AND " + column + "<= '" + dt1.ToShortDateString() + "'";
}
}
```

Commented Unassigned: Project in visual basic [1418]

Hello
Please it could facilitate the project in vb?
Thanks
Comments: ** Comment from web user: Zubyme **

Sorry Lalico. i don`t have so much time for rewrite code

Maybe you can use compiled Dll in you project instead
Or find some automatic code translators (if they exists)
Or try to connect with Davide Gironi (http://davidegironi.blogspot.it/) who do some pathces and refactoring for project

Commented Unassigned: Feature request: If filter is disabled enable column sorting [1348]

It would be nice if when filtering is disabled then the column headers revert back to standard DataGridViewColumnSortMode.Automatic behavior, i.e. clicking on header sorts and shows sorting glyph.

e.g. when the IBindingListView.SupportsFiltering is false.

Great work BTW
Comments: ** Comment from web user: Zubyme **

will be in next release

Edited Unassigned: Feature request: If filter is disabled enable column sorting [1348]

It would be nice if when filtering is disabled then the column headers revert back to standard DataGridViewColumnSortMode.Automatic behavior, i.e. clicking on header sorts and shows sorting glyph.

e.g. when the IBindingListView.SupportsFiltering is false.

Great work BTW

New Post: krypton datagridview

warnings are not important, the compiler warns that just missed the description of the public method / property.
If the library is compiled successfully, you can try to use.
But it is better to connect to the new project is not compiled DLL, but the source code to see runtime exception

New Post: What implementations of IBindingListView does this support?

you always can create you own sort/filter string
private void dataGridView_FilterStringChanged(object sender, EventArgs e)
        {
               string s = this.dataGridView.FilterString;
              
              // you code to format FilterString

               this.bindingSource.Filter = s;
        }
Viewing all 198 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>