datagridview - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

datagridview

raphaelsolisraphaelsolis Posts: 4Member
can somebody help me with the codes for deleting record in the datagrid..
here's what i wanna do..
once i click on the datagrid on the record so that the cursor is focus on it. then when i click the delete button that record is automatically deleted and my datagridview is refresh also..

thanks alot..


Comments

  • bradwangbradwang Posts: 197Member
    : can somebody help me with the codes for deleting record in the
    : datagrid..
    : here's what i wanna do..
    : once i click on the datagrid on the record so that the cursor is
    : focus on it. then when i click the delete button that record is
    : automatically deleted and my datagridview is refresh also..
    :
    : thanks alot..
    :
    :
    :


    You just need to following the process you want: add a delete button and write the button event handler method, and inside the method, you do the programming logic, first to identify the index of the selected row and then get the record ID from that row and do the record deletion logic by using ADO.NET and then reload the whole data grid to do the refresh.

    :)


    Brad Wang
    .NET Freelancer from China
  • raphaelsolisraphaelsolis Posts: 4Member
    : : can somebody help me with the codes for deleting record in the
    : : datagrid..
    : : here's what i wanna do..
    : : once i click on the datagrid on the record so that the cursor is
    : : focus on it. then when i click the delete button that record is
    : : automatically deleted and my datagridview is refresh also..
    : :
    : : thanks alot..
    : :
    : :
    : :
    :
    :
    : You just need to following the process you want: add a delete button
    : and write the button event handler method, and inside the method,
    : you do the programming logic, first to identify the index of the
    : selected row and then get the record ID from that row and do the
    : record deletion logic by using ADO.NET and then reload the whole
    : data grid to do the refresh.
    :
    : :)
    :
    :
    : Brad Wang
    : .NET Freelancer from China







    thanks Brad to tell you frankly,, im new with c# and i still dont know a few codes yet.. can you give me a code for this? and also the update record because only the first column updates then if i update the other columns it doesnt update and says insert into error.

  • bradwangbradwang Posts: 197Member
    : : : can somebody help me with the codes for deleting record in the
    : : : datagrid..
    : : : here's what i wanna do..
    : : : once i click on the datagrid on the record so that the cursor is
    : : : focus on it. then when i click the delete button that record is
    : : : automatically deleted and my datagridview is refresh also..
    : : :
    : : : thanks alot..
    : : :
    : : :
    : : :
    : :
    : :
    : : You just need to following the process you want: add a delete button
    : : and write the button event handler method, and inside the method,
    : : you do the programming logic, first to identify the index of the
    : : selected row and then get the record ID from that row and do the
    : : record deletion logic by using ADO.NET and then reload the whole
    : : data grid to do the refresh.
    : :
    : : :)
    : :
    : :
    : : Brad Wang
    : : .NET Freelancer from China
    :
    :
    :
    :
    :
    :
    :
    : thanks Brad to tell you frankly,, im new with c# and i still dont
    : know a few codes yet.. can you give me a code for this? and also the
    : update record because only the first column updates then if i update
    : the other columns it doesnt update and says insert into error.
    :
    :

    For insert into error, I think you're probably have problem with SQL statement, please check and make sure the syntax is right.

    For datagrid, you can checkout this resource: http://www.syncfusion.com/FAQ/windowsforms/faq_c44c.aspx which I think maybe very helpful to you.



    Brad Wang
    .NET Freelancer from China
Sign In or Register to comment.