How Find The RadTextBox in Insert Mode,When Onclick Event of Button.

7 posts, 0 answers
  1. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 20 May 2013 Link to this post

    In Rad  grid  ,I have Text Box and Button beside of text Box, When user click the  button, In that situation,I want access the text box,values and reset with some "100". all these in side grid Template column.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 May 2013 Link to this post

    Hi,

    Please have a look at the following C#.

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        foreach (GridDataItem DataItem in RadGrid1.Items)
        {
            RadTextBox text1 = (RadTextBox)DataItem.FindControl("RadTextBox1");
            string val = text1.Text;
            text1.Text = "100";
        }
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 20 May 2013 Link to this post

     This is the code :It is in rad grid ...

    <telerik:GridTemplateColumn Visible="true" DataField="chkNumber" HeaderText="Check Number"
                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="chkNumber">
                        <ItemTemplate>
                            <%# Eval("chkNumber")%><%--.ToString().PadLeft(4, '0')%>--%>
                        </ItemTemplate>
                        <InsertItemTemplate>
                            <telerik:RadTextBox ID="rdtxtchkNumber1" runat="server" Width="160px" MaxLength="4"
                                onclick="shouldConfirm = true;" Text='<%# Eval("chkNumber") %>'>
                            </telerik:RadTextBox>
                            <telerik:RadButton ID="RbtnReset1" runat="server" Width="40px" AutoPostBack="true"
                                CausesValidation="false" Text="Reset" OnClick="RbtnResetCheckNoinInsert_Click">
                            </telerik:RadButton>
    <InsertItemTemplate>
    </telerik:GridTemplateColumn >


    unfortunately  The sending snippet is not working ...can you please help see the above code.

  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 May 2013 Link to this post

    Hi,

    Please have a look at the following C# code I tried which works fine at my end.

    C#:
    protected void RbtnResetCheckNoinInsert_Click(object sender, EventArgs e)
    {
        RadButton button1 = (RadButton)sender;
        GridEditFormInsertItem insert = (GridEditFormInsertItem)button1.NamingContainer;
        RadTextBox txt = (RadTextBox)insert.FindControl("rdtxtchkNumber1");
        string value = txt.Text;
        txt.Text = "100";
    }

    Thanks,
    Shinu.
  6. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 21 May 2013 Link to this post

    Thanks ,for your replay but In that ,I am click on button first one  ask "rad Window"  ,confirmation based on yes ,your click on the rad confirm ,an other rad window is opened for  "taking" the values,In  the window we have rad text box,in rad text box  enter values replace with the already Rad Text Box Value.
  7. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 23 May 2013 Link to this post

    Hello Sairam,

    I would suggest you to save the TextBox value in a new variable on client side and when the RadWindow is opened to set this value to the TextBox located in the RadWindow.

    Regards,
    Kostadin
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 24 May 2013 Link to this post

    Thanks Shinu,  Problem is resolved ,based on given information .
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017