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.

Recommended Answers

All 3 Replies

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)

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.