Multiple ItemTemplates in one TemplateField

J

JPabich

I am devloping a page that is using a GridView. Within one column of
the gridview I would like to place three different types of fields. I
need one label, one checkbox and one drop down list. Is this
possible, or do they need to be in separate columns for it to work?
Here is what I have so far and I can't get both fields to show up.
Only one.

<asp:TemplateField HeaderText="Reason of Rejection
(if rejected)" SortExpression="RejectReason" ItemStyle-
VerticalAlign="Bottom">

<EditItemTemplate>
<asp:CheckBox ID="CheckBox2"
runat="server" Checked='<%# Bind("GradeA") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox2"
runat="server" Checked='<%# Bind("GradeA") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox6" runat="server"
Text='<%# Bind("RejectReason") %>' ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
&nbsp;<asp:DropDownList ID="DropDownList5"
runat="server" SelectedValue='<%# Bind("RejectReason") %>' Enabled =
"false">
<asp:ListItem Value="">Select a
reason ....</asp:ListItem>
<asp:ListItem>Already exists</
asp:ListItem>
<asp:ListItem>Unclear\Confusing</
asp:ListItem>
<asp:ListItem>Error Found</
asp:ListItem>
<asp:ListItem>Inappropriate</
asp:ListItem>
<asp:ListItem>Not Creative Enough</
asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top