I would do as srihari has done, but wouldn't bother adding the
asp:ListItem objects.  instead, I would handle the OnRowDataBound (or
something like that) event for the GridView and bind the DropDownList
in there.

However, you should only use a ComboBox in the edit or new rows in a
GridView if you want to follow the standard procedures for using a
GridView.  You can have a DDL in the display rows, and bind the
changed event to do something, but if you can get away with not doing
this, then that would be best.

On 24 Sep, 05:39, "srihari k" <[EMAIL PROTECTED]> wrote:
> iIn .aspx page , the below code give a Dropdowncombo for a coloum
>
>  <asp:TemplateField HeaderText="Status" SortExpression="ItemStatus">
>                             <EditItemTemplate>
>                                 <asp:DropDownList
> DataTextField="ItemStatusID" DataValueField="ItemStatusID"
> ID="ddlItemStatusID" Runat="server" CssClass = "NormalText" Width ="70">
>                                 <asp:ListItem Value =
> "1">Active</asp:ListItem>
>                                 <asp:ListItem Value =
> "99">Inactive</asp:ListItem>
>                                 </asp:DropDownList>
>                                 <asp:RequiredFieldValidator
> ID="rfvItemStatusID" runat="server" Display="Dynamic"
> ErrorMessage="RequiredFieldValidator" ControlToValidate = 
> "ddlItemStatusID">*</asp:RequiredFieldValidator>
>
>                             </EditItemTemplate>
>                             <ItemTemplate>
>                                 <asp:Label ID="lblItemStatusID"
> runat="server" Text='<%# Bind("ItemStatus") %>'></asp:Label>
>                             </ItemTemplate>
>                             <ItemStyle Width="65px" />
>                         </asp:TemplateField>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---

Reply via email to