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

Textbox with password mode not showing the value

4 Answers 175 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sandy
Top achievements
Rank 1
Sandy asked on 21 Aug 2012, 10:28 AM
Hi,

I am using asp.net 2.0.

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = "RowClick" Then
            Dim item As GridDataItem = e.Item
            selUserid = item("UserId").Text
            TxtName.Text = item("Name").Text
            TxtUserName.Text = item("UserName").Text
            TxtEmail.Text = item("Email").Text
            TxtPassword.Text = item("Password").Text 
            TxtPhone.Text = item("UserPhone").Text
            cmbCity.Text = item("PosId").Text
        End If
    End Sub


The password textbox is in password mode, but by clicking on grid all the textboxes are filled with values except password textbox.

Can any body help me out.

Thanks in advance

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Aug 2012, 10:52 AM
Hi Sandy,

Try setting the password as shown below.
VB:
TxtPassword.Attributes.Add("value", item("Password").Text)

Thanks,
Shinu.
0
Sandy
Top achievements
Rank 1
answered on 21 Aug 2012, 10:56 AM
Hi Shinu,

This code is not working
0
Sandy
Top achievements
Rank 1
answered on 22 Aug 2012, 05:21 AM
Please help me out.
This is very very Urgent
0
Shinu
Top achievements
Rank 2
answered on 22 Aug 2012, 05:59 AM
Hi Sandy,

Unfortunately I couldn't replicate the issue at my end. Here is the full code that I tried which shows password as expected.
aspx:
<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" AutoGenerateColumns="False" onitemcommand="RadGrid1_ItemCommand">
   <MasterTableView>
     <Columns>
      <telerik:GridBoundColumn  DataField="Password"  HeaderText="Password" UniqueName="Password"/>
       <telerik:GridTemplateColumn>
          <ItemTemplate>
             <asp:TextBox ID="TextBox2" TextMode="Password"  runat="server"></asp:TextBox>
          </ItemTemplate>
       </telerik:GridTemplateColumn>
    </Columns>
   </MasterTableView>
<ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true" >
</telerik:RadGrid>
VB:
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = "RowClick" Then
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim TxtPassword As TextBox = DirectCast(item.FindControl("TextBox2"), TextBox)
        TxtPassword.Attributes.Add("value", item("Password").Text)
    End If
End Sub

Thanks,
Shinu.
Tags
Grid
Asked by
Sandy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sandy
Top achievements
Rank 1
Share this question
or