J
Joy
Hi,
I need to be able to to disable the Apend Row feature of the VB.NET
datagrid and then enable it again. The reason is because I want to
allow a user to enter as many rows in the datagrid as they want until a
certain number of rows is reached. When that number of rows is reached
I want to disable the Apend Row feature - BUT if they delete a row, I
want to enable the Apend Row feature again. Does that make sense??
I have code that works great to disable the Apend Row feature - but
when I use the same method to enable it again, it doesn't work - it
doesn't produce an error but it just doesn't enable Apend Row feature
again. Here is the code I am using to disable the Apend Row feature:
Dim cm As CurrencyManager = Me.BindingContext(dgTime.DataSource)
CType(cm.List, DataView).AllowNew = False
CType(cm.List, DataView).AllowDelete = True
Here is the code I am using to try to enable it again:
Dim cm As CurrencyManager = Me.BindingContext(dgTime.DataSource)
CType(cm.List, DataView).AllowNew = True
CType(cm.List, DataView).AllowDelete = True
This code does succesfully set CType(cm.List, DataView).AllowNew = True
but the option to type information into a blank row in the datagrid
never appears.
Can anyone help me??
Thanks!
Joy
I need to be able to to disable the Apend Row feature of the VB.NET
datagrid and then enable it again. The reason is because I want to
allow a user to enter as many rows in the datagrid as they want until a
certain number of rows is reached. When that number of rows is reached
I want to disable the Apend Row feature - BUT if they delete a row, I
want to enable the Apend Row feature again. Does that make sense??
I have code that works great to disable the Apend Row feature - but
when I use the same method to enable it again, it doesn't work - it
doesn't produce an error but it just doesn't enable Apend Row feature
again. Here is the code I am using to disable the Apend Row feature:
Dim cm As CurrencyManager = Me.BindingContext(dgTime.DataSource)
CType(cm.List, DataView).AllowNew = False
CType(cm.List, DataView).AllowDelete = True
Here is the code I am using to try to enable it again:
Dim cm As CurrencyManager = Me.BindingContext(dgTime.DataSource)
CType(cm.List, DataView).AllowNew = True
CType(cm.List, DataView).AllowDelete = True
This code does succesfully set CType(cm.List, DataView).AllowNew = True
but the option to type information into a blank row in the datagrid
never appears.
Can anyone help me??
Thanks!
Joy