Datagrid的行/单元 - 仍然需要帮助! (请?) [英] Row/Cell of Datagrid - Still need help! (Please?)
问题描述
自上周五以来,我一直在尝试获取有关如何从数据网格获取SPECIFIC row.cell值的答案。我有很多建议,但没有什么可以从SPECIFIC Row和cell中获取价值。现在我有这个代码
Sub Item_Bound(ByVal sender As Object,ByVal e As DataGridItemEventArgs
lbl_test.Text = lbl_test.Text&"" & e.Item.ItemInde
Session(" wa_tot_gal")= e.Item.Cells(7).Tex
Response.Write(Session(") wa_tot_gal")
结束苏/
它返回
1?¢金额(NRS 373.030)000000000000000120
此信息来自每一行(包括标题)我需要返回给我的值12的特定信息,因此我可以将该值用作需要填充另一个网页表的会话变量。我可以不要让它返回SPECIFIC Row数据!拜托,有人可以帮助我吗?非常感谢,Coleen
---
发表于使用Wimdows.net NntpNews组件 - 发表于.NET最大的社区网站: http://www.dotnetjunkies.com/news groups /
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(ByVal sender As Object, ByVal e As DataGridItemEventArgs
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)000000000000000120
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/
推荐答案
Dim ROW as Int32 = 1
Dim COL as Int32 = 1
MessageBox.Show(dgPeople.Item(ROW,COL).ToString())
OHM
coleenholley写道:
Dim ROW as Int32=1
Dim COL as Int32=1
MessageBox.Show(dgPeople.Item(ROW ,COL).ToString())
OHM
coleenholley wrote:
自上周五以来,我一直在努力寻求如何从数据网格中获取特定的row.cell值的答案。我有很多建议,但没有什么可以从SPECIFIC行和单元格中获取价值。现在我有这个代码:
Sub Item_Bound(ByVal sender As Object,ByVal e As
DataGridItemEventArgs)lbl_test.Text = lbl_test.Text& " " &
e.Item.ItemIndex Session(" wa_tot_gal")= e.Item.Cells(7).Text
Response.Write(Session(" wa_tot_gal"))
结束它返回:
1?¢金额(NRS 373.030)000000000000000120
这个信息来自我需要的每一行(包括标题)
值12的具体信息返回给我,因此我可以将该值用作需要填充另一个web页面表的会话变量。我不能让它返回SPECIFIC Row数据!
请有人帮帮我吗?非常感谢,Coleen。
---
使用Wimdows.net发布NntpNews组件 - 从.NET发布的
最大的社区网站: http://www.dotnetjunkies.com/newsgroups/
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(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) lbl_test.Text = lbl_test.Text & " " &
e.Item.ItemIndex Session("wa_tot_gal") = e.Item.Cells(7).Text
Response.Write(Session("wa_tot_gal"))
End Sub
it returns:
1?¢ Amount (NRS 373.030)000000000000000120
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/
-
最诚挚的问候 - OHM
O_H_M {at} BTInternet {dot} com
--
Best Regards - OHM
O_H_M{at}BTInternet{dot}com
>
嗨Coleen,
我测试了我发给你的代码。
这不是我现在看到的代码。
它不起作用吗?
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
感谢OHM,不过它不起作用。我试过了:
Response.Write(dtg_worksheet1.Item(ROW,COL).ToString())
我不能用ASPX VB代码隐藏中的消息框,所以我累了一个Response.write - 我得到一个错误Item不是System.Web.UI.WebControls.DataGrid的成员 - 所以我试过了:
Response.Write(dtg_worksheet1.Items(ROW).ToString) - 这给了我一个compliation错误索引超出了范围。必须是非负数且小于集合的大小。参数名称:index"还有其他任何建议吗?
---
发表于使用Wimdows.net NntpNews组件 - 发布于.NET最大的社区网站: http://www.dotnetjunkies.com/newsgroups/
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.WebControls.DataGrid" - so I tried:
Response.Write(dtg_worksheet1.Items(ROW).ToString) - 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/
这篇关于Datagrid的行/单元 - 仍然需要帮助! (请?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!