Aswathy 0 Newbie Poster

Hi

The problem i am facing is

I have a datagrid and this datagrid has its edit event handler registered and mapped .Now the issue ia that when i click on edit link in the datagrid , the control is going inside the edit event handler twice. Only after entering the edit event handler twice does the datagrid open up for editing.

Could someone help me out to get rid of this issue.

The asp code for the datagrid is as follows:

<asp:datagrid id="DataGrid1" runat="server" Width="1434px" AllowSorting="True" OnUpdateCommand="DataGrid1_UpdateCommand" OnCancelCommand="DataGrid1_CancelCommand" OnEditCommand="DataGrid1_EditCommand" AutoGenerateColumns="False" DataKeyField="iid">
<AlternatingItemStyle Font-Size="8.5pt" Font-Names="Arial" BackColor="#B5DFF7"></AlternatingItemStyle>
<ItemStyle Font-Size="8.5pt" Font-Names="Arial" CssClass="TableBodyText"></ItemStyle>
<HeaderStyle Font-Size="Smaller" Font-Names="Arial" Wrap="False" HorizontalAlign="Center" ForeColor="White"
CssClass="TableHeadText" BackColor="DodgerBlue"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Select All">
<HeaderTemplate>
<INPUT id="checkAll" onclick="DGSelectOrUnselectAll('DataGrid1',this,'chkDel')" type="checkbox">
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox id="chkDel" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>


<asp:TemplateColumn SortExpression="Project" HeaderText="Opportunity Description">
<ItemTemplate>
<asp:Label id=Label19 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Opportunity") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=txtOpp runat="server" CssClass="DDText" Visible=true Text='<%# DataBinder.Eval(Container, "DataItem.Opportunity") %>'>
</asp:TextBox>
<asp:Label id="lblOpp" runat="server" Visible="False">Label</asp:Label>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn SortExpression="Probability" HeaderText="Probability %">
<ItemTemplate>
<asp:Label id=Label20 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Probability") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=txtProbability runat="server" CssClass="DDText" Text='<%# DataBinder.Eval(Container, "DataItem.Probability") %>'>
</asp:TextBox>
<asp:Label id="lblProbabililty" runat="server" Visible="False">Label</asp:Label>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="No of Resources*">
<ItemTemplate>
<asp:Label id=Label21 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ResReqNo") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=txtResReqNo runat="server" CssClass="DDText" Text='<%# DataBinder.Eval(Container, "DataItem.ResReqNo") %>'>
</asp:TextBox>
<asp:Label id="Label22" runat="server" Visible="False">Label</asp:Label>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn SortExpression="Role" HeaderText="Role / Profile*">
<ItemTemplate>
<asp:Label id=Label13 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Role") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:dropdownlist id=ddGridRole runat="server" CssClass="DDText" SelectedIndex='<%# GetDropDownID((string)DataBinder.Eval(Container.DataItem, "Role"),"Role") %>' DataSource='<%# FillDropDown("Role") %>' DataTextField="Role" DataValueField="Role">
</asp:dropdownlist>
<asp:Label id="Label23" runat="server" Visible="False">Label</asp:Label>
</EditItemTemplate>
</asp:TemplateColumn>


<asp:TemplateColumn SortExpression="ReqFrom" HeaderText="Required From*">
<ItemTemplate>
<asp:Label id=Label10 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Required From") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=txtStartDate runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Required From") %>' CssClass="DDText">
</asp:TextBox>
<asp:ImageButton id="ibFrom" runat="server" Width="20px" ImageUrl="images/calendar.jpg" CommandName="Show"></asp:ImageButton>
<asp:Label id="Label29" runat="server" Visible="False">Label</asp:Label>
</EditItemTemplate>
</asp:TemplateColumn>


<asp:BoundColumn DataField="RequestOpenDate" SortExpression="RequestOpenDate" ReadOnly="True" HeaderText="Request  Date"
DataFormatString="{0:dd MMM yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="Owner" SortExpression="Owner" ReadOnly="True" HeaderText="Request Owner">
<HeaderStyle Wrap="False"></HeaderStyle>
</asp:BoundColumn>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" HeaderText="Edit" CancelText="Cancel"
EditText="Edit"></asp:EditCommandColumn>
<asp:TemplateColumn HeaderText="Close">
<ItemTemplate>
<asp:LinkButton id="lbnClose" CommandName="Close" runat="server">Close</asp:LinkButton>
<asp:LinkButton id="lbnReOpen" CommandName="ReOpen" runat="server" Visible="False">Re-Open</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Abandon">
<ItemTemplate>
<asp:LinkButton id="lbDelete" CommandName="Delete" runat="server">Abandon</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>

Thanks in Advance,
Aswathy