473,513 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access repeater datarowview

Dear Sir,

I need to access the datasource of a repeater control.

I used CType(e.Item.DataItem, DataRowView), but obviously it does not work.

Can some one tell me what I did wrong? See my code example below!

Sub MainItem_Created(ByVal sender As Object, ByVal e As
RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim But As LinkButton = CType(e.Item.FindControl("ButShow"), LinkButton)
Dim sRow As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim strName As String = sRow("MyName")
But.Text = strName
End If

End Sub
Nov 19 '05 #1
1 2501
Figure it out myself now.

Thanks any way.

Guoqi Zheng
http://www.dotnetnewsgroup.com
"Guoqi Zheng" <no@sorry.com> wrote in message
news:e3**************@TK2MSFTNGP14.phx.gbl...
Dear Sir,

I need to access the datasource of a repeater control.

I used CType(e.Item.DataItem, DataRowView), but obviously it does not work.
Can some one tell me what I did wrong? See my code example below!

Sub MainItem_Created(ByVal sender As Object, ByVal e As
RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim But As LinkButton = CType(e.Item.FindControl("ButShow"), LinkButton) Dim sRow As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim strName As String = sRow("MyName")
But.Text = strName
End If

End Sub

Nov 19 '05 #2

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

Similar topics

2
5507
by: Ed Allan | last post by:
I have extended the example at http://support.microsoft.com/default.aspx?scid=kb;EN- US;306154 to build a webform page with 3 layers of nested Repeaters (ie. parent, child and grandchild). I...
0
5384
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
0
1141
by: Darren Clark | last post by:
Is it possible to nest a drop down list in a repeater? (also the repeater has a nested repeater) The code i am using looks like.... i get an error saying that Exception Details:...
0
278
by: Maziar Aflatoun | last post by:
Hi, I found an example on Microsoft on having nest repeater controls. So I created a 3 tables -> Categories, Users and UserInfo. I like to display all the Categories and under it display all...
8
2895
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
1
2048
by: fredda054 | last post by:
Hi everybody ! With help from some nice people here I'm getting close to solve my problem with dbnull values in a repeater. I got it pretty much done, I just ned to fix some syntax. I get a...
0
917
by: roni | last post by:
hi. i create dataset that has 5 datatables in it. i set this dataset to repeater.datasource in the ItemDataBound event of the repeater i can access to the first table with : Dim dr As...
2
980
by: mavrick_101 | last post by:
Hi, I have a nested repeater and this is the code I have in the item data bound event private void _repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { RepeaterItem rItem =...
1
1492
by: Big Charles | last post by:
I have inner Repeater2 inside Repeater1. Problem is that I can't show the data of Repeater2 properly What is shown on Screen is: Line_1 Of Repeater_2 Line_2 Of Repeater_2 Line_3 Of...
0
7257
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
7157
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
7379
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
7521
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...
0
5682
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,...
1
5084
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...
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.