|
-
Jan 9th, 2007, 09:41 AM
#1
Thread Starter
Fanatic Member
Filter text disappearing in C1TrueDBGrid VB.NET 2003
Edit: VB.Net 2003
Hello,
I am using a C1TrueDBGrid (a ComponentOne object) that allows filtering on each column. My problem is that when I refresh data any text in the filter boxes on the grid are erased. The filtering still works because that is saved, but the text itself disappears. There is another place in the program where this doesn't happen, and I think I know why. In the other place the Datasource is set in the designer. However, this part of the program needs to be very dynamic, so the dataset is built on the fly and then bound to the grid.
VB Code:
ds.Clear()
sqlDA.Fill(ds.Tables(0))
Me.tdbgrdCPE.SetDataBinding(ds.Tables(0), "", True)
Is this what is causing any text in the filter boxes to disappear?
Also, like I said, the filter string is saved, but you can't just set the grid's filter to the filter string and have it repopulate those filter boxes. Any ideas? Or am I just screwed?
Last edited by 18experience; Mar 23rd, 2010 at 09:37 AM.
-
Jan 23rd, 2007, 12:23 PM
#2
Frenzied Member
Re: Filter text disappearing in C1TrueDBGrid VB.NET 2003
Hi Mate,
I also use the same grid. How do you set the filtering for the grid?
Cheers,
Jiggy!
-
Jan 23rd, 2007, 01:43 PM
#3
Thread Starter
Fanatic Member
Re: Filter text disappearing in C1TrueDBGrid VB.NET 2003
I think you set the FilterBar property to true, but I'm not the one who did it. By the way, the problem was these lines (not sure which exactly):
VB Code:
Me.tdbgrd.Columns.Clear()
Me.tdbgrd.Splits(0).DisplayColumns.Clear()
and here is how I fixed it:
VB Code:
Public ColumnFilterText As New ArrayList
Private Sub SaveColumnFilterText()
Me.ColumnFilterText.Clear()
For Each col As C1DisplayColumn In Me.tdbgrd.Splits(0).DisplayColumns
Me.ColumnFilterText.Add(col.DataColumn.FilterText)
Next
End Sub
Private Sub ReloadColumnFilterText()
Dim i As Integer = 0
For Each col As C1DisplayColumn In Me.tdbgrd.Splits(0).DisplayColumns
If i = Me.ColumnFilterText.Count Then Exit For
col.DataColumn.FilterText = Me.ColumnFilterText.Item(i)
i += 1
Next
End Sub
VB.Net 2008
.Net Framework 2.0
"Must you breathe? 'Cause I need heaven..."
-
Jan 23rd, 2007, 02:16 PM
#4
Frenzied Member
Re: Filter text disappearing in C1TrueDBGrid VB.NET 2003
Thanks mate for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|