darkpl Posted August 8, 2003 Posted August 8, 2003 1. Control of Datagrid in VB.Net. using OLEDB connection example: a. how to select a row, press a button then it will copy every items in each cells in that single row to a particular textbox or variable? b. how to refresh datagrid? c. how to keep on adding item to datagrid, i found that once you bind it, you can't add anything new nor refresh the datagrid. I ask this question because i use to MSHFlexgrid in VB 6 but i'm really unfamiliar with datagrid in the VB.Net :( Quote
DayWalker Posted August 8, 2003 Posted August 8, 2003 Try this for copying it to a textbox. Textbox.Text = datagrid.Item(datagrid.currentrowindex, coloumn).tostring If thats what you want? Quote
Madz Posted August 9, 2003 Posted August 9, 2003 There are 2-3 problems which you are facing . 1- Turn the data grid property "ReadOnly" to false because this might prevent you from adding new rows 2- DataGrid.Refresh method refreshs it. 3- DataGrid will not work as you are thinking it do in past in VB6.0 if you make changes to some data such are adding new rows it will not save it back to database unless you call the update command of data adapter. because ADO.NET is disconnected data model so you need to submit the data back to database if you want to save changes to it. just try make an idea about ADO.NET , how it works. Quote The one and only Dr. Madz eee-m@il
Moderators Robby Posted August 10, 2003 Moderators Posted August 10, 2003 You can add new items to the DataView as well as calling the Udpate of the dataAdapter (or an Update statement to a ExecutNonQuery of the Command object) 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.