Home Forums WinForms controls Xceed Grid for WinForms valuechanged during Reply To: valuechanged during

User (Old forums)
Member
Post count: 23064

Yeah sure sorry, I’ve been working with C# so much that trying to remember what the VB.NET code is gets me all confused.

Yeah DirectCast should be called like this DirectCast(object, type) so
Dim changingCell As Xceed.Grid.DataCell = DirectCast(sender, Xceed.Grid.DataCell)

DirectCast is better than Cast in Vb.NET because if it can’t convert it it returns Nothing instead of throwing an exception and interestingly it has a slight (but only minisucle) performance enhancement (again). I’ve read it somewhere but I can’t remember where.

Yeah as I said it’s probably easier to inherit from the classes. Adding handlers is not wrong but reading the MSDN documentation inheriting doesn’t use delgates and only virtual method calls so is slightly better on performance, plus you don’t have to worry about adding more than one handler to a cell.

Hope this helps

Imported from legacy forums. Posted by Chris (had 358 views)