Click to See Complete Forum and Search --> : datagrid inside user control wont fire events


Anton Margo
February 18th, 2005, 04:20 PM
Dear Professionals,

I have placed my datagrid :

...
<asp:Datagrid ID="DGEdu" runat="server"
OnDeleteCommand="DGEdu_Remove"
OnItemDataBound="DGEdu_ItemDataBound"
OnItemCommand="DGEdu_OnItemCommand"
AutoGenerateColumns="false"
ShowFooter="True">
<Columns>
...
</Columns>

in a user control. <%@ Control Language="VB"%> I include this control on my main page:
<%@ Register TagPrefix="EducationControl" TagName="EducationDG" Src="uc_education.ascx" %>

and in the middle of the html part i show it:
<EducationControl:EducationDG id="DGEdu" runat="server"/>

Now for some reason when the button clicks inside datagrid are made - the page just does a postback but does not seem to go to the DGEdu_OnItemCommand, as I tried to print something there and nothing happened. Seems that button events inside datagrid are not really attached to the datagrid events anymore. I think there is something missing, like call delegations from main page to user component, but i have no idea how to do so. If anyone knows anything to help, please ... Datagrid was copied out of main so it was working fine before, it loads from a non-empty dataset and seems to do everything but handling its button clicks.

Thank you,
AM