K
Kristoffer Arfvidson
<aspataGrid id="DataGrid1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" Font-Names="Verdana, Arial, Helvetica,
sans-serif"
AllowCustomPaging="True" GridLines="Horizontal">
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="Teal"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<HeaderTemplate>
<b><asp:label id="lblHeadline" Runat="server"></asp:label></b>
</HeaderTemplate>
<ItemTemplate>
and so on...
HOW???
Can I access lblHeadline from codebehind?
I got some answer before that you should use Findcontrol...
I can believe that this is the right answer, but I simply can´t find that
control...
I tryed:
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
Dim tmpCtrl As Object
'tmpCtrl = e.Item.FindControl("lblHeadline")
tmpCtrl = DataGrid1.FindControl("lblHeadline")
tmpCtrl .Text = "HELLO!"
End Sub
but, I simply can not find the damn thing...
I believe that the reason is that it is lying behind a asp:templatecolumn,
but I tryed to put an id on that but my VS simply dont want me to...
Any suggestions on how to find this label?
Yours: Kristoffer
AutoGenerateColumns="False" Font-Names="Verdana, Arial, Helvetica,
sans-serif"
AllowCustomPaging="True" GridLines="Horizontal">
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="Teal"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<HeaderTemplate>
<b><asp:label id="lblHeadline" Runat="server"></asp:label></b>
</HeaderTemplate>
<ItemTemplate>
and so on...
HOW???
Can I access lblHeadline from codebehind?
I got some answer before that you should use Findcontrol...
I can believe that this is the right answer, but I simply can´t find that
control...
I tryed:
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
Dim tmpCtrl As Object
'tmpCtrl = e.Item.FindControl("lblHeadline")
tmpCtrl = DataGrid1.FindControl("lblHeadline")
tmpCtrl .Text = "HELLO!"
End Sub
but, I simply can not find the damn thing...
I believe that the reason is that it is lying behind a asp:templatecolumn,
but I tryed to put an id on that but my VS simply dont want me to...
Any suggestions on how to find this label?
Yours: Kristoffer