Code Monkey home page Code Monkey logo

advanceddatagridview's Introduction

About

Advanced DataGridView is a .NET WinForms DataGridView with advanced Filtering and Sorting capabilities.

Download

Requirements

  • Microsoft Windows with .NET Framework 4, .NET Core 5 or later

FAQ

Development

If you want to contribute, or you found a bug, please send an e-mail to the software author.

License

Copyright (c) Davide Gironi, 2015
Advanced DataGridView is an open source software licensed under the Microsoft Public License (Ms-PL) license
Original work Copyright (c), 2013 Zuby [email protected] http://adgv.codeplex.com

advanceddatagridview's People

Contributors

aqibchattha avatar christopherguay avatar davidegironi avatar rickardstolt avatar winprogrammer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advanceddatagridview's Issues

SetFilterChecklistEnabled and slow checklist filters

Thanks for making this control. The excel like filters are great, I just have a question regarding the checklistfilters.

        foreach (DataGridViewColumn col in applicationGridView.Columns)
        {
            applicationGridView.SetFilterChecklistEnabled(col, show);
        }

I1m working with large datasets (100K+) . Unfortunately, the checklist filters are very slow with that many rows. So I attempted to turn them off using the code above.
I have 4 grids displaying at the same time using the same inherited control.
In the first grid I get Filter list is disabled.

But on the next grid the checklistfilter is showing, disabled as in not selectable, and also very slow again.

62CB04DC-0A82-4642-A1E6-F7E23A019479_4_5005_c

90D2C90A-F80A-4F6F-8E3B-F99C59B420E1_4_5005_c

Thanks again.

Potential Solution for when you want to bind to a list of objects instead of a DataTable

I had a need to bind my DataGridView to a List of objects instead of a DataTable.

But of course, in its current form the ADGV does not let you bind to a list of objects. The FilterStringChanged and SortStringChanged events fire but nothing happens.

So I thought I would have a play with this today. I found out that there is a nuget library that allows you to pass a dynamic string to the Where clause of a Linq query. So instead of doing this:

Where(x => x.Field1 == "SomeValue")

...you can pass a string through, like this:

.Where("Field1='SomeValue'")

When the FilterStringChanged event is fired we get the users filter string. For example:

([string] IN ('10 str', '100 str')) AND ([decimal] IN (66.66, 77.77))

So I wrote a function to convert the above string to a format that Dynamic Linq requires:

(string.Contains('10 str') or string.Contains('100 str')) AND (decimal != null && (decimal.Contains(66.66) or decimal.Contains(77.77) )

And it works!!!

You can nuget the dynamic Linq library is from here: https://github.com/kahanu/System.Linq.Dynamic

This is my code:

List<DataPointGridViewModel> m_dataGridBindingList = null;
List<DataPointGridViewModel> m_filteredList = null;

private void dataGridView2_FilterStringChanged(object sender, Zuby.ADGV.AdvancedDataGridView.FilterEventArgs e)
{
    try
    {
        if ( string.IsNullOrEmpty(dataGridView2.FilterString) == true )
        {
            m_filteredList = m_dataGridBindingList;
            dataGridView2.DataSource = m_dataGridBindingList;
        }
        else
        {
            var listfilter = FilterStringconverter(dataGridView2.FilterString);

            m_filteredList = m_filteredList.Where(listfilter).ToList();

            dataGridView2.DataSource = m_filteredList;
        }
    }
    catch (Exception ex)
    {
        Log.Error(ex, MethodBase.GetCurrentMethod().Name);
    }
}

and the string converter function looks like this:

private string FilterStringconverter(string filter)
{
    string newColFilter = "";

    // get rid of all the parenthesis 
    filter = filter.Replace("(", "").Replace(")", "");

    // now split the string on the 'and' (each grid column)
    var colFilterList = filter.Split(new string[] { "AND" }, StringSplitOptions.None);

    string andOperator = "";

    foreach (var colFilter in colFilterList)
    {
        newColFilter += andOperator;

        // split string on the 'in'
        var temp1 = colFilter.Trim().Split(new string[] { "IN" }, StringSplitOptions.None);

        // get string between square brackets
        var colName = temp1[0].Split('[', ']')[1].Trim();

        // prepare beginning of linq statement
        newColFilter += string.Format("({0} != null && (", colName);

        string orOperator = "";

        var filterValsList = temp1[1].Split(',');

        foreach (var filterVal in filterValsList)
        {
            // remove any single quotes before testing if filter is a num or not
            var cleanFilterVal = filterVal.Replace("'", "").Trim();

            double tempNum = 0;
            if (Double.TryParse(cleanFilterVal, out tempNum))
                newColFilter += string.Format("{0} {1} = {2}", orOperator, colName, cleanFilterVal.Trim());
            else
                newColFilter += string.Format("{0} {1}.Contains('{2}')", orOperator, colName, cleanFilterVal.Trim());

            orOperator = " OR ";
        }

        newColFilter += "))";

        andOperator = " AND ";
    }

    // replace all single quotes with double quotes
    return newColFilter.Replace("'", "\"");
}


Finally, here is the sort function:

private void dataGridView2_SortStringChanged(object sender, Zuby.ADGV.AdvancedDataGridView.SortEventArgs e)
{
    try
    {
        if (string.IsNullOrEmpty(dataGridView2.SortString) == true)
            return;

        var sortStr = dataGridView2.SortString.Replace("[", "").Replace("]", "");

        if (string.IsNullOrEmpty(dataGridView2.FilterString) == true)
        {
            // the grid is not filtered!
            m_dataGridBindingList = m_dataGridBindingList.OrderBy(sortStr).ToList();
            dataGridView2.DataSource = m_dataGridBindingList;
        }
        else
        {
            // the grid is filtered!
            m_filteredList = m_filteredList.OrderBy(sortStr).ToList();
            dataGridView2.DataSource = m_filteredList;
        }
    }
    catch (Exception ex)
    {
        Log.Error(ex, MethodBase.GetCurrentMethod().Name);
    }
}

I know, its a bit of work around but it works for me so I thought I would share it here.

Working with pre-designed columns

Hi! I have an AdvancedDGV with columns pre-designed (using the VS designer) and I cannot make datetime and int columns works with sorting and filtering, it works like text sort/filter.

Is there any way to achieve custom sorting/filtering for pre-designed columns?

hide or show column panel

If add a panel to control the Visible property of all columns, it would be great.
Like this, when you right-click a column header, a panel will pop up, you can control to hide the current column, display all columns, and display and hide all other columns. When the mouse click other position of the DataGridView, the panel will disappears.
datagridview column hidden panel

bitmap columns

Hello, I thank you very much for your magnificent work. Today I have tried to use the Advanced DataGridView control but the filter and sorting of bitmap type columns does not work. I use the column of type bitmap to list the complete and pending tasks, it will be very interesting to add a functionality to sort and list this type of columns basing for example on its index.
Forgive for my language I do not speak English.
Thank you

Sorting on dates causes issues

I have a column with dates (YYYY-MM-DD) and when I try to sort the data on one date it returns no rows. Even though I can clearly see that I have exactly that date in my data, and it even shows in the filter list.
However, if I add a custom sort with from and to date as the same date, it returns all the correct data.

This issue is only happening with dates, as far as i can tell at the moment.

Advanced Datagrid View - Visual Basic

Hello,

I'm trying to use ADVG with Visual Basic.

So far I'm doing fine for the basic functions and I'm really happy that ADVG is a consistent project.

Q1: How can i programatically change the sort icon from Ascending to Descending?

I would appreciate it very much if you could share some visual basic examples.
Thanks very much

Port to .NET 5

The future of .NET is .NET 5 :)
It appears the DG.AdvancedDataGridView NuGet package actually works on a .NET 5 project (even if NuGet complains), it looks like it's at least partly compatible.
Any chance of officially targeting .NET 5 in a future release?

[Suggestion] Writing in the node filter on big data sets

I'm working on quite large data sets and when I try to write a filter in the text box above the tree node, it updates the result after every character. Having 10k+ unique posts makes that update process tedious.

What i would want is to have the tree node update first when the user is done writing what he is looking for. And also to make it asynchronous so the entire computer won't freeze for every search.

I haven't find the place in the code myself, where this is happening. So that's why I'm commenting here to see if my suggestion is even possible?

Sort string contains a property that is not in the IBindingList.

Advanceddatagridview is crashing when trying to sort any column of any type:

System.ArgumentException HResult=0x80070057 Message=Sort string contains a property that is not in the IBindingList.. Source=System.Windows.Forms Ślad stosu: at System.Windows.Forms.BindingSource.ParseSortString(String sortString) at System.Windows.Forms.BindingSource.set_InnerListSort(String value) at Zuby.ADGV.AdvancedDataGridView.TriggerSortStringChanged() at Zuby.ADGV.AdvancedDataGridView.Cell_SortChanged(Object sender, ColumnHeaderCellEventArgs e) at Zuby.ADGV.ColumnHeaderCell.MenuStrip_SortChanged(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at Zuby.ADGV.MenuStrip.SortDESCMenuItem_Click(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at Microsoft.VisualStudio.Tools.UserControlTestContainer.Main(String[] args)

Code that I'm running:

>  private void BindDataTest()
>         {
>             sqlConnnectionString = @"Server=L674\SQLEXPRESS;Database=devDB;Trusted_Connection=True;";
>             sqlQuery = @"SELECT * FROM devTable;";
> 
>             SqlConnection sqlCon = new SqlConnection(sqlConnnectionString);
>             SqlDataAdapter sqlDA = new SqlDataAdapter(sqlQuery, sqlCon);
>             
>             sqlDT = new DataTable();
>             sqlDS = new DataSet();
> 
>             try
>             {
>                 sqlCon.Open();
>                 sqlDA.Fill(sqlDS, "devTable");
>                 sqlCon.Close();
>                 
>  
>                 bindingSource.DataSource = sqlDS;
> 
>                 dataGrid.SetDoubleBuffered();
>                 dataGrid.DataSource = bindingSource;
>                 dataGrid.DataMember = "devTable";
> 
>             }
>             catch (Exception e)
>             {
>                 MessageBox.Show(e.Message, "Exception in SQLTable");
>             }
> 
>         }

image

Filter does not work too.

Inconsistent naming for sort & filter enable/disable functions

In the AdvancedDataGridView class, we have

public void DisableFilterAndSort(DataGridViewColumn column);
public void EnableFilterAndSort(DataGridViewColumn column);

But we also have

public void SetFilterEnabled(DataGridViewColumn column, bool enabled);
public void SetSortEnabled(DataGridViewColumn column, bool enabled);

As someone who had to read through the code to find out how things worked, these function names are inconsistent and cause confusion. Enable/DisableFilterAndSort completely disables the column header dropdown, and calling SetFilterEnabled will not turn on filtering.

Furthermore, Having SetFilter/SortEnabled accept a bool where earlier we have Enable/Disable as function names is unintuitive. My recommendation would be to change these functions to either all be

public void DisableFilterAndSort(DataGridViewColumn column);
public void EnableFilterAndSort(DataGridViewColumn column);
public void DisableFilter(DataGridViewColumn column);
public void EnableFilter(DataGridViewColumn column);
public void DisableSort(DataGridViewColumn column);
public void EnableSort(DataGridViewColumn column);

or

public void SetFilterAndSortEnabled(DataGridViewColumn column, bool enabled);
public void SetFilterEnabled(DataGridViewColumn column, bool enabled);
public void SetSortEnabled(DataGridViewColumn column, bool enabled);

The second honestly is probably the way to go, as it would make things easier to control if sort/filter is enabled programmatically by passing the value of, for example, a checkbox to the function.

Set Filter String Programatically

Hello,

I've two forms.

Main form with some buttons and combos and one form with an ADGV.

How can I open the form with the ADGV and programatically set the filter for two columns according to the selections of the main form

Thanks in advance,
JM

Risizing filter dialog

Hello,
after resizing (increasing) a filter dialog, the size grip right bottom vanishes and you cannot resize this filter dialog anymore. Dialog looks different diesigned after resizing.
Behavior persists on reopening and belongs to just the selected column.

Regards
LiTe

Dates not filtering when SetMenuStripFilterNOTINLogic(true) is set.

Hi there,

Thank you again for the previous "SetMenuStripFilterNOTINLogic()" addition. It is working perfect for me.

I have, however found a side-effect issue when setting MenuStripFilterNOTINLogic to true to do with filtering of dates.

I have a fix which is working for me but just wanted to pass it via you.

DESCRIPTION OF PROBLEM

In the demo app, if you call the function: SetMenuStripFilterNOTINLogic(true) passing true through, then try filtering the dates column they no longer work.

FIX FOR PROBLEM

The code I have changed is in the MenuStrip.cs file in the SetCheckListFilter() function.

When you filter on a date the function BuildNodesFilterString() gets called. For some reason it fails when selecting dates!!

string filter = BuildNodesFilterString(
    (IsFilterNOTINLogicEnabled ?
        checkList.Nodes.AsParallel().Cast<TreeNodeItemSelector>().Where(
        n => n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectAll
            && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty
            && n.CheckState == CheckState.Unchecked
    ) :
    checkList.Nodes.AsParallel().Cast<TreeNodeItemSelector>().Where(
        n => n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectAll
            && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty
            && n.CheckState != CheckState.Unchecked
    ))
);

I have modified that section of code to the following and it now works for me. Essentially I am checking to see if FilterNOTIn logic is enabled and the column being filtered is of type DateTime.

The new code looks like this:

IEnumerable<TreeNodeItemSelector> tempList = null;
if (IsFilterNOTINLogicEnabled == true && DataType != typeof(DateTime))
{
    tempList = checkList.Nodes.AsParallel().Cast<TreeNodeItemSelector>().Where(
        n => n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectAll
            && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty
            && n.CheckState == CheckState.Unchecked);
}
else
{
    tempList = checkList.Nodes.AsParallel().Cast<TreeNodeItemSelector>().Where(
        n => n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectAll
            && n.NodeType != TreeNodeItemSelector.CustomNodeType.SelectEmpty
            && n.CheckState != CheckState.Unchecked
    );
 }

string filter = BuildNodesFilterString(tempList);

In the demo app, this code works for filtering of dates.

Thanks.

Checkbox filters not localized in French

Hi I have a small issue around filter translations concerning checkbox type columns.
The filters say True / false where they should say Vrais/Faux or Oui/Non ..
Can this be overwritten or fixed ?
Thanks !!!
chkbox_filter

Filter not working if cell contains [ _

The filter in MenuStrip.cs is not working if a cell contains special characters like [ _.

with this change in MenuStrip.cs Row 614+615, it works just fine (needs some more testing)

               foreach (TreeNodeItemSelector n in nodes)
                    sb.Append("'" + n.Value.ToString() + "'" + appx);
                // OLD:  sb.Append("'" + FormatFilterString(n.Value.ToString()) + "'" + appx);

Filtering Issue using IN clause instead of NOT IN

First of all, I want to say GREAT project. Good stuff.

I have found an issue, when filtering out the zeros (0) using the checkbox.

After you do this, when you edit the value of one the cells "in the column that was filtered", the row then disappears from the grid and when the event handler for CellEndEdit fires the value is null for the row/column that was edited.

I tracked the issue to the use of the "IN" clause in the filtering code.

DESCRIPTION OF PROBLEM

For example, say you have 5 rows with the following values:

row 1 = 100
row 2 = 0
row 3 = 200
row 4 = 0
row 5 = 300

Then the user selects the filter menu on the column and ticks the checkbox to "not" display zeros. In the background your DataTable filter looks like this:

[{0}] IN (100, 200, 300)

The filter is including all the values that are ticked. The grid then looks (obviously) like this:

row 1 = 100
row 3 = 200
row 5 = 300

Now, if the user modifies row 3 to equal 600, becauase 600 is not in the datatable "IN" clause filter the row disapears from the grid, and even the CellEndEdit doesnt capture the users modification.

FIX FOR PROBLEM

I swapped the code from an "IN" to a "NOT IN" and it seems to fix this problem. So the code finds out all the cells that are NOT ticked and uses a "NOT IN" clause for the filter.

e.g: [{0}] NOT IN (0, 1)

Then, when the user modifies any of the value, the row doesnt disppear because the values still satisfy the filter clause.

CODE I HAVE MODIFIED

The code that I have changed is in the SetCheckListFilter() function.

I changed 4 lines in total:

Original Line = "&& n.CheckState != CheckState.Unchecked"
Changed Line = "&& n.CheckState == CheckState.Unchecked"

Original Line = "FilterString += "[{0}] IN (" + filter + ")";"
Changed Line = "FilterString += "[{0}] NOT IN (" + filter + ")";"

Original Line = FilterString += "Convert([{0}],System.String) IN (" + filter + ")";"
Changed Line = "FilterString += "Convert([{0}],System.String) NOT IN (" + filter + ")";"

Also you didn't specify decimal in your list of datatypes (thats what I am using to represent money)

I have added: "DataType == typeof(decimal)" to the list of datatypes in that funtion.

Sorry. I am sure there is a better way of showing you the code I have modified instead of writing it out here!

SUMMARY

I just wanted to send this to you to get your thoughts on the fix I have applied.

Thanks.

Re-click on the filter button

For an instance, I opened the filter menustrip by clicking the filter button. The filter menu is now open. If I want to close the filter menu, either I have to click on 'Cancel' button or I have to click somewhere else on the datagridview. But we I re-click on the same filter button (of the column which already menustrip is open), the filter menustrip closes and opens again. On this second click, it should only close and should not open again.
Note: I dont know where to post suggestions, so I posted here.

filter dialog slow to open with large datagridview

I'm using a datagridview that has over 100k rows and its very slow to get the filtering dialog box to appear. It usually takes 5 or 6 minutes to open but after that the filtering works fine. I love this control but is there any possible way to speed it up? I think the issue might be with populating the unique values in the filtering dialog box.

Search box

Hi,

I am using your ADV, and I have to say that it's great, however in the previous releases there was a search text box in the Columns filter. Please is there a way to have it back.
missing_adgv

Filtering stops working on second view

I'm trying to use the Advanced DataGridView in several different forms (viewing different data) within the same project. When the form is first viewed, the sorting and filtering works great. If I close that form and then relaunch the same form, the grid is there but the sorting and filtering no longer work (the down arrows don't respond). Any idea what I'm doing wrong?

New feature request: SetFilterCustomVisibility

"SetFilterCustomVisibility" would be great feature. I mean: I will never let user use custom filters, so user may be confused if custom filters are visible (even grayed as inactive with SetFilterCustomEnabled). Would be clearer, if there wouldn't be custom filter menu items visible at all.

Deselected filter items gone after filtering a second column

Hello,

I have an issue with the filters on the AdvancedDataGridView.
Using the sample, when I deselect "1 str" and "10 str" in the filter of the "string" column and click the "Filter" button. "1 str" and "10 str" are filtered out.
Opening the filter again I see the items "1 str" and "10 str" are deselected.
Now I deselect "0" in the "decimal" column and click the "Filter" button.
Re-opening the "decimal" filter will show the item "0" as deselected.
All oke so far.
Going back to "string" column filter "1 str" and "10 str" are gone.
I can not reselect them without resetting the column filter!

Any idea how to fix this?

Calling SetFilterEnabled or SetSortEnabled after DisableFilterAndSort has been called does nothing

When 'DisableFilterAndSort' as is called for a column, the features of "Filter" and "Sort" cannot be turned on individually through 'SetFilterEnabled' or 'SetSortEnabled'

I think it might make more sense to remove 'DisableFilterAndSort' and 'EnableFilterAndSort' completely, and simply disable the individual "Filter" and "Sort" features exclusively through 'SetFilterEnabled' and 'SetSortEnabled'. If both are disabled, then hide the Filter/Sort UI.

Change Dataset or Select Statement at Runtime

Can anyone confirm if AdvancedDataGridView works with a DataSet and TableAdapter programmatically set at runtime?

My program allows a user to select a database and a table or query at runtime to displays the contents. The following snippet is an example where oleConn is the connection to a selected database and sSQL is the select statement for the table/view specified at runtime.

oleAdapter = New OleDb.OleDbDataAdapter
oleAdapter.SelectCommand = New OleDb.OleDbCommand(sSQL, oleConn)
oleAdapter.Fill(oleDataSet)
advgControl.DataSource = oleDataSet.Tables(0)

When I swap in the ADGV, data is populated properly but the sorting and filtering do not work. The drop down appears to show the primary key values for the first field I try to filter and is empty for any other field I select.

Does ADGV only work through the Data Source wizard at design time?

Filter/Sort doesn't work on multiple DataGridViewComboBoxColumn

Hello,

When I add multiple DataGridViewComboBoxColumn, only the first one (on the left) can be filtered/sorted, the other ones display no values in the filtering and the event SortStringChanged is not firing.

image

Here's how I add ComboBoxColumns :

for (int i = 0; i < advancedDataGridView1.Columns.Count; i++)
            {
                DataGridViewColumn column = advancedDataGridView1.Columns[i];
                //listCombobox is a list of string of column I want as combobox
                if (listComboBox.Contains(column.DataPropertyName))
                {

                    advancedDataGridView1.Columns.Remove(column.Name);
                    DataGridViewComboBoxColumn comboboxColumn = new DataGridViewComboBoxColumn();
                    comboboxColumn.DataPropertyName = column.Name;
                    comboboxColumn.HeaderText = column.Name;
                    comboboxColumn.DropDownWidth = 160;
                    comboboxColumn.Width = 150;
                    comboboxColumn.FlatStyle = FlatStyle.Flat;
                    LoadCombobox(comboboxColumn); //Here I set a DataSource, ValueMember and Display member from db
                    comboboxColumn.DataPropertyName = comboboxColumn.ValueMember;

                    advancedDataGridView1.Columns.Insert(i, comboboxColumn);
                }
                
            }

Thanks for your help.

Nuget pack

The work is remarkable but on Nuget store there's the old package.

It's possible to publish the current state of art?

Best regard

Performance issue when binding multiple columns

Steps to replicate

  1. Add 200 - 300 columns in datatabe
  2. bind to advanceddatagrid view

Expected Result:
-It should load fast just like normal datagridview.

Actual Result:
-Binding takes 2-3mins. Compare to normal gridview takes only a 1-2 secs

Hope this helps :)

Edit filter options

Hello,

How can I edit the filter options in the columns?
My DGV is bound to a DataTable, but on the CellFormatting I change the cells in the column from blank to "FPGA", I would like this to be reflected on the filters.

Image of DataGridView

Should I edit the cells in another way?

Filtering on DateTime column with non-midnight time component doesn't return valid FilterString

I have a DateTime column with the format dd/MM/yyyy HH:mm:

image

The values in the underlying DataSource are from a database so have non-midnight time componennts, e.g. 25/06/2020 12:22:44.

This is recognised as a DateTime column:

image

However, when you try to filter by a specific date (you can't filter by a specific hour) it returns no rows .

If I inspect the FilterString that's created, it is producing this:

"((Convert([DATE RAISED], 'System.String') LIKE '%25/06/2020 00:00:00%'))"

The reason this filter returns no rows is because, for example, 25/06/2020 12:22:44 is not like 25/06/2020 00:00:00 (due to the time component).

This same problem exists even if I force the column Format like this: dgv.Columns("DATE RAISED").DefaultCellStyle.Format = "dd/MM/yyyy HH:mm:ss". The FilterString is still setting any time component to 00:00:00. I assume this is because here we're only changing the displayed value and not the underlying value in the DataSource to which the filter is being applied.

If I truncate these dates at the database/query level, the filtering works. This is obviously not an ideal fix when I need to display the time component.

Memory Leaks after MenuStrip.Show()

The MenuStrip object will not be released by GC after executing MenuStrip method "public void Show(Control control, int x, int y, IEnumerable vals)".

Localization support

Can you add some ILocalizationProvider or resource file to setup custom context menu texts?

Going further with even more advanced flexibel filters

Hello,
first of all: Great to see development of this control is going on, many thanks for!

I'm looking for possibilities to take filtering to an very user orientated level. In combination with saving filters this could save so many time, if you need same filters of updated data on regular base.
A good example is checking a logfile for three different complex combined filters/sorts.

Date Descriptive time ranges like 'last 4 hours', 'today', 'last two days', 'this week', 'this month', ...

String Collections with OR connected expressions like {'Starts with Error*"' OR 'Contains "warning"' OR 'Ends with "*expired"}

Interger Collections of OR connected expression like {'= 0' OR 'Between 10 and 20' OR 'Less than 100'}

Ok, thats more than a missing . in a comment ;-)
But maybe possible to add in an upcomming release ...

Thank you for reading my suggestion.
LiTe

RU localization

Hello!
Tell me please, how to enable Russian localization?
Thank you!

Clean sort of one column

Hello,

I've a DGV with 7 columns and a sortstring with multicriteria.

How can I programatically clean the sort of only one column.

Thanks in advance,
JM

LoadFilterAndSort

Hello, a question.... Is possible recover the original columns filters whithout put all the datagrid in "Loaded Mode"?
Thanks.

Advanced DataGridView on manual columns?

I am trying to put a filter on datagridview with ADGV However, when I create Datetime value columns by manually the filter does not display filtering by the Year, Month, and Day values. When the column is created automatically, in runtime this columns shows exactly how to filter. I want to create these DateTime value columns by manually. What should I do?
Auto
### By Auto column
Manually

By manually column

Can I disable checklist?

Could you advise how to disable the checklist of values when the button on column header clicked?
The checklist is useful but OutOfMemory error happens when handing huge number of records (> 500,000).

Btw, thank you very much for this very helpful tool :)

Date filtering not working with SQL source

When using a datatable/table adapter that's getting data from a SQL table filtering on a SQL date column does not seem to work. It treats the data as generic text and doesn't show the more advanced date filtering where you can drill into the years/months. I've confirmed the column in the data table is configured with the appropriate DateTime datatype. I'm using VB.Net.

I've also used the SetFilterDateAndTimeEnabled function on the relevant column and that does not help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.