As I understand from reading various posts, when the Grid is in Batch mode, and you add a new row (via "Add new record" button or with the javascript addNewRecord function via batch manager) it only creates a new tr element, but doesn't populate it with the components that make up the columns you've defined. Instead, it appears you have to manually create those elements in code. This doesn't make sense to me, but seems it should be part of the built-in functionality when the tr element is added. The current result is the new row is basically worthless.
Still, if that's how you insist it must be done, please help me with my grid below. After a new row is added (via the javascript below which is called from a button separate from the grid) it appears I need to use OnRowCreated to populate all the columns with the necessary elements. Is that correct? If so, can you take my grid below and give me the javascript for how this is done? I can't find any concrete examples on the forum or in your help docs.
var
grd = GetControlRAD(
"grdPODetails"
);
var
masterTable = grd.get_masterTableView();
var
batchManager = grd.get_batchEditingManager();
batchManager.addNewRecord(masterTable);
<
telerik:RadGrid
ID
=
"grdPODetails"
runat
=
"server"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
Skin
=
"Office2010Blue"
GridLines
=
"None"
>
<
HeaderContextMenu
EnableAutoScroll
=
"True"
>
</
HeaderContextMenu
>
<
MasterTableView
CommandItemDisplay
=
"Top"
EditMode
=
"Batch"
InsertItemDisplay
=
"Bottom"
ClientDataKeyNames
=
"PurchaseOrderDetailKey"
DataKeyNames
=
"PurchaseOrderDetailKey"
>
<
BatchEditingSettings
EditType
=
"Cell"
OpenEditingEvent
=
"Click"
/>
<
CommandItemSettings
ShowRefreshButton
=
"False"
ShowSaveChangesButton
=
"true"
ShowCancelChangesButton
=
"true"
/>
<
NoRecordsTemplate
>
No detail lines to display.
</
NoRecordsTemplate
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"PrintOnPurchaseOrder"
HeaderText
=
"Print"
UniqueName
=
"PrintOnPurchaseOrder"
DataType
=
"System.Boolean"
>
<
HeaderStyle
Width
=
"40px"
/>
<
ItemStyle
Width
=
"40px"
/>
<
ItemTemplate
>
<
input
id
=
"chkPrintRead"
type
=
"checkbox"
checked='<%# Eval("PrintOnPurchaseOrder") %>' onclick="changeCheckbox(this);" />
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:CheckBox
ID
=
"chkPrint"
runat
=
"server"
Checked='<%# Bind("PrintOnPurchaseOrder") %>' />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"ChartOfAccountNumber"
UniqueName
=
"ChartOfAccountNumber"
HeaderText
=
"Account Number"
DataType
=
"System.String"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblChartOfAccountNumber"
runat
=
"server"
Text='<%# Eval("ChartOfAccountNumber") %>'>
</
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
span
style
=
"width:100%; display:inline-block; white-space:nowrap"
>
<
telerik:RadTextBox
ID
=
"txtChartOfAccountNumber"
runat
=
"server"
MaxLength
=
"36"
Width
=
"90%"
Text='<%# Bind("ChartOfAccountNumber") %>'>
<
ClientEvents
OnValueChanged
=
"Grid_COANumChanged"
/>
</
telerik:RadTextBox
>
<
asp:ImageButton
ID
=
"imgChartOfAccountNumber"
OnClientClick
=
"Grid_COANumSearch(this); return false;"
runat
=
"server"
ImageUrl
=
"images/icons/search-16.png"
TabIndex
=
"-1"
ToolTip
=
"Search"
style
=
"vertical-align:middle"
/>
</
span
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"PurchaseOrderDetailQuantity"
HeaderText
=
"Quantity"
UniqueName
=
"PurchaseOrderDetailQuantity"
DataType
=
"System.Double"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblPurchaseOrderDetailQuantity"
runat
=
"server"
Text='<%# Eval("PurchaseOrderDetailQuantity") %>'>
</
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"txtPurchaseOrderDetailQuantity"
runat
=
"server"
DataType
=
"System.Decimal"
MaxLength
=
"23"
Width
=
"100%"
IncrementSettings-InterceptArrowKeys
=
"false"
Culture
=
"English (United States)"
DbValue='<%# Bind("PurchaseOrderDetailQuantity") %>' Type="Number" NumberFormat-DecimalDigits="4" />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"UnitPrice"
HeaderText
=
"UnitPrice"
UniqueName
=
"UnitPrice"
DataType
=
"System.Double"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblUnitPrice"
runat
=
"server"
Text='<%# Eval("UnitPrice") %>'>
</
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"txtUnitPrice"
runat
=
"server"
DataType
=
"System.Decimal"
MaxLength
=
"23"
Width
=
"100%"
IncrementSettings-InterceptArrowKeys
=
"false"
Culture
=
"English (United States)"
DbValue='<%# Bind("UnitPrice") %>' Type="Number" NumberFormat-DecimalDigits="4" />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"UnitDescription"
UniqueName
=
"UnitDescription"
HeaderText
=
"Unit Desc"
DataType
=
"System.String"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblUnitDescription"
runat
=
"server"
Text='<%# Eval("UnitDescription") %>'>
</
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadTextBox
ID
=
"txtUnitDescription"
runat
=
"server"
MaxLength
=
"10"
Width
=
"100%"
Text='<%# Bind("UnitDescription") %>' >
</
telerik:RadTextBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"PurchaseOrderDetailAmount"
HeaderText
=
"Amount"
UniqueName
=
"PurchaseOrderDetailAmount"
DataType
=
"System.Double"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblPurchaseOrderDetailAmount"
runat
=
"server"
Text='<%# Eval("PurchaseOrderDetailAmount") %>'>
</
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"txtPurchaseOrderDetailAmount"
runat
=
"server"
DataType
=
"System.Decimal"
MaxLength
=
"21"
Width
=
"100%"
IncrementSettings-InterceptArrowKeys
=
"false"
Culture
=
"English (United States)"
DbValue='<%# Bind("PurchaseOrderDetailAmount") %>' Type="Number" NumberFormat-DecimalDigits="2" />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridNumericColumn
DataField
=
"PurchaseOrderDetailKey"
HeaderText
=
"PurchaseOrderDetailKey"
UniqueName
=
"PurchaseOrderDetailKey"
DataType
=
"System.Int32"
Visible
=
"False"
ReadOnly
=
"True"
>
</
telerik:GridNumericColumn
>
<
telerik:GridClientDeleteColumn
ConfirmText
=
"Are you sure you want to delete the selected item?"
ButtonType
=
"LinkButton"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
>
<
HeaderStyle
Width
=
"50px"
HorizontalAlign
=
"Right"
/>
<
ItemStyle
Width
=
"50px"
HorizontalAlign
=
"Right"
/>
</
telerik:GridClientDeleteColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
ClientEvents
OnRowSelected
=
"RowSelected"
OnBatchEditCellValueChanged
=
"BatchEditCellValueChanged"
/>
</
ClientSettings
>
</
telerik:RadGrid
>