I'm using vs2005,this is what i did :
- I placed a ultrawebgrid on a new aspx form and chose the SQLDataSource as my data source.- I connected the SQLDataSource to the correct object in my data layer and enabled insert/update/delete features on it
-i enable ajax,addbox and delete in ultraWebGrid
-i write code in rowupdate() for case of row Modifed and row Insert as UpdateDBRow(e.row) and InsertDBRow(e.row)
-i write code in rowDelete() as DeleteDBRow(e.row)
now i can add new record in DB when i am add new line in webGrid,but after edit one row and change to another row,the "UpdateDBRow(e.row)" called and it change data in webGrid,but not in the DB;
and when i delete row in the webGrid ,the row deleted in the grid too,but same not in the DB;
so can anyone please tell me what problem of this?
ok, i find the solution find here:
http://forums.infragistics.com/forums/p/13778/51125.aspx#51125
but i find i can't define DataKeyField and BaseTableName in designer,i can only write code myself to add this two,because in designer ,it can't save
" DeleteCommand='DELETE FROM "DOC_YANSE" WHERE "SYSID" = :SYSID AND "DCODE" = :DCODE' InsertCommand='INSERT INTO "DOC_YANSE" ("SYSID", "DCODE", "DNAME") VALUES (:SYSID, :DCODE, :DNAME)' ProviderName="" SelectCommand='SELECT * FROM "DOC_YANSE"' UpdateCommand='UPDATE "DOC_YANSE" SET "DNAME" = :DNAME WHERE "SYSID" = :SYSID AND "DCODE" = :DCODE'>
protected void UltraWebGrid1_AddRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { this.UltraWebGrid1.InsertDBRow(e.Row); } protected void UltraWebGrid1_DeleteRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { this.UltraWebGrid1.DeleteDBRow(e.Row); } protected void UltraWebGrid1_UpdateRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { this.UltraWebGrid1.UpdateDBRow(e.Row); } }
Hello,
Unfortunately I am not sure that problem is in the grid. Could you please provide little bit more information about SQL queries for insert/update/delete.
Thanks.