This is a migrated thread and some comments may be shown as answers.

Hide column in EditForm

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dhuss
Top achievements
Rank 1
dhuss asked on 17 Sep 2013, 09:14 PM
I have a bound grid column that has display = false. This column holds a foreign key for the row. How do you hide this column in the editformsettings when you click the "edit" command. My attached jpg has a section hi-lighted that I don't want visible to the user. This is my grid code:

<telerik:RadGrid ID="dgComboCodes" runat="server" GridLines="Both" AllowAutomaticDeletes="true"
     AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowPaging="true"
     AllowSorting="true" AllowMultiRowSelection="false" AutoGenerateColumns="false" Width="80%" AllowFilteringByColumn="true">
     <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
     <MasterTableView DataKeyNames="CORE_Business_Scenario_No,Adjustment_Reason_Code,Health_Care_Remark_Code,Adjustment_Group_Code"
         Width="100%" CommandItemDisplay="Top" HeaderStyle-CssClass="labelsMed">
         <Columns>
             <telerik:GridEditCommandColumn UniqueName="EditCmd" HeaderStyle-Width="10%"></telerik:GridEditCommandColumn>
             <telerik:GridBoundColumn Display="false" UniqueName="BS_Seq" DataField="CORE_Business_Scenario_No" HeaderStyle-Width="15%"></telerik:GridBoundColumn>
             <telerik:GridBoundColumn Display="true" UniqueName="CARC" DataField="Adjustment_Reason_Code" HeaderText="CARC" EditFormColumnIndex="0" HeaderStyle-Width="15%"></telerik:GridBoundColumn>
             <telerik:GridBoundColumn Display="true" UniqueName="RARC" DataField="Health_Care_Remark_Code" HeaderText="RARC" EditFormColumnIndex="1" HeaderStyle-Width="15%"></telerik:GridBoundColumn>
             <telerik:GridBoundColumn Display="true" UniqueName="CAGC" DataField="Adjustment_Group_Code" HeaderText="CAGC" EditFormColumnIndex="2" HeaderStyle-Width="15%"></telerik:GridBoundColumn>
             <telerik:GridButtonColumn uniquename="grdDelete" CommandName="Delete" ButtonType="ImageButton" HeaderStyle-Width="3%">
             </telerik:GridButtonColumn>
         </Columns>
         <EditFormSettings ColumnNumber="3" CaptionFormatString="Edit details for CARC {0}" CaptionDataField="Adjustment_Reason_Code">
             <FormTableItemStyle Wrap="False"></FormTableItemStyle>
             <FormCaptionStyle CssClass="labels"></FormCaptionStyle>
             <FormMainTableStyle GridLines="Both" CellPadding="2" CellSpacing="0" Width="80%" />
             <FormStyle Width="80%" />
             <EditColumn UpdateText="Update" UniqueName="EditCmd" CancelText="Cancel"></EditColumn>
             <FormTableButtonRowStyle HorizontalAlign="Left" />
         </EditFormSettings>
         <ExpandCollapseColumn ButtonType="ImageButton" Display="false" UniqueName="ExpandBtn" HeaderStyle-Width="19px"></ExpandCollapseColumn>
     </MasterTableView>
     <ClientSettings>
         <ClientEvents OnRowDblClick="RowDblClick" />
     </ClientSettings>
 </telerik:RadGrid>

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 18 Sep 2013, 04:19 AM
Hi ,

If you want to hide a column in view mode you can set it's Display="false", and if you want to hide it in the Edit form,please set ReadOnly="true" property for the column.

ASPX:
<telerik:GridBoundColumn Display="false" ReadOnly="true"  UniqueName="BS_Seq" DataField="CORE_Business_Scenario_No" HeaderStyle-Width="15%" >
</telerik:GridBoundColumn>


Thanks,
Princy
0
dhuss
Top achievements
Rank 1
answered on 18 Sep 2013, 02:01 PM
That did the trick. Thanks Princy.
Tags
Grid
Asked by
dhuss
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
dhuss
Top achievements
Rank 1
Share this question
or