Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editable column in Datagrid shows original value

Status
Not open for further replies.

aimlion11yahoo

Instructor
Jul 20, 2006
42
US
I have a datagrid with an editable column. Everything works fine, but when the Edit button is clicked and the dropdown appears, the orginal value in that cell is still showing. Another way I could say this is that the dropdown does not replace the origin value of the cell, it appears along side it. Is it possible to replace the original value with the dropdown while in edit mode?

Thanks
 
Can you paste an example of your DataGrid?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
EditCommandColumn is the last column.
Thanks

Code:
<asp:datagrid id="DG_Combo" CellPadding="3" BackColor="White" BorderWidth="1px" BorderStyle="None"
BorderColor="#CCCCCC" Width="99%" Runat="server" AutoGenerateColumns="False" OnUpdateCommand="DG_Combo_Update"
OnEditCommand="DG_Combo_Edit" OnCancelCommand="DG_Combo_Cancel" OnItemDataBound="DG_ItemDataBound"
CssClass="grid">
<FooterStyle Wrap="False"></FooterStyle>
<SelectedItemStyle Wrap="False" CssClass="gridItem"></SelectedItemStyle>
<EditItemStyle Wrap="False" CssClass="gridItem"></EditItemStyle>
<AlternatingItemStyle Wrap="False" CssClass="gridAltItem"></AlternatingItemStyle>
<ItemStyle Wrap="False" CssClass="gridItem"></ItemStyle>
<HeaderStyle Wrap="False" CssClass="gridHeader"></HeaderStyle>
<Columns>
   <asp:TemplateColumn HeaderText="Panel ID">
      <ItemStyle Wrap="False"></ItemStyle>
      <ItemTemplate>
         <asp:Label id=lblConfigPanelGID Text='<%# DataBinder.Eval(Container.DataItem, "PanelID") %>' Width="30px" Runat="server">
         </asp:Label>
      </ItemTemplate>
   </asp:TemplateColumn>
   <asp:TemplateColumn HeaderText="Config Panel ID">
      <ItemStyle Wrap="False"></ItemStyle>
      <ItemTemplate>
         <asp:Label id="Label4" Text='<%# DataBinder.Eval(Container.DataItem, "ConfigPanelGID") %>' Width="30px" Runat="server">
         </asp:Label>
      </ItemTemplate>
   </asp:TemplateColumn>
   <asp:TemplateColumn HeaderText="Section">
      <ItemStyle Wrap="False"></ItemStyle>
      <ItemTemplate>
         <asp:Label id="Label1" Width="22px" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SectionLabel") %>'>
         </asp:Label>
      </ItemTemplate>
   </asp:TemplateColumn>
   <asp:TemplateColumn HeaderText="Surface">
      <ItemStyle Wrap="False"></ItemStyle>
      <ItemTemplate>
         <asp:Label id="Label2" Width="22px" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Panel3DName") %>'>
         </asp:Label>
      </ItemTemplate>
   </asp:TemplateColumn>
   <asp:TemplateColumn HeaderText="Panel Side">
      <ItemStyle Wrap="False"></ItemStyle>
      <ItemTemplate>
         <asp:Label id="Label3" Width="22px" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SplitNumber") %>'>
         </asp:Label>
      </ItemTemplate>
   </asp:TemplateColumn>
   <asp:TemplateColumn HeaderText="Panel Material">
      <ItemStyle Wrap="False"></ItemStyle>
      <ItemTemplate>
         <asp:Label id=lblDisplayInfo Runat="server" ForeColor="Transparent" Text='<%# DataBinder.Eval(Container.DataItem, "DisplayInfo") %>'>
         </asp:Label>
      </ItemTemplate>
      <EditItemTemplate>
         <asp:TextBox id=hdnConfigPanelGID runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ConfigPanelGID") %>' Visible="False" Wrap="False">
         </asp:TextBox>
         <asp:Label id=lblTempDisplayInfo Runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "DisplayInfo") %>'>
         </asp:Label>
         <asp:DropDownList id=cboPanelConfigs runat="server" DataSource="<%# BindPanelConfigs() %>" DataTextField="DisplayPanelTypeName" DataValueField="ConfigPanelGID">
         </asp:DropDownList>
      </EditItemTemplate>
   </asp:TemplateColumn>
   <asp:EditCommandColumn  ButtonType="PushButton" UpdateText="Update" HeaderText="Action" CancelText="Cancel" EditText="Edit">
      <ItemStyle Wrap="False"> </ItemStyle>
   </asp:EditCommandColumn>
</Columns>
<PagerStyle HorizontalAlign="Left" ForeColor="#000066" BackColor="White" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
 
Under <EditItemTemplate> set Visible=false for the label displaying the original data.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top