This is a migrated thread and some comments may be shown as answers.

Value not displaying in RadTextBox Password TextMode

1 Answer 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 07 Dec 2013, 09:24 AM
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.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Dec 2013, 06:05 AM
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.
Tags
General Discussions
Asked by
Raj
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or