PC Review


Reply
Thread Tools Rate Thread

Datagrid - Current row

 
 
Chad Z. Hower aka Kudzu
Guest
Posts: n/a
 
      16th Feb 2005
Well hopefully this will help some others now..
http://www.codeproject.com/useritems...CurrentRow.asp


--
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/
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      16th Feb 2005
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





 
Reply With Quote
 
Chad Z. Hower aka Kudzu
Guest
Posts: n/a
 
      16th Feb 2005
"Cor Ligthert" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):
> 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/
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      16th Feb 2005
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


 
Reply With Quote
 
Chad Z. Hower aka Kudzu
Guest
Posts: n/a
 
      16th Feb 2005
"Cor Ligthert" <(E-Mail Removed)> wrote in news:e1hcJlCFFHA.624
@TK2MSFTNGP15.phx.gbl:
> 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/
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Feb 2005
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


 
Reply With Quote
 
Chad Z. Hower aka Kudzu
Guest
Posts: n/a
 
      17th Feb 2005
"Cor Ligthert" <(E-Mail Removed)> wrote in
news:#(E-Mail Removed):
> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
datagrid current row mrstrong Microsoft Dot NET Framework Forms 1 9th Nov 2005 03:49 PM
datagrid current row mrstrong Microsoft Dot NET 2 8th Nov 2005 04:09 PM
Current Selected Row in a DataGrid =?Utf-8?B?U3RldmU=?= Microsoft Dot NET 4 11th Aug 2005 04:29 PM
Getting the current row of a datagrid Randy Microsoft C# .NET 2 19th Apr 2005 05:58 PM
Doing something when the current row in the datagrid changes Nevyn Twyll Microsoft Dot NET Framework Forms 1 25th May 2004 07:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:59 AM.