473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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

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
3 4415
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
2
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different...
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
5
by: magmo | last post by:
Hi I have a datagrid that have checkboxes added to it and there is also a button that I want to use as a check what rows has been selected in the datagrid. But when I use this piece if code...
14
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
4
by: Rob Kroese | last post by:
I've got a form with a datagrid that displays a list of items, along with several textboxes, comboboxes, etc., that display the details for the selected item. The columns in the datagrid and the...
1
by: Engineerik | last post by:
I have a datagrid which displays rows from a parent datatable. I use a datarelation so the user can expand the child rows. How can I tell programatically when the user has expanded the child rows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.