How to Edit a row in the datatable

前端 未结 6 1044
说谎
说谎 2020-12-05 18:46

I have created a data table. It has 3 column Product_id, Product_name and Product_price

    Datatable tabl         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 19:09

    Try the SetField method:

    By passing column object :

    table.Rows[rowIndex].SetField(column, value);
    

    By Passing column index :

    table.Rows[rowIndex].SetField(0 /*column index*/, value);
    

    By Passing column name as string :

    table.Rows[rowIndex].SetField("product_name" /*columnName*/, value);
    

提交回复
热议问题