Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 29th, 2007, 12:20 PM
Authorized User
 
Join Date: Oct 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default DGV CheckBox Click Issue

Hi,

I have a DataGridView with checkbox columns.

There is also a button on the form to save the DataGridView data.

However, if the last thing I do in the DataGridView is check or uncheck then that action is ignored. i.e. it is not saved.

If I click elsewhere on the DGV then the checked item is recognised.

Any ideas why this might be?

Thanks.

code...

Code:
        private void ISDataGridView_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
        {
            if (e.ColumnIndex == this.ISDataGridView.Columns["LaunchDateColumn"].Index)
            {
                this.InvestorServicesDateTimePicker.Location = this.ISDataGridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Location;
                this.InvestorServicesDateTimePicker.Size = this.ISDataGridView.CurrentCell.Size;
                this.InvestorServicesDateTimePicker.Visible = true;
                if (this.ISDataGridView.CurrentCell.Value != null)
                {
                    try
                    {
                        this.InvestorServicesDateTimePicker.Value = (DateTime)this.ISDataGridView[e.ColumnIndex, e.RowIndex].Value;
                    }
                    catch (Exception ex)
                    { }
                }
            }
        }

        private void ISDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if ((this.ISDataGridView.Focused) && (this.ISDataGridView.CurrentCell != null))
            {
                if (this.ISDataGridView.CurrentCell.ColumnIndex == 2)
                {
                    this.ISDataGridView.CurrentCell.Value = InvestorServicesDateTimePicker.Text;
                    this.InvestorServicesDateTimePicker.Visible = false;
                }
            }
        }
 
Old December 17th, 2007, 06:04 AM
Authorized User
 
Join Date: Oct 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

does this make sense??

any ideas??






Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling form elements on click of checkbox Shuchik Classic ASP Basics 2 September 12th, 2007 02:53 AM
DGV with MemoBox, Datetimepicker rhd110 General .NET 1 April 23rd, 2007 07:27 AM
Checking a checkbox on click of a row in a table nkrust Javascript How-To 1 January 13th, 2007 11:56 AM
DGV Binding 4x4 ADO.NET 1 January 13th, 2007 04:31 AM
In datagrid when checkbox true delete in btn click ashish2001mca ASP.NET Espanol 1 January 9th, 2006 08:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.