How to iterate thru all the elements of Datagrid (windows forms)
-
the question is simply this boys n girls, ladies n gents, how do I iterate thru all the elements of a Datagrid in a windows form (.net 1.1). thats when I take input from user. how do i know the number of rows entered in it. thanks I'd appreciate if u tel me that in c# but anyways tahts not compulsory thanks in advance
-
the question is simply this boys n girls, ladies n gents, how do I iterate thru all the elements of a Datagrid in a windows form (.net 1.1). thats when I take input from user. how do i know the number of rows entered in it. thanks I'd appreciate if u tel me that in c# but anyways tahts not compulsory thanks in advance
Doesn't the DataGrid have a Rows property, which has a Count property ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
Doesn't the DataGrid have a Rows property, which has a Count property ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
wait a second here I think this property is not therein Windows Forms, I might still be wrong though, I'm sorry for taht in advance but I got the other way around to this like DataTable dt = (DataTable) dg.DataSource; dt.Rows.Count casting the DataGrids Datasource into a table and then using its count but I'm not so sure if it will work when the using is giving data for input
-
wait a second here I think this property is not therein Windows Forms, I might still be wrong though, I'm sorry for taht in advance but I got the other way around to this like DataTable dt = (DataTable) dg.DataSource; dt.Rows.Count casting the DataGrids Datasource into a table and then using its count but I'm not so sure if it will work when the using is giving data for input
Just one more question here, God I'm a real new commer here, ah how do u empty a datagrid. I want the datagrid showing an existing set of records to get empty when I click a button for adding a new record. Its actually a master detail form. The master table is linked with a set of textboxes and comboboxes and The details are in the datagrid. I hope the scenario is clear now and I repeat I'm using .net 1.1 and working in Windows Forms. So I need the info abt System.windows.Forms not the other one thanks in advance... Rocky
-
Just one more question here, God I'm a real new commer here, ah how do u empty a datagrid. I want the datagrid showing an existing set of records to get empty when I click a button for adding a new record. Its actually a master detail form. The master table is linked with a set of textboxes and comboboxes and The details are in the datagrid. I hope the scenario is clear now and I repeat I'm using .net 1.1 and working in Windows Forms. So I need the info abt System.windows.Forms not the other one thanks in advance... Rocky
-
Well right now I'm working on that same form to save the data. I've made the sqlDataadapters for the master and the detail tables which offcourse have the update,select insert, del commands. But I'm a bit confused in whether if I should add() the new row of data in the master table b4 taking the input from the datagrid or not. Can anyone plz give me a few guidlines or a tip or 2 abt this. I'm doin this for the first time actually. If u can give any useful Urls, that wuold be nice too. thanks
-
Well right now I'm working on that same form to save the data. I've made the sqlDataadapters for the master and the detail tables which offcourse have the update,select insert, del commands. But I'm a bit confused in whether if I should add() the new row of data in the master table b4 taking the input from the datagrid or not. Can anyone plz give me a few guidlines or a tip or 2 abt this. I'm doin this for the first time actually. If u can give any useful Urls, that wuold be nice too. thanks
-
Can anybuddy provide me some good helping material (reading, code etc) for making master detail forms (C# preferably)
You can get so many examples on net for that if you will use google : :) here is the one: http://msdn2.microsoft.com/en-us/library/c12c1kx4.aspx
Best Regards, Apurva Kaushal
-
You can get so many examples on net for that if you will use google : :) here is the one: http://msdn2.microsoft.com/en-us/library/c12c1kx4.aspx
Best Regards, Apurva Kaushal
Thanks a lot, I appreciate it. yesterday I worked on the form and its del command is working allright now. I havent worked on updates as yet. I'm having a little problem in inserting data in the detail table. Its shown in a datagrid and I dont know, the records get inserted automatically thru the grid. Its strange for me. How can we stop this behaviour ir use it more inteligently for our purpose? Thanks a lot...
-
Thanks a lot, I appreciate it. yesterday I worked on the form and its del command is working allright now. I havent worked on updates as yet. I'm having a little problem in inserting data in the detail table. Its shown in a datagrid and I dont know, the records get inserted automatically thru the grid. Its strange for me. How can we stop this behaviour ir use it more inteligently for our purpose? Thanks a lot...