473,396 Members | 1,891 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.

Placeholder in datagrid/datalist

Is it possible to create a placeholder inside a template column of a
datagrid? My goal is to use a placeholder, and during runtime add user
controls to the placeholder as the items in the datagrid are being built.

I've tried doing this with a simple link button, but I get the "Object
Reference not set to an instance of an object" whenever I try to view the
page.

Here's the html code for the placeholder in my datagrid:
<ItemTemplate>
<asp:PlaceHolder ID="test" Runat="server"
Visible="True"></asp:PlaceHolder>
</ItemTemplate>

Here's the section of code I'm trying via the itemcreated sub for the
datagrid...
Dim myPlace As PlaceHolder
myPlace = e.Item.FindControl("test")
Dim newbutton As New LinkButton
newbutton.Text = "Hit Me"
ewbutton.ID = "sale" & e.Item.ItemIndex
myPlace.Controls.Clear()
myPlace.Controls.Add(newbutton)

Any Help is appreciated!

- Chad
Nov 18 '05 #1
2 3042
Hi Chad,

Have you had a chance to check out my suggestions or have you got any ideas
on this issue? If you need any further assistance, please feel free to post
here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Hi Steve,

thanks for the prompt help. I've actually not had a chance to try your
suggestions yet. We ended up using a panel, and was successfully using
that.

- Chad
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:TU*************@cpmsftngxa06.phx.gbl...
Hi Chad,

Have you had a chance to check out my suggestions or have you got any ideas on this issue? If you need any further assistance, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3

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

Similar topics

0
by: CoreyMas | last post by:
Hello everyone, I am in a bit of a dilema trying to write an HTML <br> tag into a panel or placeholder. Here is the situation I have 4 tables that represent 4 levels of data (level4 is...
0
by: Chris Ericoli | last post by:
Hi, I am wanting to add a usercontrol programatically to a placeholder's control collection. The placeholder is coded within the ITEMTEMPLATE of a datalist. The problem that I am facing, is...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
0
by: dfetrow410 | last post by:
How do I replace the place holder <asp:Content ID="content2" ContentPlaceHolderID="leadercontent" runat="Server"> <asp:DataList ID="DataList2" runat="server" OnItemDataBound = ddccd ...
0
by: Chris | last post by:
I've been searching all over and think I am close, but keep getting the error "Index out of range" when trying to reference a nested datagrid when an OnEditCommand event is raised. When the...
1
by: Stuart Shay | last post by:
Hello All: I have a Datalist where each row has TextBoxes and Dropdowns that are created dynamically. The code renders correctly and is very similar to this sample I found ...
1
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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
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...
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.