| | |
POpulate DataGrid
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
That highly depends on whether you meant Windows Forms or Web forms.
If you're using .net 2.0, use GridView, not DataGrid.
If you're using .net 2.0, use GridView, not DataGrid.
Google is your friend. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
Bored? Visit http://www.kaelisspace.com/
This is pretty basic if I understand you.
Search shows a ton of tutorials and FAQs on the subject.
http://www.google.com/search?source=...=Google+Search
Search shows a ton of tutorials and FAQs on the subject.
http://www.google.com/search?source=...=Google+Search
Google is your friend. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
Bored? Visit http://www.kaelisspace.com/
•
•
Join Date: Jan 2007
Posts: 47
Reputation:
Solved Threads: 0
here is a sample code: modify according to ur need
this is for update task
TextBox tb1=new TextBox();
TextBox tb2=new TextBox();
TextBox tb3=new TextBox();
tb1=(TextBox)e.Item.Cells[2].Controls[0];
tb2=(TextBox)e.Item.Cells[3].Controls[0];
tb3=(TextBox)e.Item.Cells[6].Controls[0];
DropDownList ddl1=(DropDownList)e.Item.Cells[4].FindControl("dropdowndept");
string deptid=ddl1.SelectedItem.Value;
DropDownList ddl2=(DropDownList)e.Item.Cells[5].FindControl("dropdowndesgi");
string desgiid=ddl2.SelectedItem.Value;
int empid=Convert.ToInt32(DataGrid1.DataKeys[e.Item.ItemIndex]);
i think rest of the operations are easy.
if u r using indexing then u may have a problem in deleting a record when there is a single record in datagrid or in page.these 2 are diferent problems.if u hav this prob then ask me.
this is for update task
TextBox tb1=new TextBox();
TextBox tb2=new TextBox();
TextBox tb3=new TextBox();
tb1=(TextBox)e.Item.Cells[2].Controls[0];
tb2=(TextBox)e.Item.Cells[3].Controls[0];
tb3=(TextBox)e.Item.Cells[6].Controls[0];
DropDownList ddl1=(DropDownList)e.Item.Cells[4].FindControl("dropdowndept");
string deptid=ddl1.SelectedItem.Value;
DropDownList ddl2=(DropDownList)e.Item.Cells[5].FindControl("dropdowndesgi");
string desgiid=ddl2.SelectedItem.Value;
int empid=Convert.ToInt32(DataGrid1.DataKeys[e.Item.ItemIndex]);
i think rest of the operations are easy.
if u r using indexing then u may have a problem in deleting a record when there is a single record in datagrid or in page.these 2 are diferent problems.if u hav this prob then ask me.
![]() |
Similar Threads
- How can we populate a datagrid in VB.NET? (VB.NET)
- HELP!Populate Datagrid using ORACLE table (Visual Basic 4 / 5 / 6)
- It's all about datagrid (VB.NET)
- datagrid (VB.NET)
- binding a datagrid to a datareader (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: urgent help needed
- Next Thread: database connectivity
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic beginner browser button buttons center check code combo component crystalreport cuesent data database datagrid datagridview date datetimepicker design designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter folder forms ftp generatetags hardcopy html images input insert intel listview monitor net networking number open output panel passingparameters picturebox picturebox1 picturebox2 port print printing problem problemwithinstallation project searchvb.net select serial settings shutdown socket sqlserver survey tcp temperature text textbox timespan toolbox transparency trim txttoxmlconverter updown user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic.net visualstudio visualstudio.net visualstudio2008 web winforms wpf wrapingcode year





