cjimloo Posted April 8, 2003 Posted April 8, 2003 Need Help.... Why cannot disallow user to addnew record in datagrid? URGENT :( Quote
Jarod Posted April 8, 2003 Posted April 8, 2003 Say the DataGrid has a dataSource of type DataView : CType(me.DataGrid1, DataView).AllowNew = false or else: CurrencyManager cm = (CurrencyManager)this.BindingContext[dataGrid1.DataSource, dataGrid1.DataMember]; ((DataView)cm.List).AllowNew = false; look here: http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q653q Quote Jarod
cjimloo Posted April 9, 2003 Author Posted April 9, 2003 Thanks Jarod, I have try your suggestion but it seen cannot works. Error Message Appear:- " Additional information: Specified cast is not valid. " Do you have any others idea? Quote
Moderators Robby Posted April 9, 2003 Moderators Posted April 9, 2003 If your'e using a Dataview, simply do this... DataView1.DataSource = False Quote Visit...Bassic Software
Moderators Robby Posted April 9, 2003 Moderators Posted April 9, 2003 If you're not using a DAtaview, this'll get you satarted.. Dim sTable As String = "myTable" Dim dt As New DataTable(sTable) dt = ds.Tables(sTable) Dim dv As New DataView(dt) Datagrid1.DataSource = dv dv.AllowDelete = False dv.AllowEdit = False dv.AllowNew = False Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.