I have SQL datasource and all columns are directly displayed in gridview.
DS_params.SelectCommand = "SELECT ID, ParamName, ParamValue FROM Params WHERE ProductID=" + pid;
DS_params.Select(DataSourceSelectArguments.Empty);
grid_productdata.DataBind();
The first thing I cannot figure out is how to make some column read-only so it can't be edited, without directly adding columns and setting readonly properties.
And the second question- how could I get the ID column value for row being edited? at the moment when i set the UpdateQuery like
UPDATE Params SET ParamName=@ParamName, ParamValue=@ParamValue WHERE ID=@ID
editing updates all records, so how can I get the correct ID to pass?