Hello.
I use a RadGrid(BatchMode) and attach grid script.
<telerik:RadGrid ID="grid1" runat="server" Width="100%" Height="165px" AutoGenerateColumns="False" Culture="ko-KR"GroupPanelPosition="Top" OnNeedDataSource="grid1_NeedDataSource" AllowMultiRowSelection="True"> <ClientSettings> <Selecting AllowRowSelect="True"/> <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true"/> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings> <MasterTableView > <Columns> <telerik:GridClientSelectColumn DataType="System.Boolean"FilterControlAltText="Filter check column" HeaderText="Selection" UniqueName="check"> <HeaderStyle HorizontalAlign="Center" Width="35px" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridClientSelectColumn> <telerik:GridBoundColumn DataField="itemcd" FilterControlAltText="Filter itemcd column" HeaderText="code" UniqueName="itemcd" > <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> <HeaderStyle HorizontalAlign="Center" Width="70px" /> </telerik:GridBoundColumn> </Columns> <ItemStyle Wrap="False"></ItemStyle> <HeaderStyle Wrap="True" /> </MasterTableView> </telerik:RadGrid>
and grid batchUpdatecommand Event
protected void gridDetail_BatchEditCommand(object sender, GridBatchEditingEventArgs e) { // this processing is fire database procedure and get return value string returnmessage = (new WEAU020()).UpdateDetail; if (returnmessage.Length > 0) { RadAjaxManager1.Alert(returnmessage); return; } gridDetail.Rebind(); }
in these situation,
try to BatchEditUpdate, but data is not validation.(Db Check and return meesage)
and i display message to using AjaxManager1.Alert().
It is normally. but happen problem.
explain why problems...
No updated data is loss in grid because not valid(Database procedure check).
but grid has been loss not updated data because occur rebind
I searched document and refernece : http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/simple-vs-advanced/defaultcs.aspx
I checked a these point.
Right after Update/Delete/Insert command event handlers finish execution. You can cancel these operations handling the ItemCommand event and assigning false value to the Canceledproperty of the e event argument
in case batcheditMode , i know way that InsertCommand Event add script : e.Canceled = false;
but case batchEditUpdate event is not work e.Canceled = false;
Conclusion : How can i display a message In BatchEditCommand Event and not rebind?
(don't get a value in client-side why data is keep changing by other user)
I use a RadGrid(BatchMode) and attach grid script.
<telerik:RadGrid ID="grid1" runat="server" Width="100%" Height="165px" AutoGenerateColumns="False" Culture="ko-KR"GroupPanelPosition="Top" OnNeedDataSource="grid1_NeedDataSource" AllowMultiRowSelection="True"> <ClientSettings> <Selecting AllowRowSelect="True"/> <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true"/> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings> <MasterTableView > <Columns> <telerik:GridClientSelectColumn DataType="System.Boolean"FilterControlAltText="Filter check column" HeaderText="Selection" UniqueName="check"> <HeaderStyle HorizontalAlign="Center" Width="35px" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridClientSelectColumn> <telerik:GridBoundColumn DataField="itemcd" FilterControlAltText="Filter itemcd column" HeaderText="code" UniqueName="itemcd" > <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> <HeaderStyle HorizontalAlign="Center" Width="70px" /> </telerik:GridBoundColumn> </Columns> <ItemStyle Wrap="False"></ItemStyle> <HeaderStyle Wrap="True" /> </MasterTableView> </telerik:RadGrid>
and grid batchUpdatecommand Event
protected void gridDetail_BatchEditCommand(object sender, GridBatchEditingEventArgs e) { // this processing is fire database procedure and get return value string returnmessage = (new WEAU020()).UpdateDetail; if (returnmessage.Length > 0) { RadAjaxManager1.Alert(returnmessage); return; } gridDetail.Rebind(); }
in these situation,
try to BatchEditUpdate, but data is not validation.(Db Check and return meesage)
and i display message to using AjaxManager1.Alert().
It is normally. but happen problem.
explain why problems...
No updated data is loss in grid because not valid(Database procedure check).
but grid has been loss not updated data because occur rebind
I searched document and refernece : http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/simple-vs-advanced/defaultcs.aspx
I checked a these point.
Right after Update/Delete/Insert command event handlers finish execution. You can cancel these operations handling the ItemCommand event and assigning false value to the Canceledproperty of the e event argument
in case batcheditMode , i know way that InsertCommand Event add script : e.Canceled = false;
but case batchEditUpdate event is not work e.Canceled = false;
Conclusion : How can i display a message In BatchEditCommand Event and not rebind?
(don't get a value in client-side why data is keep changing by other user)