By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

Multiple ItemTemplates in one TemplateField

P: n/a
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>

Jun 4 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.