In a similar scenario I explicitly set the server click event (see below):
<asp:TemplateCo lumn>
<ItemTemplate >
<asp:LinkButt on Runat="server" Text="Submit"
OnClick="Submit Profile_Click"> </asp:LinkButton>
</ItemTemplate>
</asp:TemplateCol umn>
Then in the code I redirected the click event back to the ItemCommand event
for the grid:
Protected Sub SubmitProfile_C lick(ByVal sender As Object, ByVal e As
EventArgs)
Dim btn As LinkButton = CType(sender, LinkButton)
'NOTE: I set the CommandName of the LinkButton to the ItemIndex for
where it exists in the ItemDataBound event for the grid
Me.myGrid_ItemC ommand(Me, _
New
DataGridCommand EventArgs(myGri d.Items(Convert .ToInt32(btn.Co mmandName)), _
myGrid, _
New CommandEventArg s("Select", Nothing)))
End Sub
HTH,
Matt Dinovo
"serge calderara" <se************ @discussions.mi crosoft.com> wrote in
message news:2B******** *************** ***********@mic rosoft.com...
Dear all,
I gave a datagrid object wich has a template column define as follow :
<asp:TemplateCo lumn HeaderText="Evt ">
<ItemTemplate >
<asp:ImageButto n id="ImageButton 2" ImageAlign=Midd le runat="server"
ImageUrl="event .gif" CommandName="Sh owEvent" CommandArgument
='<%#DataBinder .Eval(Container ,"DataItem.ID") %>' >
</asp:ImageButton >
</ItemTemplate>
</asp:TemplateCol umn>
When I click on my imagebutton I would like to trig the Command event of
the
image button ?
How can I do that because phisycally the imagebutton is not seen in code
as
it belongs to template
Or may be it is not working with it ?
Thnaks for your help
regards
serge