<
telerik:GridTemplateColumn
HeaderText
=
"Quantity"
UniqueName
=
"Quantity"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblQuantity"
runat
=
"server"
Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>'>
</
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"txtQuantity"
runat
=
"server"
DataType
=
"System.Decimal"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"4"
/>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
I've made a RadGrid with EditMode="Batch" that is bound to a dataset. I need to create some GridTemplateColumns, such as the above. 3 questions...
1) In checking out examples online, at times I've seen Eval above as it is...
Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>'>
...but other times like this...
Text='<%# Eval("Quantity") %>'>
The latter is cleaner, but wondering if the first is recommended for some reason. Or are they identical?
2) Also, at times I've seen in the GridTemplateColumn header the attribute DataField and DataType, such as...
DataField="Quantity"
DataType="System.Double"
... but again, not always. Are they necessary? Or does it depend on the situation?
3) Do I need to somehow Bind the field to the EditItemTemplate portion?
Thanks for the help!