Hi there,
I am using edit mode of type PopUp for doing update/insert using radgrid. i have used OnUpdateCommand="RadGrid1_UpdateCommand" event and defined it on code behind. but when i click on update button on popup form after modifying text fields, my update command event is not triggering and page shows like it got updated even though not. please anyone provide me solution. Delete works fine and delete event triggers as normal so problem is only with edit update event. here is a part of my code,
And my code behind looks ike this,
protected void RadGrid1_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
int intUserId = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["i_UserId"].ToString());
string strLastName = (editedItem["LastName"].Controls[0] as TextBox).Text;
string strFirstName = (editedItem["FirstName"].Controls[0] as TextBox).Text;
..........
..........
...........
}
When debug this, control doesnt move to the above block when i click on upadte button.
Thanks & Regards,
Ash
I am using edit mode of type PopUp for doing update/insert using radgrid. i have used OnUpdateCommand="RadGrid1_UpdateCommand" event and defined it on code behind. but when i click on update button on popup form after modifying text fields, my update command event is not triggering and page shows like it got updated even though not. please anyone provide me solution. Delete works fine and delete event triggers as normal so problem is only with edit update event. here is a part of my code,
<telerik:RadGrid ID="RadGrid1" AllowSorting="true" AllowPaging="true" PageSize="10" AutoGenerateColumns="false" runat="server" OnUpdateCommand="RadGrid1_UpdateCommand" OnDeleteCommand="RadGrid1_DeleteCommand" AllowAutomaticUpdates="false">
<MasterTableView DataKeyNames="i_UserId" EditMode="PopUp" AllowFilteringByColumn="True" Width="100%" TableLayout="Auto">
<Columns>
<telerik:GridBoundColumn Visible="False" UniqueName="FirstName" HeaderText="First Name" DataField="s_FirstName" EditFormColumnIndex="0"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn Visible="False" UniqueName="FirstName" HeaderText="First Name"<BR> DataField="s_FirstName" EditFormColumnIndex="0"><BR> </telerik:GridBoundColumn>
<Columns/>
<EditFormSettings ColumnNumber="3" CaptionFormatString="Edit details for User: {0}" EditFormType="AutoGenerated" PopUpSettings-Width="70%" PopUpSettings-Modal="true" EditColumn-Resizable="true" PopUpSettings-ScrollBars="Auto" CaptionDataField="s_Name"> <FormTableItemStyleWrap="true"></FormTableItemStyle><BR> <FormCaptionStyle CssClass="EditFormHeader" ForeColor="Blue"></FormCaptionStyle> <FormMainTableStyle GridLines="Both" CellSpacing="0" CellPadding="3" Width="100%" HorizontalAlign="Justify"/> <FormTableStyle GridLines="None" CellSpacing="2" CellPadding="2" CssClass="module" Height="110px"/> <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle><BR> <EditColumn UpdateText="Update record" ButtonType="PushButton" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> </EditColumn><BR> <FormTableButtonRowStyle HorizontalAlign="Center" ForeColor="Blue" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> </EditFormSettings><BR> <ExpandCollapseColumn ButtonType="ImageButton" Visible="False" UniqueName="ExpandColumn"><BR> <HeaderStyle Width="15px"></HeaderStyle><BR> </ExpandCollapseColumn>
</MasterTableView>
</telerik:RadGrid>And my code behind looks ike this,
protected void RadGrid1_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
int intUserId = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["i_UserId"].ToString());
string strLastName = (editedItem["LastName"].Controls[0] as TextBox).Text;
string strFirstName = (editedItem["FirstName"].Controls[0] as TextBox).Text;
..........
..........
...........
}
When debug this, control doesnt move to the above block when i click on upadte button.
Thanks & Regards,
Ash