954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Use of DataGrid

I am new to ASP. I have populated a DataGrid with rows but cannot find any property setting (like Readonly=False or True) that let's me update rows directly in the grid. Is such a function not supported in ASP ? If this is the case how would I design a routine where I have a grid and where user can select rows to be update ?? Thanks.

snufse
Newbie Poster
8 posts since Jul 2004
Reputation Points: 10
Solved Threads: 0
 
DataTable dt = dataGrid.Table["People"];
dt.Rows[4]["Colum 4"].Text = "BLAH!";

That is asuming you have a datagrid with a table named "People" and in that table you have a column named "Column 4". That would change the text in that particular cell. (Row 4, Column 4)

Iron_Cross
Junior Poster
117 posts since Jul 2003
Reputation Points: 46
Solved Threads: 2
 

Programatically I believe this can be done. But what about user changed values (updateing, inserting and deleting) rows. Is this possible in ASP ?? Thanks.

snufse
Newbie Poster
8 posts since Jul 2004
Reputation Points: 10
Solved Threads: 0
 

Yeah, use DataBind() you may have to read up on it. But bind to a certain source, say an ArrayList, then just update the ArrayList, after that just do dataGrid.DataBind() and you rows and columns will be updated.

Iron_Cross
Junior Poster
117 posts since Jul 2003
Reputation Points: 46
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You