Hello,
I've a webdatagrid with a TemplateDataField:
<Columns> <ig:BoundDataField DataFieldName="Id" Hidden="true" Key="Id"> <Header Text="Id" /> </ig:BoundDataField> <ig:TemplateDataField Key="Zuweisen" Width="70px"> <ItemTemplate> <asp:Button ID="btnZuweisen" runat="server" Text="=>" > <img id="imgNeueAnfrage" alt="" src="./Bilder/ico_16_112.gif" /> </ItemTemplate> <Header Text="Bild"/> </ig:TemplateDataField></Columns>
In the InitializeRow-Event, I try to find the Controls:
Dim Button As Button = CType(e.Row.Items(1).FindControl("btnZuweisen"), Button)Dim Bild As HtmlImage = CType(e.Row.Items(1).FindControl("imgNeueAnfrage"), HtmlImage )
I find the button, but not the image. Why?
Bodo
Hello bodojaeger ,
Thank you for posting in our forum.
The image seems to be missing it’s runat=”server” tag. For that reason it’s not available on the server side. Add the tag and try getting it on the server side again.
Also make sure that you add the closing tag for the button.
Let me know if you’re still encountering the issue after these modifications.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Hello Maya,
Thanks for your answer.
I think you may be right, but this don't solve my problem.
I've the following problem:
I've have a webdatagrid with a TemplateDataField. In these field I need 2 buttons (or something else that can fire an onclick-event on the client). I need to make each of these buttons visible or not, depending on a value in another column in the row. And for the second button I need a client side onclick-event. I don't want any postbacks in these moment. The function, called by these event, needs a value (ID) of the actual row, that's is in another column.
My idea was, to use an <img> (without runat="server") to prevent the postback, but I can't find a way to make it visible or not.
Do you have an idea for me?