473,883 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Row/Cell of Datagrid - Still need help! (Please?)

I've been trying since last Friday to get an answer on how to get a SPECIFIC row.cell value from a datagrid. I've had plenty of suggestions, but nothing works to get the value from a SPECIFIC Row and cell. Right now I have this code

Sub Item_Bound(ByVa l sender As Object, ByVal e As DataGridItemEve ntArgs
lbl_test.Text = lbl_test.Text & " " & e.Item.ItemInde
Session("wa_tot _gal") = e.Item.Cells(7) .Tex
Response.Write( Session("wa_tot _gal")
End Su

it returns
1¢ Amount (NRS 373.030)0000000 00000000120

this information is from every row (including the header) I need the specific information for the value 12 returned to me so I can use that value as a session variable that needs to populate another web page table. I can NOT get it to return the SPECIFIC Row data! Please, can someone help me? Thanks much, Coleen
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #1
21 2394
Dim ROW as Int32=1

Dim COL as Int32=1

MessageBox.Show (dgPeople.Item( ROW ,COL).ToString( ))
OHM

coleenholley wrote:
I've been trying since last Friday to get an answer on how to get a
SPECIFIC row.cell value from a datagrid. I've had plenty of
suggestions, but nothing works to get the value from a SPECIFIC Row
and cell. Right now I have this code:

Sub Item_Bound(ByVa l sender As Object, ByVal e As
DataGridItemEve ntArgs) lbl_test.Text = lbl_test.Text & " " &
e.Item.ItemInde x Session("wa_tot _gal") = e.Item.Cells(7) .Text
Response.Write( Session("wa_tot _gal"))
End Sub

it returns:
1¢ Amount (NRS 373.030)0000000 00000000120

this information is from every row (including the header) I need the
specific information for the value 12 returned to me so I can use
that value as a session variable that needs to populate another web
page table. I can NOT get it to return the SPECIFIC Row data!
Please, can someone help me? Thanks much, Coleen.
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's
Largest Community Website: http://www.dotnetjunkies.com/newsgroups/


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #2
Cor
Hi Coleen,

I tested that code I did send you.

And that is not the code I see now.

Did it not work?

Cor
Nov 20 '05 #3
Thanks OHM, however it does not work. I tried:

Response.Write( dtg_worksheet1. Item(ROW, COL).ToString() )

I can't use a messagebox in the ASPX VB code-behind, so I tired a Response.write - I get an error "Item is not a member of System.Web.UI.W ebControls.Data Grid" - so I tried:

Response.Write( dtg_worksheet1. Items(ROW).ToSt ring) - which gives me a compliation error "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Any other suggestions?

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #4
Hi Cor - Thanks, but no, it didn't. I can get the column, or the cell, but I NEED the specific row and cell value. What I really don't undertand, is why does it work perfectly in an ASP.Net table and yet there is no function for a datagrid to return the value of a specific Row().Cell()? Even if you don't know exactly how many rows are going to be returned, you should be able to get a specific Row/Cell value from a datagrid! I've read everything in the Help files I can find, tried all the suggestions and CAN'T get the specific Row/cell value I need. Any help is GREATLY appreciated. Thanks :-)

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #5
thr ROW and COL are just my variables, replace them with actual variables or
a number and try it. The messagebox was just a suggestion


coleenholley wrote:
Thanks OHM, however it does not work. I tried:

Response.Write( dtg_worksheet1. Item(ROW, COL).ToString() )

I can't use a messagebox in the ASPX VB code-behind, so I tired a
Response.write - I get an error "Item is not a member of
System.Web.UI.W ebControls.Data Grid" - so I tried:

Response.Write( dtg_worksheet1. Items(ROW).ToSt ring) - which gives me a
compliation error "Index was out of range. Must be non-negative and
less than the size of the collection. Parameter name: index" Any
other suggestions?

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's
Largest Community Website: http://www.dotnetjunkies.com/newsgroups/


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #6
Sorry, on my last post, I didn't put that I tried that..

Response.Write( dtg_worksheet1. Item(16, 7).ToString()) - I get an error (Blue Squigleys) that "Item is not a member of System Web.UI.WebContr ols.Datagrid. I tried using Items instead of Item, but still get an error "Too many arguments to Public.OVerload s ReadOnly Default propert Item(Index as Integer) as System Web.Ui.WebContr ols.DataGrid" Any suggestion on why I am getting these errors? Do I need to Import another System Namespace? Thanks for your help. COleen

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #7
Sorry Cor, I did not get your post from my other thread until just now. I tried your code and get this error:

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
This is the code I tried:

Dim a As String = dtg_worksheet1. Items(16).Cells (7).Text
Session("wa_tot _gal") = a
Response.Write( Session("wa_tot _gal"))
I've been remming one suggestion, trying another, and trying the help file suggestion of:
Dim X As String
X = e.Item.Cells(7) .Text.IndexOf(1 6).ToString
Response.Write( X) - This returns me -1-1-1-1-1-1-1-1-1....

Thanks for all of your help :-)

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #8
Cor
Are you sure you tested this code and it did not work, I did test it on a
webform datagrid and it did give me back the information from the row and
the cell from the datagrid.

When clicked
Dim a As String = grd.Items(e.Ite m.ItemIndex).Ce lls(3).Text

or as you ask

Dim a as string = grd.Items(15).C ells(6).Text

And i got a row (Items) and a Cell value, I real do not understan why this
is not working with you.

Cor

Hi Cor - Thanks, but no, it didn't. I can get the column, or the cell,

but I NEED the specific row and cell value. What I really don't undertand,
is why does it work perfectly in an ASP.Net table and yet there is no
function for a datagrid to return the value of a specific Row().Cell()?
Even if you don't know exactly how many rows are going to be returned, you
should be able to get a specific Row/Cell value from a datagrid! I've read
everything in the Help files I can find, tried all the suggestions and CAN'T
get the specific Row/cell value I need. Any help is GREATLY appreciated.
Thanks :-)
Nov 20 '05 #9
Cor
Hi Colleen,

The 16th row is 15 because it starts on 0
The 7th cel is 6 because it starts on 0,

That was also in my sample.

Cor

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Nov 20 '05 #10

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

Similar topics

5
3502
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql, because the dates must have quotes on each side. I just don't know how make the dates right. Well I'll just show you the code and some insert statements it generates. Could anyone please help me?
1
406
by: LilleSkutt | last post by:
I am trying to create and instantiate a class into a created domain, so that I can unload the domain and replace the class (assembly .dll) while the main application is running, but I can't get it to work for some reason. Here is the code: ' Create an appdomain Try Dim setup As AppDomainSetup = New AppDomainSetup setup.ApplicationBase = "C:\test" setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory setup.ApplicationName =...
14
2179
by: TrvlOrm | last post by:
OK. After much playing around, I managed to get my frame page this far.. see code below. BUT...there are still errors with it, and what I would like to have happened is this: 1) On the Left Frame (File LeftEx8_2.html) a series of buttons, which when clicked prompt the user to enter information for background color, text color, link color, title and some text.
1
3448
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this. Before: ----------
4
2285
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this dataSet updating lark when i realised that i think i am right back at square 1!!! Here's my scenario - i have a SQLDB and i retrieve all my data from that into a dataset and display this to a datagrid(WebForm). I have got this grid sorted and...
0
1100
by: Lemune | last post by:
Hello everyone. I'm creating windows service application to capture data from my PABX, and send the data to sql server. My question is how could my application know when that PABX is sending data and not? I get really confused here. Please check my code and give me some idea or clue or help please :). Thanks in advance. My code is like this: Dim DBConnection As SqlConnection Dim WithEvents SPConnection As SerialPort = New...
6
3538
by: Derek | last post by:
Hi all any one please help, i have a buttin in flash 8 which gets a form contact.php but when it is pressed the emial ruturns empty as follows 1 the flash button 2 the form 3 the email outcome (empty) the form on (release) { _parent.getURL("contact.php","_blank", "GET"); _parent.name=""; _parent.phone="";
2
2603
by: Richard | last post by:
Help please. I am trying to autofill a form text field from a select-box lookup. I have no problem doing this if the select-box is part of the form but because there are 5 possible select boxes for them to choose from and because of the very large number of options in each select box, to save form loading time, I want to put the look-up select boxes on separate (pop-up) pages. (I prefer them not to be hidden divs on the same page) ...
5
1339
by: Ra7al143 | last post by:
hi everybody, i need help please with the following example: i have the following table: id -------------- coursenumber 123 -------------- 222 123 -------------- 111 1234 -------------- 222
5
5029
by: mvmashraf | last post by:
Hi to all.... I have spent some time browsing for a solution to the following error but have unfortunatly not found any solution yet ,Please any help would be much appreciated.... ------------------------------------------------------------------------------------------------- This is the full error description... "Error Message :Invalid character in a Base-64 string." Error Source :mscorlib Error Stack Trace : ...
0
10768
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10868
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9591
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7984
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7137
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5808
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6009
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4231
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.