5 Answers, 1 is accepted
0
Hello Venkatesh,
Could you please elaborate a bit more on your scenario? How do you want to restrict negative numbers and decimals into the column. Do you want to hide them or mark them with different styles? If this is the case you can handle the ItemDataBound event and change the (e.item as GridDataItem)[ColumnUniqueName].Text property or (e.item as GridDataItem)[ColumnUniqueName]’s style if the value into the (e.Item as GridDataItem).DataItem for a column is negative or decimal.
Looking forward for your reply.
Regards,
Radoslav
Telerik
Could you please elaborate a bit more on your scenario? How do you want to restrict negative numbers and decimals into the column. Do you want to hide them or mark them with different styles? If this is the case you can handle the ItemDataBound event and change the (e.item as GridDataItem)[ColumnUniqueName].Text property or (e.item as GridDataItem)[ColumnUniqueName]’s style if the value into the (e.Item as GridDataItem).DataItem for a column is negative or decimal.
Looking forward for your reply.
Regards,
Radoslav
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Venkatesh
Top achievements
Rank 1
answered on 03 Sep 2014, 05:46 AM
Hi,
My radgrid is having multiple columns with batch edit(cell) option. In that some of columns should accept negative numbers and some of them should not accept negative numbers.So,While editing the cell for some columns i need to restrict negative values. Is it possible by columns unique name or something else?
Regards,
Venkatesh.
My radgrid is having multiple columns with batch edit(cell) option. In that some of columns should accept negative numbers and some of them should not accept negative numbers.So,While editing the cell for some columns i need to restrict negative values. Is it possible by columns unique name or something else?
Regards,
Venkatesh.
0
Accepted
Hello Venkatesh,
To achieve the desired functionality you can try adding a custom column editor to the column which needs to be non-negative and with decimal digits. For example:
Please give it try and let me know if it helps you.
Looking forward for your reply.
Regards,
Radoslav
Telerik
To achieve the desired functionality you can try adding a custom column editor to the column which needs to be non-negative and with decimal digits. For example:
<
telerik:RadGrid
runat
=
"server"
ID
=
"RadGrid1"
AutoGenerateColumns
=
"false"
AllowSorting
=
"True"
AllowPaging
=
"True"
ShowFooter
=
"true"
>
<
MasterTableView
ShowGroupFooter
=
"true"
EditMode
=
"Batch"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Item"
HeaderText
=
"Item"
Aggregate
=
"Count"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Date"
HeaderText
=
"Date"
></
telerik:GridBoundColumn
>
<
telerik:GridNumericColumn
DataField
=
"Num"
ColumnEditorID
=
"GridNumericColumnEditor1"
HeaderText
=
"NonNegative"
></
telerik:GridNumericColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:GridNumericColumnEditor
ID
=
"GridNumericColumnEditor1"
runat
=
"server"
>
<
NumericTextBox
MinValue
=
"0"
NumberFormat-DecimalDigits
=
"0"
></
NumericTextBox
>
</
telerik:GridNumericColumnEditor
>
Please give it try and let me know if it helps you.
Looking forward for your reply.
Regards,
Radoslav
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Venkatesh
Top achievements
Rank 1
answered on 23 Sep 2014, 07:34 AM
Hi Radoslav,
Thanks for your answer. Its working for me.
Regards,
Venkatesh.
Thanks for your answer. Its working for me.
Regards,
Venkatesh.
0
Sonya
Top achievements
Rank 1
answered on 05 Oct 2014, 03:45 PM