This question is locked. New answers and comments are not allowed.
I found a class on this forum that I need but it is in C# and online conversion tools are not doing the trick to get it converted properly.
Can someone re-write this in VB.net for me?
The line of code that needs to be re-written and cannot be converted with tools properly is in BOLD below.
this.AssociatedObject.RowLoaded +=......
Can someone re-write this in VB.net for me?
The line of code that needs to be re-written and cannot be converted with tools properly is in BOLD below.
this.AssociatedObject.RowLoaded +=......
using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Windows.Interactivity; using Telerik.Windows.Controls; using Telerik.Windows.Controls.GridView; using System.Windows.Data; namespace ConditionalCellFormatting { public class ConditionalFormattingBehavior : Behavior<RadGridView> { protected override void OnAttached() { base.OnAttached(); this.AssociatedObject.RowLoaded += new EventHandler<Telerik.Windows.Controls.GridView.RowLoadedEventArgs>(AssociatedObject_RowLoaded); } void AssociatedObject_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e) { if ((e.Row is GridViewHeaderRow) || (e.Row is GridViewFooterRow) || (e.Row is GridViewNewRow)) return; //we want to apply logic to data rows only Binding colorBinding = new Binding("Price"){Converter = new PriceToColorConverter()}; e.Row.Cells[1].SetBinding(GridViewCell.ForegroundProperty, colorBinding); //e.Row.Cells[1].SetBinding(GridViewCell.BackgroundProperty, colorBinding); } } } 