in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

edit grid with dynamic dataset

Last post 10/19/2007 5:38 AM by Mehul Harry (Developer Express). 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 10/10/2007 3:34 AM

    edit grid with dynamic dataset

    hi,

    we are assigning data from sql server as data source to the grid (ASPxGridView) and using data editing. using as a web user control. we need a server-side postback on click of edit button/new button, for which we had to turn off EnableCallbacks (set to false). also using a custom column as PK as it doesnt support composite keys.

    1. when user clicks on update(save) button in new record, e.NewValues is always null, no matter what we do. if we turn on the EnableCallbacks (set to true), then it gets the values (but we loose out other option #1). if we set callbacks to false, is there any other way to get values from the new row ?

    2. looks like the gridview calls its own internal method to update the datasource, so we call e.Cancel=true and update the data ourself and refresh the data source of the grid. otherwise, it gives an error "method not supported". Is this the correct/only method ? Are we doing it correct ?

    3. after following #2, data is saved and refreshed but the grid is still in edit mode, how to return to browse mode (display mode) ?

    Thanks in advance. Has anyone tried to create a user control ? If yes, please let me know, where can see any sample ?
     

  • 10/19/2007 5:38 AM In reply to

    Re: edit grid with dynamic dataset

    Hello Rajeeb,

    I recommend uploading your custom control to support so they may have a deeper look. For question #3, this will help:

        protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            string cid = Convert.ToString(e.NewValues["CustomerID"]);
            string city = Convert.ToString(e.NewValues["City"]);
     
            //Cancel automatic update
            e.Cancel = true;
            //back to the browse mode
            (sender as ASPxGridView).CancelEdit();
        }

    Also, check out these composite key tutorials:

    Thanks.

    Filed under: ,
Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED