I have a need to show a grid will several columns that I don't want the user to see when the grid goes into edit mode.
I am adding the source code to the grid. I need to hide the "Date Due", "Description", "User Reference", etc...
I am adding the source code to the grid. I need to hide the "Date Due", "Description", "User Reference", etc...
<telerik:RadAjaxPanel ID="apnlPayments" runat="server" LoadingPanelID="ajaxLoadingPanel"> <telerik:RadGrid ID="gridPayments" runat="server" AllowAutomaticDeletes="true" AllowAutomaticUpdates="true" AllowAutomaticInserts="true" AllowFilteringByColumn="false" AllowPaging="false" AllowSorting="true" AllowMultiRowSelection="true" CellSpacing="0" CellPadding="0" PageSize="500" ShowGroupPanel="false" AllowCustomPaging="false" EnableLinqExpressions="false" GridLines="Both" HeaderStyle-Wrap="false" AutoGenerateColumns="false" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" OnItemDataBound="grid_ItemDataBound" OnPageIndexChanged="grid_PageIndexChanged" OnPageSizeChanged="grid_PageSizeChanged" OnNeedDataSource="grid_NeedDataSource" OnInsertCommand="gridPayments_InsertCommmand" OnUpdateCommand="gridPayments_UpdateCommand" OnDeleteCommand="gridPayments_DeleteCommand" OnPreRender="gridPayments_PreRender"> <ClientSettings allowautoscrollondragdrop="false" allowexpandcollapse="false" allowgroupexpandcollapse="false"> <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" /> <Scrolling AllowScroll="false" UseStaticHeaders="true" FrozenColumnsCount="4" /> <ClientEvents OnGridCreated="grid_GridCreated" /> <Resizing AllowResizeToFit="true" EnableRealTimeResize="true" /> </ClientSettings> <MasterTableView EditMode="EditForms" CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="LoanPaymentID" InsertItemPageIndexAction="ShowItemOnCurrentPage"> <ItemStyle CssClass="Row0" /> <AlternatingItemStyle CssClass="Row1" /> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="20px" /></RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"><HeaderStyle Width="20px" /></ExpandCollapseColumn> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" Visible="true"> <ItemStyle HorizontalAlign="Center" Wrap="false" VerticalAlign="Middle" /></telerik:GridEditCommandColumn> <telerik:GridButtonColumn ConfirmText="Delete this Payment?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" ImageUrl="~/Images/icon_delete.png" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"> <ItemStyle HorizontalAlign="Center" /> </telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="LoanPaymentPS_ACCT_NO" MaxLength="50" FilterControlAltText="Filter LoanPaymentPS_ACCT_NO column" HeaderStyle-Wrap="false" HeaderText="PS ACCT NO" SortExpression="LoanPaymentPS_ACCT_NO" UniqueName="PS_ACCT_NO" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn DataField="LoanPaymentDateDue" DataFormatString="{0:MM/dd/yyyy}" FilterControlAltText="Filter LoanPaymentDateDue column" HeaderStyle-Wrap="false" HeaderText="DATE DUE" SortExpression="LoanPaymentDateDue" UniqueName="LoanPaymentDateDue" ReadOnly="true"> </telerik:GridDateTimeColumn> <telerik:GridDateTimeColumn DataField="LoanPaymentDatePaid" DataFormatString="{0:MM/dd/yyyy}" FilterControlAltText="Filter LoanPaymentDatePaid column" HeaderStyle-Wrap="false" HeaderText="DATE PAID" SortExpression="LoanPaymentDatePaid" UniqueName="LoanPaymentDatePaid" DataType="System.DateTime"> </telerik:GridDateTimeColumn> <telerik:GridNumericColumn DataField="LoanPaymentAmount" NumericType="Currency" FilterControlAltText="Filter LoanPaymentAmount column" HeaderStyle-Wrap="false" HeaderText="AMOUNT" SortExpression="LoanPaymentAmount" UniqueName="LoanPaymentAmount"> </telerik:GridNumericColumn> <telerik:GridBoundColumn DataField="LoanPaymentDescription" MaxLength="50" FilterControlAltText="Filter LoanPaymentDescription column" HeaderStyle-Wrap="false" HeaderText="DESCRIPTION" SortExpression="LoanPaymentDescription" UniqueName="LoanPaymentDescription"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LoanPaymentUserReference" MaxLength="50" FilterControlAltText="Filter LoanPaymentUserReference column" HeaderStyle-Wrap="false" HeaderText="USER REFERENCE" SortExpression="LoanPaymentUserReference" UniqueName="LoanPaymentUserReference"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LoanPaymentMethodNo" MaxLength="50" FilterControlAltText="Filter LoanPaymentMethodNo column" HeaderStyle-Wrap="false" HeaderText="METHOD NO" SortExpression="LoanPaymentMethodNo" UniqueName="LoanPaymentMethodNo"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LoanPaymentMethodReference" MaxLength="50" FilterControlAltText="Filter LoanPaymentMethodReference column" HeaderStyle-Wrap="false" HeaderText="METHOD REFERENCE" SortExpression="LoanPaymentMethodReference" UniqueName="LoanPaymentMethodReference"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LoanPaymentType" MaxLength="50" FilterControlAltText="Filter LoanPaymentType column" HeaderStyle-Wrap="false" HeaderText="TYPE" SortExpression="LoanPaymentType" UniqueName="LoanPaymentType"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <FilterMenu EnableImageSprites="false" /> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" /> </telerik:RadGrid> </telerik:RadAjaxPanel>