Hi,
I am using a asp:datagrid which is editable. Though I have handlers wired to my edit, update & cancel events, some how when i click on the edit button nothing happens. The edit template items does not appear. I have to click on the edit once again for the items to change. Same thing happens when i click on the update & cancel buttons.
I found that though the event handler gets executed the first time (in all 3 cases) , it does not reflect in my page. :-(.
Here is my code:
<asp:DataGrid ShowFooter="true" OnItemCommand="grdSharedAssemblies_ItemCommand" CellPadding="0"
OnCancelCommand="grdSharedAssemblies_CancelCommand " CellSpacing="0" OnEditCommand="grdSharedAssemblies_EditCommand"
OnUpdateCommand="grdSharedAssemblies_UpdateCommand " ID="grdSharedAssemblies" AutoGenerateColumns="false" runat="server" >
<Columns>
<asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update"></asp:EditCommandColumn>
<asp:BoundColumn Visible="false" DataField="SHARED_ASSEMBLY_ID"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Shared Assembly Name">
<ItemStyle Width="200px" />
<ItemTemplate>
<asp:Label ID="lblSharedAssemblyName" Width="200px" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SHARED_ASSEMBLY_NAME") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Enter Shared Assembly Path">
<ItemStyle Width="400px" />
<ItemTemplate>
<asp:Label ID="lblSharedAssemblyPath" Width="400px" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "VSTS_PATH") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtSharedAssemblyPath" Width="400px" Text='<%# DataBinder.Eval(Container.DataItem, "VSTS_PATH") %>' runat="server"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
& here is a sample handler
protected void grdSharedAssemblies_EditCommand(object source, DataGridCommandEventArgs e)
{
grdSharedAssemblies.EditItemIndex = e.Item.ItemIndex;
grdSharedAssemblies.ShowFooter = false;
}
Please do help me.....
Much thanks in advance
~rp