C
Chad Crowder
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>
<asplaceHolder ID="test" Runat="server"
Visible="True"></asplaceHolder>
</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
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>
<asplaceHolder ID="test" Runat="server"
Visible="True"></asplaceHolder>
</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