I am doing some formating in my InitializeRow event.
I am checking the e.ReInitialize argument to test if it is a re-initialize or not.
When I perform a grid print using UltraGridPrintDocument the InitializeRow event fires and I test the e.ReInitialize argument. It is false.
Shouldn't it be true here?
I don't want to reformat all that data again.
Does anyone have a similar issue?
-duane
Mike,
Sorry about that. I forgot to include the class.
Private Class Comm_FilterCondition Inherits FilterCondition Public Sub New(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) End Sub Public Sub New(ByVal column As UltraGridColumn, ByVal comparisionOperator As FilterComparisionOperator, ByVal compareValue As Object) MyBase.new(column, comparisionOperator, compareValue) End Sub Public Overrides Function MeetsCriteria(ByVal row As Infragistics.Win.UltraWinGrid.UltraGridRow) As Boolean Dim cellText As String = row.Cells(Me.Column.Key).Value.ToString() If Me.ComparisionOperator = FilterComparisionOperator.Match Then Return cellText.ToLower = Me.CompareValue.ToString.ToLower Else Return cellText.Contains(Me.CompareValue.ToString()) End If End Function End Class
I can use the class here, but the question I have is why do I have to use the class? why can't the filtercondition (Option #1) get the correct records? Why does it include records that are clearly not a match?
If i ask for a filter on Territory 1, then I should only get matches for territory 1....not 11 and 21 and anything else that ends with 1.
Am i missing something with the filterconditions?
I tried putting this code in my Sub before the grid.print, but it did the same.
I'm not sure I understand the question. Clearly, if you are getting different results, then your Comm_FilterCondition class's MeetsCriteria method must be doing something differently then the grid's default filtering logic.
Since I don't have you Comm_FilterCondition class, I don't see what useful advice I can offer you on why that's happening.
My filters were working well until I put them into the InitializePrint event. I like the fact that I can change the layouts in there instead of changing my screen layout. I am assuming I can also change the filtering in the InitializePrint event.
I ran into a problem with this.
I set a filter variable in code and pick it up in the InitializePrint event( it is called _terrSort).
_terrSort is a 2 digit code (1 to 99).
If I run the following code with _terrSort=1 using code option #1 I get 1's, 11's and 21's.
If I run the following code with _terrSort=1 using code option #2 I get only 1's(which is correct).
Option #2 uses the class I built, but the code in option #1 does the same thing.
Why do I get two different sets of results?
Private Sub ug_CommissionDetail_InitializePrint(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelablePrintEventArgs) Handles ug_CommissionDetail.InitializePrint If e.PrintLayout.IsPrintLayout Then Dim colfilter As ColumnFilter Dim column As UltraGridColumn colfilter = e.PrintLayout.Bands(0).ColumnFilters("PTRTRY") column = e.PrintLayout.Bands(0).Columns("PTRTRY")
With e.PrintLayout.Bands(0) .ColumnFilters.ClearAllFilters()option 1---> .ColumnFilters("PTRTRY").FilterConditions.Add(FilterComparisionOperator.Match, _terrSort)
option 2---> colfilter.FilterConditions.Add(New Comm_FilterCondition(column,
FilterComparisionOperator.Match, _terrSort))
End With
End If
KDuaneS said:So, since it does clone the layout, I am assuming I can get to the printout layout and modify it without effecting my grid layout?
Yes, you can. That's the main reason we do it. :)
KDuaneS said:Can I apply appstyles to it?
Well, Appstyling is static to the application. So you can't apply a different Application Style to the printed layout than you have applied to the on-screen layout.
Hey Mike,
I did not know it cloned the gridlayout like that. That would explain it.
So, since it does clone the layout, I am assuming I can get to the printout layout and modify it without effecting my grid layout?
Can I apply appstyles to it?