Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
I have ttried the below code but i m getting error
            <asp:TemplateField HeaderText="PipNo.">
                <itemtemplate>
                    <asp:DropDownList ID="pipddl" value='<%#Bind("PIP_NO") %>' DataValueField='<%#Bind("PIP_NO") %>' runat="server">
                </itemtemplate>

post solution for this
thanks in advance
Posted
Updated 6-Dec-11 0:38am
v3
Comments
[no name] 6-Dec-11 6:38am    
EDIT: added "pre" tag

C#
protected void gvResults_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow) //skip header row
    {
        DropDownList ddOpp = (DropDownList)e.Row.Cells[5].FindControl("pipddl");
        ddOpp.Datasource = dt 
ddOpp.DataValueField ="SomeField"
ddOpp.DataTextField ="SomeField"
ddOpp.dataBind();
    }
}
 
Share this answer
 
v2
Comments
Vijay Radia 6-Dec-11 6:42am    
I think better to find control in row only as dropdown can be moved to another cell in future !!...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900