Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Editing/Deleting/Inserting Records using ASPxGridView (http://www.velocityreviews.com/forums/t544889-editing-deleting-inserting-records-using-aspxgridview.html)

WebGuy 10-17-2007 09:56 AM

Editing/Deleting/Inserting Records using ASPxGridView
 
I'm using Visual Studio 2005 and SQL Server 2005, and I've created an
AJAXenabled ASPx.Net Website. In one of my SQL Server tables, I have Social
Security Number as my PrimaryKey, and I'm using this field as a Seach
parameter in my WebForm. My question is this ... Is it necessary to display
the PrimaryKey in the ASPxGridView in order for you to be able to
Edit/Update a record? When I include the PrimaryKey field in the
ASPxGridView, I can Edit/Delete records, but if I don't include the
PrimaryKey (or set it to Visible=False) then I can't Edit/Delete records.

Thanks in advance for any advice/assistance offered.

Shane



=?Utf-8?B?TWFuaXNo?= 10-17-2007 10:41 AM

RE: Editing/Deleting/Inserting Records using ASPxGridView
 
Hi,

You can delete the records from the GridView even if you do not specify any
Primary key in your Table but in that case your delete query would not be
automatically generated by the sqldatasource.

You will have to write your query yourself in the deleteQuery in the
SQLDataSource and specify the DataKeyName property of the GridView to be one
of the column of the table on the basis of which the row would be deleted
from the table.

Regards,
Manish



"WebGuy" wrote:

> I'm using Visual Studio 2005 and SQL Server 2005, and I've created an
> AJAXenabled ASPx.Net Website. In one of my SQL Server tables, I have Social
> Security Number as my PrimaryKey, and I'm using this field as a Seach
> parameter in my WebForm. My question is this ... Is it necessary to display
> the PrimaryKey in the ASPxGridView in order for you to be able to
> Edit/Update a record? When I include the PrimaryKey field in the
> ASPxGridView, I can Edit/Delete records, but if I don't include the
> PrimaryKey (or set it to Visible=False) then I can't Edit/Delete records.
>
> Thanks in advance for any advice/assistance offered.
>
> Shane
>
>
>



All times are GMT. The time now is 10:37 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.