G
Guest
Any advice on how to use partial classes in C# to subscribe to RowChanging or
ColumnChangine events????
http://msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dnvs05/html/newdtastvs05.asp
is an excellent VB.Net article on using partial classes to validate changes
to DataTable row events. However, this appears impossible using C#!!
VB supports the following approach:
Partial Public Class NorthwindDataSet Partial Class OrdersDataTable
Protected Sub ValidateNewRow(ByVal sender As Object, _ ByVal e As
System.Data.DataTableNewRowEventArgs) _ Handles Me.TableNewRow
C# does not permit wiring in this fashion…
One help article suggests that the event handlers are simply generated by
double-clicking on the table or field names… works great in VB… not in C#:
http://msdn2.microsoft.com/en-us/library/ms171896.aspx
http://msdn2.microsoft.com/en-us/library/1120xds5.aspx
suggests that you simply copy code into your
“Copy the following code into the RowChanging event handlerâ€
But gives not clue as to how you wire the event or execute ANY code in a C#
partial class.
The same article suggests using the well tried approach:
http://msdn2.microsoft.com/en-us/library/awbftdfh.aspx
This does not work due to an inability to call any method that permits
subscription to an event.
ColumnChangine events????
http://msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dnvs05/html/newdtastvs05.asp
is an excellent VB.Net article on using partial classes to validate changes
to DataTable row events. However, this appears impossible using C#!!
VB supports the following approach:
Partial Public Class NorthwindDataSet Partial Class OrdersDataTable
Protected Sub ValidateNewRow(ByVal sender As Object, _ ByVal e As
System.Data.DataTableNewRowEventArgs) _ Handles Me.TableNewRow
C# does not permit wiring in this fashion…
One help article suggests that the event handlers are simply generated by
double-clicking on the table or field names… works great in VB… not in C#:
http://msdn2.microsoft.com/en-us/library/ms171896.aspx
http://msdn2.microsoft.com/en-us/library/1120xds5.aspx
suggests that you simply copy code into your
“Copy the following code into the RowChanging event handlerâ€
But gives not clue as to how you wire the event or execute ANY code in a C#
partial class.
The same article suggests using the well tried approach:
http://msdn2.microsoft.com/en-us/library/awbftdfh.aspx
This does not work due to an inability to call any method that permits
subscription to an event.