TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sunil sharma
NA
2
0
Find Grid View Header Template Using A Button Click
Jun 5 2012 8:19 AM
<asp:GridView ID="gridviewStock" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:DropDownList ID="ddlstCol1" runat="server">
<asp:ListItem>SRNO</asp:ListItem>
<asp:ListItem>Part</asp:ListItem>
<asp:ListItem>Part Deccription</asp:ListItem>
<asp:ListItem>UoM</asp:ListItem>
<asp:ListItem>Sales Price/UMRP</asp:ListItem>
<asp:ListItem>Purchase Price</asp:ListItem>
<asp:ListItem>Group</asp:ListItem>
<asp:ListItem>Rate Of Vat</asp:ListItem>
<asp:ListItem>Qty</asp:ListItem>
</asp:DropDownList>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblCol1" runat="server" Text='<% #Eval("Col0") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
i am bind Grid View and Find Control in a button Click
protected void btnConfigure_Click(object sender, EventArgs e)
{
foreach (GridViewRow rowItem in gridviewStock.Rows)
{
DropDownList ddl = (DropDownList)(rowItem.Cells[0].FindControl("ddlstCol1"));
DropDownList ddl1 = (DropDownList)(rowItem.Cells[1].FindControl("ddlstCol1"));
DropDownList ddl2 = (DropDownList)(rowItem.Cells[2].FindControl("ddlstCol1"));
}
}
but this code not work
Reply
Answers (
3
)
Data table
How to get more duplicated record from mysql