Hi,
first of all I'm sorry for my English.
I'm a new user, I'm trying to binding a fieldFilterDescription property (value) to Textbox Property (text)
I used an example found in this forum "SilverlightGridCustomFilterRow"
In SilverlightGridCustomFilterRow the binding work well, but in my vb code WPF
the binding don't work.
When I change the textboxproperty don't change the fieldFilterDescription property
What's Wrong?
Best regards
Marco
first of all I'm sorry for my English.
I'm a new user, I'm trying to binding a fieldFilterDescription property (value) to Textbox Property (text)
I used an example found in this forum "SilverlightGridCustomFilterRow"
In SilverlightGridCustomFilterRow the binding work well, but in my vb code WPF
the binding don't work.
When I change the textboxproperty don't change the fieldFilterDescription property
What's Wrong?
| Dim ffd As FieldFilterDescription = Nothing |
| For Each cell As GridViewHeaderCell In cells |
| Dim column As GridViewDataColumn = DirectCast(cell.Column, GridViewDataColumn) |
| Dim descriptions As IEnumerable(Of FieldFilterDescription) = radGridView.FilterDescriptors.OfType(Of FieldFilterDescription)() |
| ffd = (From fd In descriptions Where fd.FieldName = column.UniqueName Select fd).FirstOrDefault() |
| Dim element As FrameworkElement = Nothing |
| element = New TextBox() |
| element.Height = 24 |
| element.Margin = New Thickness(3, 3, 3, 5) |
| If ffd IsNot Nothing Then |
| ffd.Filter1.[Operator] = Telerik.Windows.Data.FilterOperator.Contains |
| BindText(element, "Value", ffd.Filter1) |
| End If |
| next |
| Private Sub BindText(ByVal ptextBox As TextBox, ByVal pproperty As String, ByVal source As Object) |
| Dim textProp As DependencyProperty = TextBox.TextProperty |
| If Not BindingOperations.IsDataBound(ptextBox, textProp) Then |
| Dim b As Binding = New Binding(pproperty) |
| b.Source = source |
| b.Mode = BindingMode.TwoWay |
| b.Path = New PropertyPath(pproperty) |
| ptextBox.SetBinding(TextBox.TextProperty, b) |
| End If |
| End Sub |
Best regards
Marco