473,398 Members | 2,812 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,398 software developers and data experts.

returning datagrid value

Hello

Desktop app; VB.Net datagrid

This returns cell text for first col:
Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
DataGrid1.CurrentCell.ColumnNumber = 0)

but

Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
DataGrid1.CurrentCell.ColumnNumber = 1)

does not return second col text ... it still returns col 0!

Any ideas how to return col 1 text?

Thx

Graeme
Nov 21 '05 #1
2 4764
Hi,

Specify the column number. Dont have vb.net convert a boolean value
(DataGrid1.CurrentCell.ColumnNumber = 1) to an integer and expect to know
which column you want.

Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 0)
Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 1)

Ken
--------------------
"Saladin" <ma****************@wave.co.nz> wrote in message
news:ue*************@TK2MSFTNGP15.phx.gbl...
Hello

Desktop app; VB.Net datagrid

This returns cell text for first col:
Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
DataGrid1.CurrentCell.ColumnNumber = 0)

but

Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
DataGrid1.CurrentCell.ColumnNumber = 1)

does not return second col text ... it still returns col 0!

Any ideas how to return col 1 text?

Thx

Graeme

Nov 21 '05 #2
thanks ken. makes more sense now!
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eg**************@TK2MSFTNGP14.phx.gbl...
Hi,

Specify the column number. Dont have vb.net convert a boolean value
(DataGrid1.CurrentCell.ColumnNumber = 1) to an integer and expect to know
which column you want.

Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 0)
Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 1)

Ken
--------------------
"Saladin" <ma****************@wave.co.nz> wrote in message
news:ue*************@TK2MSFTNGP15.phx.gbl...
Hello

Desktop app; VB.Net datagrid

This returns cell text for first col:
Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
DataGrid1.CurrentCell.ColumnNumber = 0)

but

Me.TextBox5.Text = Me.DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
DataGrid1.CurrentCell.ColumnNumber = 1)

does not return second col text ... it still returns col 0!

Any ideas how to return col 1 text?

Thx

Graeme

Nov 21 '05 #3

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

Similar topics

2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
2
by: ALI-R | last post by:
Hi All, My datagrid is now bound and working, Now I have two other issues: 1)My datagrid is in another form and I need to return the value of a coulmn which user has selected to the caller...
0
by: George Durzi | last post by:
cross posted in datagrid group. Inside <columns/> in my datagrid, I have the following template column <asp:templatecolumn HeaderText="To Be Completed By"> <itemtemplate> <asp:Label...
0
by: Xaviero | last post by:
I have a textbox in my editItemTemplate within my datagrid. This textbox's autoPostback property is true, so I can do some verfications before the user moves on to the next textbox. My verification...
7
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
1
by: Peter W Johnson | last post by:
Hi Guys, I have a form setup with a Datagrid. The Datagrid has a combobox in one column. I am trying to find out the value of the combobox after it has been changed. I have added a handler...
5
by: knowdotnet | last post by:
Hi all, Which is the best way to return a value back to the web page from a pop up page? I have a asp.net web application which opens a popup page on a link button click. The Link button is...
4
by: Landes | last post by:
Hiya, I have the following code in a C# aspx page, but I keep getting the error that 'ExceptionCategoryId_' not found. Looks like the QueryString is not returning anything. <asp:DataGrid...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.