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

accessing datagrid cell

Sam
Hi all,

Would some one tell me why the value of the e.Item.Cells(index).Text
argument in my datagrid control update event is empty even though I have it
populated? If I want to know a value of a cell in my datagrid control, it it
better to use this expression "MyString =
Ctype(e.Item.cells(index).Controls(0), textbox).text" or this expression
"e.Item.Cells(index).Text"?

If a column of my datagrid control is populated with data but it's not
visible, can is values still be read?

Thank you

Sam
Apr 2 '06 #1
3 1402
You are on the right track but you need to get it in the OnItemDataBound.
Hope that helps
Patrick
"Sam" <as****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi all,

Would some one tell me why the value of the e.Item.Cells(index).Text
argument in my datagrid control update event is empty even though I have
it populated? If I want to know a value of a cell in my datagrid control,
it it better to use this expression "MyString =
Ctype(e.Item.cells(index).Controls(0), textbox).text" or this expression
"e.Item.Cells(index).Text"?

If a column of my datagrid control is populated with data but it's not
visible, can is values still be read?

Thank you

Sam

Apr 2 '06 #2
Sam,

Controls with Visible=false don't get sent to the client and, as a result,
you won't get their values on postback. Use css rule display:none in the
cases when you need the controls on client-side or in postbacks.

Eliyahu

"Sam" <as****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi all,

Would some one tell me why the value of the e.Item.Cells(index).Text
argument in my datagrid control update event is empty even though I have
it populated? If I want to know a value of a cell in my datagrid control,
it it better to use this expression "MyString =
Ctype(e.Item.cells(index).Controls(0), textbox).text" or this expression
"e.Item.Cells(index).Text"?

If a column of my datagrid control is populated with data but it's not
visible, can is values still be read?

Thank you

Sam

Apr 2 '06 #3
Sam
It helps. Thanks for the tips guys

Regards,
Sam

"Sam" <as****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi all,

Would some one tell me why the value of the e.Item.Cells(index).Text
argument in my datagrid control update event is empty even though I have
it populated? If I want to know a value of a cell in my datagrid control,
it it better to use this expression "MyString =
Ctype(e.Item.cells(index).Controls(0), textbox).text" or this expression
"e.Item.Cells(index).Text"?

If a column of my datagrid control is populated with data but it's not
visible, can is values still be read?

Thank you

Sam

Apr 2 '06 #4

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

Similar topics

0
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
4
by: Souri Challa | last post by:
Hello All, When a datagrid in a web form is getting re populated from view state on post back, it is firing the datagrid Item Created event but the DataGridItem(e.Item.DataItem is null) in the...
1
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to...
13
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
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...
4
by: tg | last post by:
Visual Studio 2003 My problem is that I am dynamically creating a datagrid on pageload. The datagrid is completely dynamic as it is based on the number of columns returned from a recordset. The...
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...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
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: 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?
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
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.