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
> > >
> > >
> > >
>
>
>
|