Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
populate grid with primary key after insert new record
posted

I get my primary key after I insert a new record for the newly created record. If I refresh the page, I get all data fine but I dont want to refresh the entire page. I tried to do $('#mygrid').igGrid("dataBind") but this just bind the grid data what we have already on the page. New record is still not loaded with new primarykey which is returned from database.

How do I bind the primary key with the grid and new record? Please help.

Parents
  • 23953
    Offline posted

    Hello Sarojanand,

    From your description is not clear whether you're using the igGrid MVC helper wrapper for data binding as well as updating. If you use it calling igGrid.dataBind will make a remote request and refresh the primary key values, but you said this is not the case. In order for me to understand your scenario can you provide more information on:

    Are you using igGrid MVC helper wrapper?

    How do you bind igGrid to data? Is it remote data or local data? Do you make custom Ajax call to get the data?

    How do you save updates made to igGrid (inserts, updates, deletes) to the database? Are you calling igGrid.saveChanges?

    Do you have igGrid.updateUrl configured?

    I've answered a similar question to yours, but the customer was using igGrid MVC helper wrapper. You can check the following forum post for an example of updating the PK value of newly created record on demand without the need for re-binding:

    http://es.infragistics.com/community/forums/p/84192/420302.aspx#420302.

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc. 

Reply Children