Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / June 2004

Tip: Looking for answers? Try searching our database.

New column in datagrid.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MA - 29 Jun 2004 11:52 GMT
Hi all!

I have this code:
MA - 29 Jun 2004 11:55 GMT
Sorry...did a mistake on my last message :)

So....I have this code:
private void buildGrid()

{

DataTable dt = new DataTable();

//Create columns in datagrid

dt.Columns.Add(new DataColumn("Code", typeof(string)));

dt.Columns.Add(new DataColumn("Name", typeof(string)));

dt.Columns.Add(new DataColumn("Color", typeof(string)));

dt = buildDataTable(dt);

DataView dv = new DataView(dt);

dgActivityType.DataSource = dv;

dgActivityType.DataBind();

}

private DataTable buildDataTable(DataTable dt)

{

//Create database connection

connection db = new connection(connectstring);

SqlDataReader sdr = db.execStoredProc("proc_get", "");

DataRow dr;

while(sdr.Read())

{

dr = dt.NewRow();

dr[0] = sdr["atCode"].ToString();

dr[1] = sdr["atName"].ToString();

dr[2] = sdr["color"].ToString();

dt.Rows.Add(dr);

}

sdr.Close();

db.Close();

return dt;

}

But how do I add a EditCommandColumn to this? And how do i place it in the
last column, instead of the first?

/Marre

> Hi all!
>
> I have this code:

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.