Value not displaying in RadTextBox Password TextMode

2 posts, 0 answers
  1. Raj
    Raj avatar
    33 posts
    Member since:
    Jan 2012

    Posted 07 Dec 2013 Link to this post

    HI,

    Am in need of displaying password in the RadGrid using RadTextBox in Password TextMode. 

    On Page Load, i have to fetch the record and display it in Grid. But, i cant able to display the password when it is in Password TextMode.
    In fact, it is displayed in normal mode. Why it is not displaying when it is in Password Mode? Please reply me as soon as possible.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Dec 2013 Link to this post

    Hi Raj,

    Please have a look into the following code snippet to set  a value to the RadTextBox in Password TextMode.

    ASPX:
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn DataField="OrderID" UniqueName="OrderID" HeaderText="OrderID">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <telerik:RadTextBox ID="RadTextBox1" runat="server" TextMode="Password">
                        </telerik:RadTextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnColumnCreated="Load" />
        </ClientSettings>
    </telerik:RadGrid>
    <asp:HiddenField ID="HiddenField1" runat="server" />

    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        //fetch the textbox value
        string demotext = "newvalue";
        //store the value in hiddenfield
        HiddenField1.Value = demotext;
    }

    JavaScript:
    <script type="text/javascript">
        function Load(sender, args) {
            //access the hiddenfield value
            var value = document.getElementById("HiddenField1").value;
            //set the value in password textbox
            sender.get_masterTableView().get_dataItems()[0].findControl("RadTextBox1").set_value(value);
        }
    </script>

    Hope this will helps you.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top