I'm customizing the automatic grid editors as follows:
I'm really just trying to adjust the width (it would be nice if the edit controls automatically set their width to the column width), but I added some background colors just to be sure I'm not crazy.
The GridTextBoxColumnEditor always works, but the GridNumericColumnEditor only works if there is only one row in edit mode. Once I put a second row into edit mode the text boxes get huge again and the background color goes away.
Is there an easy fix for this?
| <telerik:RadGrid ID="InvoiceLines" runat="server" AllowMultiRowSelection="true" AllowMultiRowEdit="true" |
| Skin="Office2007" OnNeedDataSource="InvoiceLines_NeedDataSource" AutoGenerateColumns="false" |
| OnUpdateCommand="InvoiceLines_UpdateCommand" OnDeleteCommand="InvoiceLines_DeleteCommand" OnInsertCommand="InvoiceLines_InsertCommand"> |
| <ClientSettings> |
| <Selecting AllowRowSelect="true" /> |
| </ClientSettings> |
| <MasterTableView DataKeyNames="Id" ClientDataKeyNames="Id" EditMode="InPlace" AutoGenerateColumns="false" CommandItemDisplay="Bottom" InsertItemDisplay="Bottom"> |
| <CommandItemSettings AddNewRecordImageUrl="~/Images/favorites_16.png" AddNewRecordText="Add New Line" RefreshImageUrl="~/Images/document_refresh_16.png" RefreshText="Refresh Lines" /> |
| <Columns> |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" ItemStyle-Width="20px" /> |
| <telerik:GridClientDeleteColumn ButtonType="ImageButton" ItemStyle-Width="20px" ImageUrl="~/Images/trash_16.png" DataType="System.Guid" ConfirmText="Delete this item?" /> |
| <telerik:GridBoundColumn DataField="LineNumber" HeaderText="" ReadOnly="true" ItemStyle-Width="20px" /> |
| <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description" ColumnEditorID="DescriptionEditor" /> |
| <telerik:GridNumericColumn DataField="Quantity" HeaderText="Qty" UniqueName="Quantity" ItemStyle-Width="50px" ColumnEditorID="QuantityEditor" /> |
| <telerik:GridNumericColumn DataField="PricePerUnit" HeaderText="Price / Rate" UniqueName="PricePerUnit" ItemStyle-Width="50px" ColumnEditorID="PricePerUnitEditor" /> |
| <telerik:GridNumericColumn DataField="TotalPrice" HeaderText="Amount" UniqueName="TotalPrice" ReadOnly="true" ItemStyle-Width="75px" /> |
| <telerik:GridCheckBoxColumn DataField="Taxable" HeaderText="Tax" UniqueName="Taxable" ItemStyle-Width="25px" /> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <telerik:GridTextBoxColumnEditor ID="DescriptionEditor" runat="server"> |
| <TextBoxStyle Width="200px" BackColor="Aqua" /> |
| </telerik:GridTextBoxColumnEditor> |
| <telerik:GridNumericColumnEditor ID="QuantityEditor" runat="server"> |
| <NumericTextBox runat="server" Width="50px" /> |
| </telerik:GridNumericColumnEditor> |
| <telerik:GridNumericColumnEditor ID="PricePerUnitEditor" runat="server"> |
| <NumericTextBox runat="server" Width="50px" BackColor="AliceBlue" /> |
| </telerik:GridNumericColumnEditor> |
I'm really just trying to adjust the width (it would be nice if the edit controls automatically set their width to the column width), but I added some background colors just to be sure I'm not crazy.
The GridTextBoxColumnEditor always works, but the GridNumericColumnEditor only works if there is only one row in edit mode. Once I put a second row into edit mode the text boxes get huge again and the background color goes away.
Is there an easy fix for this?