Hello all,
I am using the Update Commant Item to perform an in-place edit. The data is successfully saved in the database etc. - but the grid data doesn't refresh automatically once the user clicks "Update" although the database reflects the change. I spent a day trying to figure this out but I am at a loss. Any help would be appreciated. I am pasting my code snippets.
All the columns are generated real-time so one doesn't see any column fields in the ASPX.
Thanks
Bala
I am using the Update Commant Item to perform an in-place edit. The data is successfully saved in the database etc. - but the grid data doesn't refresh automatically once the user clicks "Update" although the database reflects the change. I spent a day trying to figure this out but I am at a loss. Any help would be appreciated. I am pasting my code snippets.
All the columns are generated real-time so one doesn't see any column fields in the ASPX.
Thanks
Bala
<
telerik:RadGrid
OnUpdateCommand
=
"gridCRMList_UpdateCommand"
HeaderStyle-Wrap
=
"false"
ShowStatusBar
=
"false"
OnNeedDataSource
=
"gridCRMList_NeedDataSource"
width
=
"99%"
ID
=
"gridCRMList"
theme
=
"Outlook"
EnableEmbeddedSkins
=
"True"
Skin
=
"Outlook"
AllowFilteringByColumn
=
"False"
AutoPostBackOnFilter
=
"False"
runat
=
"server"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
AllowPaging
=
"True"
PageSize
=
"50"
AllowMultiRowSelection
=
"true"
ShowGroupPanel
=
"False"
ClientSettings-ClientEvents-OnRowDblClick
=
"OpenEdit"
>
<
MasterTableView
EditMode
=
"InPlace"
AlternatingItemStyle-Wrap
=
"false"
ItemStyle-Wrap
=
"false"
TableLayout
=
"Fixed"
width
=
"100%"
AllowMultiColumnSorting
=
"true"
Font-Names
=
"Tahoma"
Font-Size
=
"11px"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
Position
=
"Bottom"
AlwaysVisible
=
"true"
></
PagerStyle
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"True"
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
></
Scrolling
>
<
Selecting
AllowRowSelect
=
"True"
EnableDragToSelectRows
=
"false"
/>
<
Resizing
AllowColumnResize
=
"True"
/>
<
ClientEvents
OnGridCreated
=
"AdjustGridHeight"
></
ClientEvents
>
</
ClientSettings
>
</
telerik:RadGrid
>
protected void gridCRMList_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
String strKeyValue = String.Empty;
GridEditableItem editedItem = e.Item as GridEditableItem;
iChannel.CRM.Controls.GridView grid = new iChannel.CRM.Controls.GridView();
String strXml = grid.CreateInPlaceUpdateXml(ref editedItem, String.Concat(Request.QueryString[iChannelConstants.QS_ENTITY].ToString(), "_ID"), ref strKeyValue, Request.QueryString[iChannelConstants.QS_USER_ID]);
if (strXml.Length > 0)
{
String strRole = STARSService.getRole(Request.QueryString[iChannelConstants.QS_LOGIN], Request.QueryString[iChannelConstants.QS_KEY]);
String strXmlTemplate = String.Concat(Request.QueryString[iChannelConstants.QS_ENTITY].ToString(), strRole, iChannelConstants.MODE_GRID.ToUpper());
String strMessage = STARSService.updateEntity(strKeyValue, strXml, strXmlTemplate, Request.QueryString[iChannelConstants.QS_LOGIN], Request.QueryString[iChannelConstants.QS_KEY]);
if (strMessage.Contains(iChannelConstants.SUCCESS))
{
RadGrid outerGrid = editedItem.OwnerTableView.OwnerGrid;
outerGrid.Rebind();
}
}
}