473,386 Members | 1,803 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,386 software developers and data experts.

VS2005 - DataGrid.IsSelected( ) broken ?

Ok,

We've got a bunch of apps that we've migrated from Net 1.0 to Net 2.0.

The apps were basically upgraded using the VS2005 migrate. The user control
that was using a DataGrid.IsSelected(i) in the original (Net 1.0) to find
the 'Highlighted' rows in a datagrid is working fine.

I've tried adding the DataGrid.IsSelected(i) code into a second migrated app
to find the 'Highlighted' rows. In the 2nd program the
"DataGrid.IsSelected(i)" technique shows false for all rows both
'highlighted' and 'non-highlighted'.

So it works in the migrated program but not in the program with where I'm
trying to use it with the original DataGrid controls. I've spent most of
the day trying variations I've simply hit a brick wall with this thing.
i.e. move the code in-line and use the actual this.data_grid name, etc, etc,
etc. Can't get it to find the hightligted rows.

Any suggestions would be greatly appreciated.

I've copied in one of generic code segments that's failing. Its basically a
straight port from the migrated program that is still working. Watching
with the debugger I can see all the data in the DataGrid as the dg rows are
parsed with the 'for' loop. I usually highlight 4 or so rows in the middle
of the list. NADA. The ++iSelectedRowCount line NEVER runs.

NOTE: I understand that there is a NEW DataGridView control in Net 2.0 but
we're in the standard MAD RUSH of migrating from a UNIX DB to Sql Server
2005 AND moving all our Net 1.0 & Net 1.1 apps to Net 2.0. The app does a
BUNCH of drag-drop stuff and I'm not excited about having to replace the old
DataGrid controls with the new DataGridView controls. Could be a very deep
dark pit. Specially since this was supposed to be done yesterday.

Thanks for whatever help you can provide.

Barry
in Oregon

== Sample Code ==

private int CountSelectedDataGridRows(DataGrid pDg)
{
int i = 0;
int iSelectedRowCount = 0;

CurrencyManager cm =
(CurrencyManager)this.BindingContext[pDg.DataSource, pDg.DataMember];
DataView dv = (DataView)cm.List;

for (i = 0; i < dv.Count; ++i)
{
if ( pDg.IsSelected(i) )
{
++iSelectedRowCount;
}
}

return iSelectedRowCount;
}


May 3 '07 #1
0 1285

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Phil Townsend | last post by:
I need to add a button to a datagrid. I have tried using the ButtonColumn and have also tried adding a button to a templatecolumn > itemtemplate. Whatever I have tried doesn't work, nor does it...
4
by: Brad | last post by:
I'm not one to rant or flame....so please excuse me while I do so for this once. I've now spent a bit of time working with VS2005 beta 2 to see how it functions for web development, especially how...
6
by: Chris Botha | last post by:
I am porting an existing 2003 project to 2005. Yesterday I found that some of my Java script did not want to work. After eventually examining the HTML view of the new and old form for differences,...
7
by: Inga2005 | last post by:
I have developed an web site in VS2005 but I can't build a release version since the option is missing in the configuration manager. The second thing is that there isn't a bin folder placed in my...
9
by: DrZogg | last post by:
It can't be... say it isn't so... Yes.. there is a fly in the ointment This bug requires 3 projects... yes this is a real world production issue not some tinker toy thing. Start with a C#...
2
by: frostbb | last post by:
The following code works great in C# Net 1.0 & Net 1.1 apps ... doesn't work for Net 2.0 apps. Cannot get pDg.IsSelected(i) to toggle to 'true' for 'highlighted' rows in a DataGrid control. ...
6
by: =?Utf-8?B?Qm8gTWNJbHZhaW4=?= | last post by:
I have a installation package which installs ok when setup.exe is used, but if I try to install via msiexec, I get an error "This installation package could not be opened. Verify that the package...
1
by: Mel | last post by:
I have a datagrid control that has one column displaying a filename. When the link is clicked it opens the file. How do I open a file that resides on a remote server? The code below does not...
2
by: Nariban Barkan | last post by:
I need this page ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.WEBDEV.v10.en/dhtml/workshop/author/dhtml/reference/commandids.htm The online link (...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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...

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.