Unbound a TrueDBGrid

Posted by: alemanreyeskevin on 28 June 2018, 1:33 pm EST

    • Post Options:
    • Link

    Posted 28 June 2018, 1:33 pm EST

    Hello Everyone

    I’ am new using Component One in WinForms and I have a question,

    How Can I Unbound a TrueDBGrid?

    I’m trying to do a For Blucle in a TrueDBGrid, like

    For Each Row In Me.DGVDetalles.Rows

    Statement 1

    Next

    But it launches an error : Not Supported when the grid is bound,

    Data source is not a database and columns has not DataField, just caption

    I defined columns in Designer

    I want to know how can I Fix it ?

  • Posted 29 June 2018, 12:58 am EST

    Hi,

    You need to use SetDataBinding method (without any parameters) to use TrueDBGrid in Unbound mode.

    You can refer to the following link to use TrueDBGrid in Unbound mode:

    http://help.grapecity.com/componentone/NetHelp/c1truedbgrid/webframe.html#creatinganunboundgri.html

    Thanks.

  • Posted 29 June 2018, 11:24 am EST

    This my column definition,

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Empresa”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Proyecto”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Departamento”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Clasificador”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Categoria”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Folio”), GetType(Integer)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“FolioSolPago”), GetType(Integer)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“FechaSolicitud”), GetType(Date)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“SemanaSolicitada”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“FechaDePago”), GetType(Date)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“SemanaDePago”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“RazonSocial”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Concepto”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Importe”), GetType(Double)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Moneda”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Paridad”), GetType(Double)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Tipo”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Total”), GetType(Double)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Usuario”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Fecha”), GetType(Date)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“idUbicacion”), GetType(Integer)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“id”), GetType(Integer)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“PlanPago”), GetType(Boolean)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“idClasificador”), GetType(Integer)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“FolioPago”), GetType(String)))

    Me.DGVDetalles.Columns.Add(New C1.Win.C1TrueDBGrid.C1DataColumn((“Emitido”), GetType(Boolean)))

    Me.DGVDetalles.SetDataBinding()

    Me.DGVDetalles.AllowFilter = True

  • Posted 29 June 2018, 12:54 pm EST

    Thanks it Works,

    But now I have problems with Filtering Bar, it’s filtering in some columns and I haven’t added any extra method for them; Does filtering bar work only with TrueDBGrid Bounded ?, Exists any method to use filtering bar in an unbounded TrueDBGrid ?

  • Posted 2 July 2018, 1:58 am EST

    Hi,

    I used the code you posted but I didn’t get the problem where only some of the columns are filtered. In my case, none of the columns have filter bar (or dropdown).

    In any case you can enable FilterBar (or FilterDropdown) on any column using the corresponding properties.

    For FilterBar, you can use the code below:

    
    Me.DGVDetalles.AFilterBar = True
    
    

    Or, if you want FilterDropdown with a list of values with checkboxes, you can use the following code:

    
    For Each column As C1.Win.C1TrueDBGrid.C1DataColumn In DGVDetalles.Columns
                column.FilterDropdown = True
    Next
    
    

    Please find the attached sample demonstrating the same.

    Thanks.

    FilterColumns.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels