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
275
How to add a new row in a WebGrid
posted

Hi Everyone,

I am using VB in my code behind.  I have a webgrid and I'm using a SqlDataSource bound to the WebGrid

And I need to add new records but I don't know how.

Can I use datarows ?  How can I implement it ?

Thanks !!

Parents
No Data
Reply
  • 2501
    Verified Answer
    posted

    Hello,

    Thank you for posting your request on the Infragistics WebGrid Forums.  A good place of refernece for information on adding new rows to the WebGrid is to look at the databinding topics available for the WebGrid which may be found here: 

    <http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.1/CLR3.5/html/WebGrid_Data_Updating.html>

    When using a SqlDataSource control, the CRUD Insert/Update/Delete commands may be enabled through the wizard when binding it to the grid.  The WebGrid DataKeyField will need to be set to match the primary key in your column.

    The grid is not editable by default, so you'll want to enable editing, or at least enable add new.  There is an AddNewBox and a AddNewRow that can be used to add new rows of data.  Once the grid is connected to the SqlDataSource, the addnew operations will be connected to the database.

    The following URL is a link to the Infragistics WebClient Online Help where information on adding new rows to the WebGrid may be found:

    <http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.1/CLR3.5/html/WebGrid_Adding_Rows.html>

    Please take a look at this information and let me know if you have any questions.

    Sincerely,
    Mike D.
    Developer Support Engineer
    Infragistics, Inc.

Children