locked
How to find Itemtemplate label of an datalist inside gridview RRS feed

  • Question

  • User539417172 posted

    How to find Itemtemplate lable of an datalist inside gridview

    Tuesday, February 19, 2013 6:41 AM

All replies

  • User-513218303 posted

    Hi Pratibha,

    Refer below code as an example, or still are facing any dificulty then post your markup as well as code for better solution.

    foreach (GridViewRow GR in gv.Rows) 
                {
                    DataList DL = (DataList)GR.FindControl("dl"); //Data list name to find
    
                    if (DL != null)
                    {
                        Label lbl = (Label)DL.FindControl("lbl"); // Label name to find inside the datalist
    
                        lbl.Text = "Label Found";
                    }
    
                }

    Feel free to ask if you have any query..

    Tuesday, February 19, 2013 7:34 AM