PC Review


Reply
Thread Tools Rate Thread

Datagrid (windows forms)

 
 
=?Utf-8?B?dE1hbg==?=
Guest
Posts: n/a
 
      7th Jul 2004
is there like a BeforeColumnEdit() or BeforeRowEdit() event in the datagrid.

i want to disable a command button when a row in the grid is dirty. (i.e. a column is being currently edited) and enable it after the Changed() or Validated event fires

i tried the RowChanging(), ColumnChanging() events. but it didnt work.


 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      8th Jul 2004
Hi,

I would add a handler to the datagridtextboxcolumns textbox
textchanged and validating events to enable or disable the command buttons.

Dim colName As New DataGridTextBoxColumn

With colName

..MappingName = "LastName"

..HeaderText = "Name"

..Width = 100

End With

AddHandler colName.TextBox.TextChanged, AddressOf TextBox_TextChanged

AddHandler colName.TextBox.Validating, AddressOf TextBox_Validating



Private Sub TextBox_Validating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs)

Debug.WriteLine("Validating")

End Sub

Private Sub TextBox_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs)

Debug.WriteLine("Text changed")

End Sub



Ken

------------------------

"tMan" <(E-Mail Removed)> wrote in message
news:5DB26D7A-495F-471A-8E70-(E-Mail Removed)...
> is there like a BeforeColumnEdit() or BeforeRowEdit() event in the
> datagrid.
>
> i want to disable a command button when a row in the grid is dirty. (i.e.
> a column is being currently edited) and enable it after the Changed() or
> Validated event fires
>
> i tried the RowChanging(), ColumnChanging() events. but it didnt work.
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid & windows forms =?Utf-8?B?TGFuZQ==?= Microsoft C# .NET 2 22nd Jun 2004 05:56 PM
Datagrid & windows forms =?Utf-8?B?TGFuZQ==?= Microsoft C# .NET 0 21st Jun 2004 10:58 PM
Windows Forms Datagrid Bernardo Microsoft C# .NET 1 20th Dec 2003 08:11 AM
Windows Forms Datagrid Bernardo Microsoft C# .NET 1 18th Dec 2003 08:08 AM
Windows Forms Datagrid Bernard Microsoft C# .NET 1 17th Dec 2003 09:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:43 AM.