This is a migrated thread and some comments may be shown as answers.

Update works on some columns

1 Answer 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian Saborio
Top achievements
Rank 1
Christian Saborio asked on 18 Apr 2010, 06:48 PM
This is what my site looks like, pretty simple:

http://img.skitch.com/20100418-m8518amduh1bpkeujtixk3ajjb.jpg

I have been using the design editor to create the events for Add, Edit, and Delete.  The Add / Delete work like a charm, but the Edit has issues.  When I am editing a row, if I modify the Enabled and RemoteAccess values, the DB is updated and the values saved.  However, when I type in something into Username and try to update, I get no error, but nothing is updated, not even the Enabled and RemoteAccess values.

My SQL Command is the folllowing:

UpdateCommand="UPDATE [LabUser] SET [Username]=@Username,[Enabled]=@Enabled,[RemoteAccess]=@RemoteAccess WHERE [UserID] = @UserID"  

When troubleshooting, I changed @Username to "Foo" and when running the web page it updates correctly, so the issue has to do something with @Username.  This is not read-only and I've included it Username in the DataKeyNames.

Any idea what can be causing this behavior?  Thanks!






1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 21 Apr 2010, 02:41 PM
Hello Christian,

Hook up to RadGrid's ItemUpdated event and see if there is an exception thrown when attempting to update:

protected void RadGrid1_ItemUpdated(object source, GridUpdatedEventArgs e)
{
    if (e.Exception != null)
    {
        //if code goes here, there has been an exception on update
        //e.Exception.Message or e.Exception.InnerException.Message
        //give you the exception messaged
    }
}


Best wishes,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Christian Saborio
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or