smriti Posted April 12, 2005 Posted April 12, 2005 hi all, i am using access database and when i load the grid the last blank row is also appearing. how to make it invisible. Thanks. Quote
penfold69 Posted April 12, 2005 Posted April 12, 2005 If the grid can be made read only, do so: myGrid.ReadOnly = True. Otherwise, you need to set up a DataView: (from memory): Dim dv as New DataView(YourDataTable_or_YourDataSet) dv.AddNew = False MyGrid.Datasource = dv B. Quote
smriti Posted April 13, 2005 Author Posted April 13, 2005 Thanks for your reply. But i am getting an exception cannot create a child list for field Table2 I used the following string strSql=@"Select * from Table2"; da=new OleDbDataAdapter(strSql,constr); ds.Clear(); da.Fill(ds,"Table2"); DataView dv=new DataView(ds.Tables["Table2"]); dv.AllowNew=false; this.dataGrid1.DataSource=dv; this.dataGrid1.SetDataBinding(dv,"Table2"); Thanks Quote
donnacha Posted June 14, 2005 Posted June 14, 2005 Try the following (VB Code) Dim cm As CurrencyManager = BindingContext(dataGrid1.DataSource, dataGrid1.DataMember) Dim dv As DataView = cm.List dv.AllowNew = False Quote Hamlet
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.