Greetings,
A while ago I quickly threw together a quick tool to manage our admin users and provide our support staff with the ability to reset users passwords. It uses a RadGrid, bound to a collection of objects, and there is a GridTemplateColumn that holds an EditItemTemplate that has a textbox to collect the new password. It used to work, and when we found the textbox in the ItemUpdated event handler, the textbox.text would be new password, and life would be good. No longer though, now the text is always empty. We recently updated our telerik controls to 2011.1.413.40, although this could have stopped working before then (it's a rarely used function apparently). Below is the RadGrid definition and ItemUpdated Event handler. If anyone has any ideas, that would rock.
Thank you in advance if you have any ideas on this,
Francis
A while ago I quickly threw together a quick tool to manage our admin users and provide our support staff with the ability to reset users passwords. It uses a RadGrid, bound to a collection of objects, and there is a GridTemplateColumn that holds an EditItemTemplate that has a textbox to collect the new password. It used to work, and when we found the textbox in the ItemUpdated event handler, the textbox.text would be new password, and life would be good. No longer though, now the text is always empty. We recently updated our telerik controls to 2011.1.413.40, although this could have stopped working before then (it's a rarely used function apparently). Below is the RadGrid definition and ItemUpdated Event handler. If anyone has any ideas, that would rock.
<
telerik:RadGrid
ID
=
"rgUsers"
BorderColor
=
"#cccccc"
runat
=
"server"
AutoGenerateColumns
=
"false"
OnItemCommand
=
"ItemCommand"
OnUpdateCommand
=
"ItemUpdated"
AllowAutomaticUpdates
=
"false"
>
<
MasterTableView
DataKeyNames
=
"adminuser_id"
Width
=
"100%"
EnableViewState
=
"false"
EditMode
=
"PopUp"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"email"
HeaderText
=
"Email Address"
HeaderStyle-Width
=
"25%"
ItemStyle-VerticalAlign
=
"Top"
ReadOnly
=
"true"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"Password"
Visible
=
"false"
UniqueName
=
"colPassword"
>
<
EditItemTemplate
>
<
asp:TextBox
ID
=
"tbPassword"
runat
=
"server"
MaxLength
=
"30"
/>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"LinkButton"
ItemStyle-CssClass
=
"gridaction"
EditText
=
"Reset Password"
HeaderStyle-Width
=
"15%"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"False"
EnableDragToSelectRows
=
"false"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
protected
void
ItemUpdated(
object
sender, GridCommandEventArgs args )
{
AdminUser user = args.Item.DataItem
as
AdminUser;
TextBox tbPassword = args.Item.FindControl(
"tbPassword"
)
as
TextBox;
SqlExecutor.Execute(
delegate
( SqlConnection connection )
{
user.password = tbPassword.Text;
user.Persist( connection );
}, logger );
}
Thank you in advance if you have any ideas on this,
Francis