Datagrid - Current row

  • Thread starter Chad Z. Hower aka Kudzu
  • Start date
C

Cor Ligthert

Kudzu,

With all respect.

You called the sample I gave you, what can be written in a lot of other
ways, a Boeing 747

DataRowView xDRV =
((DataView)dataGrid1.DataSource)[((CurrencyManager)BindingContext
[dataGrid1.DataSource]).Position];

And show us now this sample which is in fact not so different

DataRowView xDRV = (DataRowView)((CurrencyManager)dataGrid1.BindingContext
[dataGrid1.DataSource, dataGrid1.DataMember]).Current;

You are an expert in flying of course, what will you tell what kind of plane
this sample is?

With what I have nothing against the second sample.

Cor
 
C

Chad Z. Hower aka Kudzu

Cor Ligthert said:
You called the sample I gave you, what can be written in a lot of other
ways, a Boeing 747

DataRowView xDRV =
((DataView)dataGrid1.DataSource)[((CurrencyManager)BindingContext
[dataGrid1.DataSource]).Position];

And show us now this sample which is in fact not so different

DataRowView xDRV =
(DataRowView)((CurrencyManager)dataGrid1.BindingContext
[dataGrid1.DataSource, dataGrid1.DataMember]).Current;

You are an expert in flying of course, what will you tell what kind of
plane this sample is?

One is a 747 and one is an MD-11. :)

Neither is easy like it should be. Theres nothing "wrong" with either one.
Both are extraordinarily too much work to just get a row. We have two
planes airborne - but we're in need of a car....

I think you still missed what I meant when I said a 747. I was saying that
wat I should be taking is a car to get milk - but getting the current row
is like having to fly a 747 to the store because thats what it feels like
in .NET - but the task I want to do SHOULD be simple but its not.

Ive had but 2 hours sleep in about 3 - but offhande you still need to add
..Row to the both above..?


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
 
C

Cor Ligthert

Kudzu,

About the "car" sentence we agree. However, I was suprises that you showed
this "airoplane" as "the solution" while you wanted to go by feet to buy
milk.

I tested both by the way.

Cor
 
C

Chad Z. Hower aka Kudzu

Cor Ligthert said:
About the "car" sentence we agree. However, I was suprises that you showed
this "airoplane" as "the solution" while you wanted to go by feet to buy
milk.

I tested both by the way.

But there is no way to walk or even take a car.. thats just it... Both
solutions are very clunky. One is a few characters more than the other, but
its still a big hodgepodge of classes and typecasts. Maybe one is a 737 and
one is a 757 - but compared to the car that we need, they are BOTH way too
big and thus their difference is nil.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
 
C

Cor Ligthert

Kudzu,

On the other hand, there is in a standard operation not much reason to get a
row.

You can use the binding (before you tell it, where the endcurentedid is
clumsy) however you don't need the row, when you have binded it.

The milk will be delivered.

:)

Cor
 
C

Chad Z. Hower aka Kudzu

Cor Ligthert said:
On the other hand, there is in a standard operation not much reason to
get a row.

You can use the binding (before you tell it, where the endcurentedid is
clumsy) however you don't need the row, when you have binded it.

Its very often that you do need the row. The grid only shows visible data,
and often grids are used to select data, from which you need more data that
is not visible, and therefore unbound. Imagine grid showing employees, but
you dont want to display the SS#, or private information, but its kept in the
datarow that its bound to.

In fact we use this operation nearly every time we use a grid.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Extending C# 4
DBGrid, CurrentRow. Easier way? 8
Implicit overloads, non static 25
What does this do? Object[0] 12
Current Exception 14
VB.NET vs VB 8
"What is better" question ... 6
Formatting databound values 7

Top