| | |
POpulate DataGrid
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
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 |
"crystal .net .net2005 .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationthesis dissertationtopic dosconsolevb.net editvb.net employees excel exists firewall forms html image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pdf picturebox2 port print printpreview record regex reports" reuse right-to-left save savedialog search serial settings socket sqldatbase sqlserver storedprocedure string temp textbox timer transparency txttoxmlconverter useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic.net visualstudio.net web wpf wrapingcode xml





