C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
datagridview Posted by raphaelsolis on 20 Jun 2008 at 1:56 AM
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..


Report
Re: datagridview Posted by bradwang on 22 Jun 2008 at 7:57 PM
: 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
Report
Re: datagridview Posted by raphaelsolis on 22 Jun 2008 at 10:17 PM
: : 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.

Report
Re: datagridview Posted by bradwang on 27 Jun 2008 at 2:10 AM
: : : 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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.