473,372 Members | 1,089 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,372 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 4411
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.