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

DGV RowsAdded and accessing the DataGridViewRow.DataBoundItem property = me killing myself!

<sigh....OK, here we go:

I have a databound DGV using a binding source. There are some columns in
the DGV which are NOT data bound. When I programatically add a new item to
my collection that is bound to the DGV the DGV.RowsAdded() events fires. In
this event I access the [new] DataGridViewRow via the RowIndex property of
the event args.

I'm getting an exception throw by the DataBoundItem property. it's a
KeyNotFoundException.

I've googled KeyNotFoundException and DataBoundItem and there are zero
results (Impressive!)

I have no idea what's happening. I wanted to ask here to see if anyone has
encountered something like this before OR... if someone can clue me in that
what I'm trying to do is bound (pun intended) to cause problems. I'm not a
DGV pro, so I'm quite lost (and frustrated) at this point.

Oh.. and if I try to go ahead and work with the DataBoundItem property in a
try/catch the exception is never actually throw. That is execution never
moves to the catch block, VS2k5 just stops doing anything. It's not hung,
but it's not running either. The way that I can see that in fact
DataBoundItem is throwing this exception is from inspecting it in the watch
window.

Hopefully someone will have some ideas for me... this is a weird one.

Thanks for reading,
Steve
Apr 20 '07 #1
0 1377

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

Similar topics

6
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item)...
2
by: Lecture Snoddddgrass | last post by:
Hi, When I create a UserControl-derived object, I often expose various public properties. One of the things that I hate about the WinForms designer is that if I decide to embed one of these...
1
by: Chowny | last post by:
I am fairly new to ASP .NET, and am busy teaching myself as I work through my current project. I'm a bit stumped at the moment. I have made a usercontrol called "RelatedClaims" . The code as...
9
by: WFB | last post by:
Hi, In asp.net 1.1, it was easy to add this to the properties of a page (class): Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath &...
39
by: clintonG | last post by:
This is not about starting a fight but an observation that seems to be proving itself on its own merit and is therefore simply a point of conjecture. I did not get serious about writing software...
1
by: Robert Bravery | last post by:
HI All, I'm trying to loop through a datagridview, and use values found in various columns. But problem is that I get errors newar the end. I'm assuming that it is reading the blank row at the...
4
by: John | last post by:
I am having a problem accessing the members in a structure via an interface and Class. ***Development Code*** Structure Person Public Name as String End Structure Interface IData Public...
1
by: AleXmanFree | last post by:
Hi, I am confused with behavior of this two Events in DataGridView control (in .net framework 2.0) when i am adding to grid a new text it calls RowsAdded event, but amaizing is that from time to...
0
by: =?Utf-8?B?Q2xhdWRl?= | last post by:
I want to know if it's possible to set the DataBoundItem of a DataGridViewRow manually and if so, how ? The DataBoudItem is a read-only. You'll say : "use the Datasource property to set the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.