GridView Control - EditItemTemplate Controls
-
Hi, I have a grid, which has an ItemTemplate and an EditItemTemplate, my concern is how do I get the controls in the EditItemTemplate, my grid columns looked like this...
<asp:TemplateField HeaderText="Price Type" HeaderStyle-CssClass="first" SortExpression="PriceType"> <ItemTemplate> <asp:Label ID="lbl_pricingtype" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceTypeDesc[0].Description")%>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceType")%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddl_pricingtype" runat="server" CssClass="first" Width="90px" onchange="ddl_pricingtype_change(this.value)"> <asp:ListItem Text="Please Select" Value="-1"></asp:ListItem> <asp:ListItem Text="0 - Price1" Value="0"></asp:ListItem> <asp:ListItem Text="1 - Price2" Value="1"></asp:ListItem> <asp:ListItem Text="2 - Price3" Value="2"></asp:ListItem> </asp:DropDownList> </EditItemTemplate> <HeaderStyle CssClass="first" /> <ItemStyle CssClass="first" /> </asp:TemplateField>
Now I can get the value from the ItemTemplate label using OnRowEditing event but I can't seem to find the Dropdownlist control to set the selecteditem. -
Hi, I have a grid, which has an ItemTemplate and an EditItemTemplate, my concern is how do I get the controls in the EditItemTemplate, my grid columns looked like this...
<asp:TemplateField HeaderText="Price Type" HeaderStyle-CssClass="first" SortExpression="PriceType"> <ItemTemplate> <asp:Label ID="lbl_pricingtype" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceTypeDesc[0].Description")%>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceType")%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddl_pricingtype" runat="server" CssClass="first" Width="90px" onchange="ddl_pricingtype_change(this.value)"> <asp:ListItem Text="Please Select" Value="-1"></asp:ListItem> <asp:ListItem Text="0 - Price1" Value="0"></asp:ListItem> <asp:ListItem Text="1 - Price2" Value="1"></asp:ListItem> <asp:ListItem Text="2 - Price3" Value="2"></asp:ListItem> </asp:DropDownList> </EditItemTemplate> <HeaderStyle CssClass="first" /> <ItemStyle CssClass="first" /> </asp:TemplateField>
Now I can get the value from the ItemTemplate label using OnRowEditing event but I can't seem to find the Dropdownlist control to set the selecteditem.refer and download from the following link : GridView all in one[^]
Padmanabhan
-
refer and download from the following link : GridView all in one[^]
Padmanabhan
what link?
-
what link?
there is a sample program in which using EditItemTemplates are given..
Padmanabhan
-
there is a sample program in which using EditItemTemplates are given..
Padmanabhan
thanks dude. twas a great article.
-
thanks dude. twas a great article.
its my own article.. if u like that then vote for that article...
Padmanabhan