PC Review


Reply
Thread Tools Rate Thread

BeforePositionChange event?

 
 
Joe
Guest
Posts: n/a
 
      6th Feb 2005
I'm looking for an event which is fired before the current row changes.
Similar to the CM.PositionChange event but right before it actually changes.

I thought I could use the RowChanging event of the DataTable but this only
gets fired if the row changed.

Thanks,
Joe


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJ1Y2UgSm9obnNvbiBbQyMgTVZQXQ==?=
Guest
Posts: n/a
 
      6th Feb 2005
I don't believe you can get what you want out of the DataTable. The reason
for this is that the DataTable is basically the backing store for the
CurrencyManager. It is the CurrencyManager that keeps track of the current
row in the DataGrid. And it only talks to the DataTable if the person who is
interacting with the interface does something to update the DataTable. Sorry.


"Joe" wrote:

> I'm looking for an event which is fired before the current row changes.
> Similar to the CM.PositionChange event but right before it actually changes.
>
> I thought I could use the RowChanging event of the DataTable but this only
> gets fired if the row changed.
>
> Thanks,
> Joe
>
>
>

 
Reply With Quote
 
Joe
Guest
Posts: n/a
 
      6th Feb 2005
Ok. Then what about the DataGrid. Is there an event that is fired right
before the position changes?

For example I have a DataGrid displaying 20 rows. If the user is currently
on row 2 and then click to row 18 is there an event to tell me this happened
before the position actually changes to row 18?

The reason for this is that I have some data that may need to be saved if
the user is changing records.

"Bruce Johnson [C# MVP]" <(E-Mail Removed)> wrote in message
news:8C31C5D5-E1AD-4497-BE16-(E-Mail Removed)...
> I don't believe you can get what you want out of the DataTable. The

reason
> for this is that the DataTable is basically the backing store for the
> CurrencyManager. It is the CurrencyManager that keeps track of the

current
> row in the DataGrid. And it only talks to the DataTable if the person who

is
> interacting with the interface does something to update the DataTable.

Sorry.
>
>
> "Joe" wrote:
>
> > I'm looking for an event which is fired before the current row changes.
> > Similar to the CM.PositionChange event but right before it actually

changes.
> >
> > I thought I could use the RowChanging event of the DataTable but this

only
> > gets fired if the row changed.
> >
> > Thanks,
> > Joe
> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?QnJ1Y2UgSm9obnNvbiBbQyMgTVZQXQ==?=
Guest
Posts: n/a
 
      7th Feb 2005
Nothing springs immediately to mind for *before* the move is made. However,
if the DataGrid is tied to a DataSet, then the RowChanging event comes into
play. Since you ask the question, I can only assume that it's not. But
perhaps the easiest solution would be to move your data into a DataSet, just
for that reason.


"Joe" wrote:

> Ok. Then what about the DataGrid. Is there an event that is fired right
> before the position changes?
>
> For example I have a DataGrid displaying 20 rows. If the user is currently
> on row 2 and then click to row 18 is there an event to tell me this happened
> before the position actually changes to row 18?
>
> The reason for this is that I have some data that may need to be saved if
> the user is changing records.
>
> "Bruce Johnson [C# MVP]" <(E-Mail Removed)> wrote in message
> news:8C31C5D5-E1AD-4497-BE16-(E-Mail Removed)...
> > I don't believe you can get what you want out of the DataTable. The

> reason
> > for this is that the DataTable is basically the backing store for the
> > CurrencyManager. It is the CurrencyManager that keeps track of the

> current
> > row in the DataGrid. And it only talks to the DataTable if the person who

> is
> > interacting with the interface does something to update the DataTable.

> Sorry.
> >
> >
> > "Joe" wrote:
> >
> > > I'm looking for an event which is fired before the current row changes.
> > > Similar to the CM.PositionChange event but right before it actually

> changes.
> > >
> > > I thought I could use the RowChanging event of the DataTable but this

> only
> > > gets fired if the row changed.
> > >
> > > Thanks,
> > > Joe
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
Jim Hughes
Guest
Posts: n/a
 
      7th Feb 2005
How about storing a static variable in the PositionChange event handler?

As you enter the event handler, you will either have null/Nothing or a
reference to the last row that was accessed.

Do your "business logic"

As you leave the event handler, update the static variable to reference the
current row that you can then access when the event handler is triggered
again.

"Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message
news:eRZ2$(E-Mail Removed)...
> Ok. Then what about the DataGrid. Is there an event that is fired right
> before the position changes?
>
> For example I have a DataGrid displaying 20 rows. If the user is currently
> on row 2 and then click to row 18 is there an event to tell me this
> happened
> before the position actually changes to row 18?
>
> The reason for this is that I have some data that may need to be saved if
> the user is changing records.
>
> "Bruce Johnson [C# MVP]" <(E-Mail Removed)> wrote in
> message
> news:8C31C5D5-E1AD-4497-BE16-(E-Mail Removed)...
>> I don't believe you can get what you want out of the DataTable. The

> reason
>> for this is that the DataTable is basically the backing store for the
>> CurrencyManager. It is the CurrencyManager that keeps track of the

> current
>> row in the DataGrid. And it only talks to the DataTable if the person
>> who

> is
>> interacting with the interface does something to update the DataTable.

> Sorry.
>>
>>
>> "Joe" wrote:
>>
>> > I'm looking for an event which is fired before the current row changes.
>> > Similar to the CM.PositionChange event but right before it actually

> changes.
>> >
>> > I thought I could use the RowChanging event of the DataTable but this

> only
>> > gets fired if the row changed.
>> >
>> > Thanks,
>> > Joe
>> >
>> >
>> >

>
>



 
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
Outlook 2007. Event ID 25, Event ID 2000. Microsoft Office 12. Event ID 2001 David F. Sage Microsoft Outlook Discussion 0 10th Mar 2008 01:24 PM
Event ID: 1003, Event Type: Error ,Event Source: System Error,Event Category: (102) BoazBoaz Windows XP General 0 21st Jun 2006 05:39 PM
I need to clear temporary the event sinks from another event and then restore them, but I don't know which methods signed up for that event Serge Shimanovsky Microsoft Dot NET 1 14th Apr 2005 05:37 AM
I need to clear temporary the event sinks from another event and then restore them, but I don't know which methods signed up for that event Serge Shimanovsky Microsoft Dot NET Framework Forms 14 7th Feb 2005 08:48 PM
I need to clear temporary the event sinks from another event and then restore them, but I don't know which methods signed up for that event Serge Shimanovsky Microsoft Dot NET 0 11th Jan 2005 02:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 AM.