473,811 Members | 3,299 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with repeater and datagrid

Hi I need help to display and edit data in a data grid within a repeater.
The code is below:

Sub dgrdEvents_Edit Command(sender As Object, e As DataGridCommand EventArgs)
dgrdEvents.Edit ItemIndex = e.Item.ItemInde x
BuildList()
End Sub
<asp:Repeater ID="rptEvents" RunAt="server">
<ItemTemplate >
<p><strong><% # Container.DataI tem("summary") %></strong>
<asp:DataGrid id="dgrdEvents " Width="500" BorderWidth="0" CellPadding="3"
CellSpacing="0" DataKeyField="e vent_id"
DataSource='<%# FilterEvents( Container.DataI tem("event_id") ) %>
OnEditCommand=" dgrdEvents_Edit Command"

<Columns>
<asp:BoundColum n Visible="False" HeaderText="" DataField="even tdate_id"
SortExpression= "eventdate_ id" />
<asp:TemplateCo lumn HeaderText="Sta rt Date">
<ItemTemplate >
<asp:label Text='<%# Container.DataI tem("start_date ") %>' runat="server"
/>
</ItemTemplate>
<EditItemTempla te>
<asp:Textbox id="txtStartdat e" Columns="8" Text='<%#
Container.DataI tem("start_date ") %>' runat="server" />
</EditItemTemplat e>
<ItemTemplate >
<asp:label Text='<%# Container.DataI tem("end_date") %>' runat="server"
/>
</ItemTemplate>
<EditItemTempla te>
<asp:Textbox id="txtEnddate " Columns="8" Text='<%#
Container.DataI tem("end_date") %>' runat="server" />
</EditItemTemplat e>
</asp:TemplateCol umn>
<asp:EditComman dColumn EditText="Edit" UpdateText="Sav e"
CancelText="Can cel" />
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:Repeater>
Clicking on the Edit link should open an item (eg. start date) of the data
grid for editing. I am getting this error:
"Name 'dgrdEvents' is not declared
.....
Line 109: dgrdEvents.Edit ItemIndex = e.Item.ItemInde x".

If datagrid is not in a repeater the code above works fine. I understand
that because of the nature of a repeater the id of given data grid is not
known and I cannot set it statically. So my quesiton is how can I open a
given row in a grid for editing, given that this grid resides inside of a
repeater.
Thank you
Nov 18 '05 #1
2 1792
dump the repeater and use a datalist
Nov 18 '05 #2
This is not my app and I cant really make these kind of changes, at the end
if there is no alternative I would have to, but I think there should be a
way. Unfortunately, I am a novice and have to learn as I go...
"Josh" <so*****@micros oft.com> wrote in message
news:Oe******** ******@TK2MSFTN GP10.phx.gbl...
dump the repeater and use a datalist

Nov 18 '05 #3

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

Similar topics

2
3305
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object reference not set to an instance of an object". This error message commonly occurs when a server control is incorrecly declared, so naturally I have double checked this. To test this, I moved the aspx code for the DataGrid ('myNestedDataGrid')...
2
2065
by: Daniel | last post by:
I'm new to .Net and all of its abilities so I hope this makes sense. Basically I'm confused on when is the appropriate time to use web forms controls vs. regular HTML. For example in ASP (non-.Net) if I wanted to fill a list it may look something like this: -------START CODE <%
7
2005
by: Scott Schluer | last post by:
Hi All, I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information. I now have a need to drop this datagrid into a repeater on "Page 2". The repeater will grab ALL orders within a given date range and output the datagrids for each order. Remember, the Page 1 is built to display one...
4
1532
by: News | last post by:
I have a page with many controls. Among these controls there is a table which is a datagrid with nested repeater inside. My problem is that I can not use DataGridCommandEventArgs to get datagrid elements because submit button is not in datagrid and uses onClick event btnSaveServicePlanUpdate. Here is the code: Sub btnSaveServicePlanUpdate_OnClick(sender As Object, e As EventArgs) ' need to get the key value serviceplanprogram_id and...
3
2867
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and creating elements on the fly dynamically. I have a control that needs to display 3 columns and n number of rows depending on number of records. Sounds simple. But each Row has a control with its own data source binding and value must be selected...
1
1319
by: Ryan Ternier | last post by:
I'm having the issue is when I re-bind my repeater to show the changes done to it from the code behind. I'm binding this repeater from a DataTable that is stored in the ViewState for now. It might change later, but that's where I'm gettting it from. I have an Image Button that allows users to move a Record Up one space (order).
3
1515
by: gg77 | last post by:
Hi, I don't have much knowledge of the table control. I am basically trying to use a table thats populated with data rows from a dataSet but currently things aren't working for me. below is the sample HTML that I have: <asp:TableRow> <asp:TableCell Text="Company" ID="CompanyCode"
2
5524
by: Ceema M via DotNetMonster.com | last post by:
Hello all, I have a nested repeater, which displays categories(parent repeater) and corresponding subcategories(child repeater). Both repeaters have checkboxes. When I check category checkbox and subcategory check boxes and click on submit button , I have to retrieve the corresponding categoryid and subcategory id, so that I can store it to a table. I am getting the categoryid but I am failing to get subcategoryid(actually I don't know...
1
1431
by: Hans Merkl | last post by:
Hi, I must be missing something here. In a DataList and DataGrid I can use the property DataKeys to identify the selected element and get to its values. But I can't find a way to do the same in a Repeater. Can anybody give me an idea how to this in a Repeater or point me to some sample code? Thanks
0
9607
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10395
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...
0
10137
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
9211
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
7673
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
5561
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
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4346
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 we have to send another system
3
3026
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.