By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,409 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

How to determine when selected rows in a datagrid have changed ???

P: n/a
Ok, I know how to count the number of selected datagrid rows using the code
below. What has me stumped is how to determine when the selected rows
within a datagrid have been changed. The DataGrid object doesn't seem to
have a any type of a selection changed type of event I can grab.

THE QUESTION: Does anyone know how to determine when the selected row or
set of rows within a datagrid has changed ???

This is driving me nuts !

Thanks in advance!

Barry
in Oregon
private int ReturnNbrOfSelectedDataGridRows(DataGrid dgSearchResults)
{
CurrencyManager cm =
(CurrencyManager)this.BindingContext
[this.dgSearchResults.DataSource,
this.dgSearchResults.DataMember];

DataView dv = (DataView)cm.List;

int iRowCount = 0;

for(int i=0; i < dv.Count; ++i)
{
if(this.dgSearchResults.IsSelected()){ ++ iRowCount;}
}
}
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,
The (corresponding) underlying datarow of the bound datasource will have the
RowState property. This property tells you if that particular row has been
modified

HTH.
+Rajesh R

"BBFrost" <barry.b.frost@remove_this.wrd.state.or.us> wrote in message
news:#m*************@TK2MSFTNGP11.phx.gbl...
Ok, I know how to count the number of selected datagrid rows using the code below. What has me stumped is how to determine when the selected rows
within a datagrid have been changed. The DataGrid object doesn't seem to
have a any type of a selection changed type of event I can grab.

THE QUESTION: Does anyone know how to determine when the selected row or
set of rows within a datagrid has changed ???

This is driving me nuts !

Thanks in advance!

Barry
in Oregon
private int ReturnNbrOfSelectedDataGridRows(DataGrid dgSearchResults)
{
CurrencyManager cm =
(CurrencyManager)this.BindingContext
[this.dgSearchResults.DataSource,
this.dgSearchResults.DataMember];

DataView dv = (DataView)cm.List;

int iRowCount = 0;

for(int i=0; i < dv.Count; ++i)
{
if(this.dgSearchResults.IsSelected()){ ++ iRowCount;}
}
}

Nov 16 '05 #2

P: n/a
Rajesh,

Thanks for the response. Its very much appreciated. Unfortunately after
re-reading the question I posed I realized that the question was not well
formed.

What I'm trying to figure out is the following ...

Rows 12 thru 24 are selected in a datagrid. How do I tell when the user
selects rows 45 thru 70 ???

Guess I'd better repost with a more properly formed question. :)

Thanks for taking the time to answer.

Best wishes,

Barry
in Oregon

"Rajesh R" <ra*******@nospam.trigent.com> wrote in message
news:eG**************@TK2MSFTNGP15.phx.gbl...
Hi,
The (corresponding) underlying datarow of the bound datasource will have the RowState property. This property tells you if that particular row has been
modified

HTH.
+Rajesh R

"BBFrost" <barry.b.frost@remove_this.wrd.state.or.us> wrote in message
news:#m*************@TK2MSFTNGP11.phx.gbl...
Ok, I know how to count the number of selected datagrid rows using the

code
below. What has me stumped is how to determine when the selected rows
within a datagrid have been changed. The DataGrid object doesn't seem to have a any type of a selection changed type of event I can grab.

THE QUESTION: Does anyone know how to determine when the selected row or set of rows within a datagrid has changed ???

This is driving me nuts !

Thanks in advance!

Barry
in Oregon
private int ReturnNbrOfSelectedDataGridRows(DataGrid dgSearchResults)
{
CurrencyManager cm =
(CurrencyManager)this.BindingContext
[this.dgSearchResults.DataSource,
this.dgSearchResults.DataMember];

DataView dv = (DataView)cm.List;

int iRowCount = 0;

for(int i=0; i < dv.Count; ++i)
{
if(this.dgSearchResults.IsSelected()){ ++ iRowCount;}
}
}


Nov 16 '05 #3

P: n/a
Hi Barry,

I have posted a reply on you new thread. Could you pick it up on that
thread? Thank you!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.