[HOW TO] Use a FilterBar |
Post Reply |
Author | |
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
Posted: 30 April 2011 at 4:34am |
Should be good if Report Control to hold a FilterBar like this (C1 TrueDBGrid control):
Thank
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi,
There is an example of how to do this already in the ReportControl samples. I have already used it in one of my projects. I tweaked the code however to allow for multiple filter selections. |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Yes, your refer to Excel sample.
But I can choose only for existing values from the combo.
There is a way to apply the filter while typing something in a row filter?
The ValueChanged and ValueChanging events will not fire.
There is other event for this use?
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Yes, there is: InplaceEditChanging event
Something like this:
Private Sub wndReportControl_InplaceEditChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, NewValue As String, Cancel As Boolean)
Dim xtremeColumn As XtremeReportControl.ReportColumn For Each xtremeColumn In Me.wndReportControl.Columns 'Only allow filter in particular column xtremeColumn.Filtrable = xtremeColumn.ItemIndex = Column.ItemIndex
Next xtremeColumn Me.wndReportControl.FilterText = NewValue 'Only necessary to store selection if Focus is lost when calling .Populate in timer event
currentSelectedRow = Row.Index
currentSelectedColumn = Column.ItemIndex
'We need to update RC with call .Populate but wouldn't do that if I were you :P 'IDE will crash !!! Also with compiled exe 'Me.wndReportControlCountersTable.Populate 'Don't see a way to update RC with applied filter except using a timer...
TimerUpdateFilter.Enabled = True End Sub Private Sub TimerUpdateFilter_Timer()
Me.TimerUpdateFilter.Enabled = False With Me.wndReportControl .Populate 'Don't know if Focus will be lost with HeaderRows (only tried with ReportRecords) if not
'forget following code...
.Navigator.MoveToRow currentSelectedRow .Navigator.MoveToColumn currentSelectedColumn .Navigator.BeginEdit
End With End Sub Maybe Andre has a solution to get around this without a hack
Good luck !
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Thank Aaron,
but your code don't work.
i.e. :
- I press 'S' in Subject column: grid become empty
- Focus is always lost, so I can't continue to insert other chars.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi, Maybe you can try this: Private Sub TimerUpdateFilter_Timer() Maybe focus will stay in headerrow now...
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Thank Aaron,
using .Navigator.CurrentFocusInHeadersRows = True
the focus is correct.
However,
the FilterText property allow to use a single-value for all columns, is good, but does't what you want.
I would apply a multi-column filter, not a single-column filter. I want insert texts in different columns to set a filter as a SQL statement as below:
display records WHERE
columns(1) LIKE <value1> AND columns(3) LIKE <value3>
It's possible?
Thank
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi gibra,
Yes a multiple filter can be done as I said in my first reply in this post. You need to change the code in the "FilterRows" procedure to suit the requirements of a multiple filter. Below is the changed code in the "FilterRows" procedure I used to allow the use of a multiple filter:
|
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Thank Xander75 for your reply.
I will try later.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |