Iterate through RadGrid

3 posts, 1 answers
  1. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 25 Aug 2008 Link to this post

    I have a RadGrid (q2 2008)
    The first column is template column with a textbox.

    I want to iterate through all the rows and get the value of the textbox and perform an database action. How do I setup the iteration?

  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Aug 2008 Link to this post

    Hi Aron,

    You can try out the following code to loop through the items in the Grid.
    <telerik:GridTemplateColumn UniqueName="Name"
                <asp:TextBox ID="TextBox1" Text='<%#Bind("Name") %>' runat="server"></asp:TextBox> 

     protected void RadGrid1_PreRender(object sender, EventArgs e) 
            foreach (GridDataItem item in RadGrid1.Items) 
                TextBox txtbx = (TextBox)item["Name"].FindControl("TextBox1"); 
                string strtxt = txtbx.Text; 


  3. prat
    prat avatar
    10 posts
    Member since:
    Jul 2011

    Posted 03 Oct 2011 Link to this post

    I have a radgrid with four textboxes in each row(item template), one being costtextbox.
    There is also a textbox outside the radgrid. On the blur event of this textbox i want all the costtextboxes
    in each row to be updated with the same value.

    I have achieved this using code behind, but is it possible to use a jquery or js to do the same. I am stuck and have been struggling to find a solution for this one.
Back to Top