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

Hide a textbox value in edit mode

1 Answer 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 26 Aug 2010, 03:26 PM
Hi

I have a column containing a hashed password, and when the grid is in edit mode,
with the edit form displayed, I don't want the hashed form to appear, just a blank textbox.

I haven't been able to find the right event/method to clear the current content from the
textbox in the edit form, while allowing the new content that is typed in to be bound when
the update takes place.

The column is already a template column.
I am using Q2 2009 on this particular site.

Can you help? (VB preferred)

Thanks

Clive

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Aug 2010, 05:49 AM
Hello Clive,

In order to clear the column containing hashed password in edit mode, access the control(TextBox) in ItemDataBound event and then clear it.

VB.Net:
Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs)
    If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
        Dim editItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
        Dim txtpwd As TextBox = DirectCast(editItem.FindControl("TextBox1"), TextBox)
        txtpwd.Text = ""
    End If
End Sub

Thanks,
Princy.
Tags
Grid
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or