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

Datagrid - Current row

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/
Nov 16 '05 #1
6 2721
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.BindingCo ntext
[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

Nov 16 '05 #2
"Cor Ligthert" <no************@planet.nl> wrote in
news:uV**************@TK2MSFTNGP15.phx.gbl:
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.BindingCo ntext
[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/
Nov 16 '05 #3
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
Nov 16 '05 #4
"Cor Ligthert" <no************@planet.nl> 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/
Nov 16 '05 #5
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
Nov 16 '05 #6
"Cor Ligthert" <no************@planet.nl> wrote in
news:#Q**************@TK2MSFTNGP15.phx.gbl:
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/
Nov 16 '05 #7

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

Similar topics

0
by: Faith | last post by:
I found code on www.codeproject.com. Here is a sample it is called DataGridColumnDropDown. I modified it to use the text box when I wanted it to depended on a certain search criteria. Public...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
3
by: Carolyn Vo | last post by:
I have a datagrid in my web control class that I am trying to get the current rows displayed for. I have enabled paging on the datagrid so if the user is currently on page 3 of 8, and if I have...
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...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
4
by: Suzanne | last post by:
Hi all, I'm having problems with datagrids and the currentcellchanged event. My problem is this: I have a datagrid on a form, if the user changes the text in a cell on the datagrid then tries to...
3
by: Tim McKinney | last post by:
I have a read-only datagrid that I use to display a heirarchal model of three tables (The example I am setting up uses the Customer, Orders, and Order Detail tables from the northwind database). I...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
0
by: Melson | last post by:
Hi Can anyone help me with this problem. I've a form1(entry form) with datagrid which bound to a dataset (datagrid.setdatabinding(dataset,"table")). I've a public class Capturekey in form1 which...
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
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: 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
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.