Hi i am using BatchEdit mode of Telerik Control binding to Objectdatasource as following markup , i want to change text of boundcolumn INVOICEUNIT from telerik ComboBox1 attribute "Attributes['Unit']" ,on selectionindexchanged event of ComboBox1 , and calculate values for another boundcolumn INVOICEAMOUNT on the basis of Attributes['Unit'] * boundcolumn INVOICENUMBER ,how can i do this with javascript so that calculated values are persisted in post back also ? I have tried with event ClientEvents-OnBatchEditSetCellValue ,but when values are changed in that boundcolumn ,it can be edited anymore ,if i click that cell (after values are changed in OnBatchEditSetCellValue)
function
SetCellValue(sender, args) {
if
(args.get_columnUniqueName() ===
"ArticleNo"
) {
var
value = args.get_value();
args.get_row().cells[4].innerText =
"Something"
;
}
}
<
telerik:RadGrid
RenderMode
=
"Lightweight"
ID
=
"RadGrid1"
GridLines
=
"None"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticUpdates
=
"True"
AllowAutomaticInserts
=
"True"
OnItemDataBound
=
"OnItemDataBoundHandler"
PageSize
=
"10"
OnItemDeleted
=
"RadGrid1_ItemDeleted"
OnItemInserted
=
"RadGrid1_ItemInserted"
OnItemUpdated
=
"RadGrid1_ItemUpdated"
OnPreRender
=
"RadGrid1_PreRender"
AllowPaging
=
"True"
DataSourceID
=
"ObjectDataSource1"
AutoGenerateColumns
=
"False"
OnBatchEditCommand
=
"RadGrid1_BatchEditCommand"
>
<
MasterTableView
CommandItemDisplay
=
"Top"
DataKeyNames
=
"VINVOICEROWSID"
DataSourceID
=
"ObjectDataSource1"
HorizontalAlign
=
"NotSet"
EditMode
=
"Batch"
AutoGenerateColumns
=
"False"
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"VINVOICEROWSID"
SortOrder
=
"Descending"
/>
</
SortExpressions
>
<
Columns
>
<
telerik:GridCheckBoxColumn
DataField
=
"SelectCheckBox"
HeaderStyle-Width
=
"80px"
HeaderText
=
"Select"
SortExpression
=
"SelectCheckBox"
UniqueName
=
"SelectCheckBox"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"InvoiceRowDate"
HeaderStyle-Width
=
"180px"
UniqueName
=
"INVOICEROWDATE"
DataField
=
"INVOICEROWDATE"
>
<
ItemTemplate
>
<%-- <%# IIf(String.IsNullOrEmpty(Eval("INVOICEROWDATE")), "", Convert.ToDateTime(Eval("INVOICEROWDATE")).ToString("dd-MM-yyyy"))%>--%>
<%# Eval("INVOICEROWDATE")%>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDatePicker
ID
=
"rdInvoiceRowDate"
runat
=
"server"
>
</
telerik:RadDatePicker
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"ArticleNo"
DefaultInsertValue
=
""
HeaderStyle-Width
=
"250px"
UniqueName
=
"ArticleNo"
DataField
=
"ArticleNo"
>
<
ItemTemplate
>
<%# Eval("ArticleNo")%>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadComboBox1"
EnableLoadOnDemand
=
"True"
DataTextField
=
"ArticleDesc"
AutoPostBack
=
"false"
OnItemsRequested
=
"RadComboBox1_ItemsRequested"
DataValueField
=
"ArticleNo"
HighlightTemplatedItems
=
"true"
Height
=
"220px"
Width
=
"220px"
DropDownWidth
=
"420px"
>
<
HeaderTemplate
>
<
table
>
<
tr
>
<
td
>ArticleNo
</
td
>
<
td
>Article Description
</
td
>
<
td
>
Unit
</
td
>
</
tr
>
</
table
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
table
>
<
tr
>
<
td
>
<%# DataBinder.Eval(Container, "Text")%>
</
td
>
<
td
>
<%# DataBinder.Eval(Container, "Value")%>
</
td
>
<
td
>
<%# DataBinder.Eval(Container, "Attributes['Unit']")%>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"INVOICEROWDESCRIPTION"
HeaderStyle-Width
=
"250px"
ItemStyle-Width
=
"250px"
HeaderText
=
"InvoiceRowDesc"
SortExpression
=
"INVOICEROWDESCRIPTION"
UniqueName
=
"INVOICEROWDESCRIPTION"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"INVOICEUNIT"
HeaderStyle-Width
=
"100px"
ItemStyle-Width
=
"100px"
ItemStyle-BorderWidth
=
"3"
HeaderText
=
"Unit"
SortExpression
=
"INVOICEUNIT"
UniqueName
=
"Unit"
>
</
telerik:GridBoundColumn
>
<
telerik:GridNumericColumn
DataField
=
"INVOICENUMBER"
HeaderStyle-Width
=
"100px"
ItemStyle-Width
=
"100px"
HeaderText
=
"InvoiceNumber"
SortExpression
=
"INVOICENUMBER"
UniqueName
=
"INVOICENUMBER"
>
</
telerik:GridNumericColumn
>
<
telerik:GridBoundColumn
DataField
=
"INVOICEAMOUNT"
HeaderStyle-Width
=
"100px"
ItemStyle-Width
=
"100px"
HeaderText
=
"InvoiceAmount"
SortExpression
=
"INVOICEAMOUNT"
UniqueName
=
"INVOICEAMOUNT"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"InvoiceVat"
DefaultInsertValue
=
""
HeaderStyle-Width
=
"250px"
UniqueName
=
"INVOICEVAT"
DataField
=
"INVOICEVAT"
>
<
ItemTemplate
>
<%# Eval("INVOICEVAT")%>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDropDownList
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"VatDropDown"
DataValueField
=
"Value"
DataSourceID
=
"SqlDataSource2"
DataTextField
=
"VAT"
>
</
telerik:RadDropDownList
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"INVOICEUNIT"
HeaderStyle-Width
=
"180px"
UniqueName
=
"INVOICEUNIT"
DataField
=
"INVOICEUNIT"
>
<
ItemTemplate
>
<%# Eval("INVOICEUNIT")%>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:TextBox
runat
=
"server"
ID
=
"TextBox1"
/>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this product?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
HeaderText
=
"Delete"
HeaderStyle-Width
=
"50px"
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
ClientEvents-OnBatchEditSetCellValue
=
"SetCellValue"
></
ClientSettings
>
</
telerik:RadGrid
>