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

RadGrid - hide a specific column during print

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Singh
Top achievements
Rank 1
Singh asked on 18 Mar 2014, 05:59 PM
Hi I wish to hide 'Edit' column using @mediaPrint. I am unable to manipulate the html created using radGrid via jQuery. Following is the HTML created:

   
    <TR>
    <TD>
    <DIV id="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_ctl42Panel">
    <DIV id="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_ctl42">
    <DIV style="WIDTH: 100%" id="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid" class="RadGrid RadGrid_Default">
    <TABLE style="WIDTH: 100%; EMPTY-CELLS: show; TABLE-LAYOUT: auto" id="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid_ctl00" class="rgMasterTable" border="0">
    <COLGROUP><COL style="WIDTH: 3%" /><COL style="WIDTH: 15%" /><COL style="WIDTH: 15%" /><COL style="WIDTH: 10%" /><COL style="WIDTH: 10%" /><COL style="WIDTH: 15%" /><COL style="WIDTH: 10%" /><COL style="WIDTH: 22%" /></COLGROUP>
    <THEAD>
    <TR>
    <TH style="DISPLAY: none" class="rgHeader" scope="col" UniqueName="Edit">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl00','')">Edit</A>
    </TH>
    <TH style="TEXT-ALIGN: center" class="rgHeader" scope="col" UniqueName="Parent_x0020_Program">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl01','')">Parent Program</A>
    </TH>
    <TH style="TEXT-ALIGN: center" class="rgHeader" scope="col" UniqueName="Program">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl02','')">Program</A>
    </TH>
    <TH style="TEXT-ALIGN: center" class="rgHeader" scope="col" UniqueName="Program_x0020_ID">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl03','')">Program ID</A>
    </TH>
    <TH style="TEXT-ALIGN: center" class="rgHeader" scope="col" UniqueName="Group">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl04','')">Group</A>
    </TH>
    <TH style="TEXT-ALIGN: center" class="rgHeader" scope="col" UniqueName="Investment_x0020_Envelope">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl05','')">Investment Envelope</A>
    </TH>
    <TH style="TEXT-ALIGN: center" class="rgHeader" scope="col" UniqueName="Function">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl06','')">Function</A>
    </TH>
    <TH style="TEXT-ALIGN: center" class="rgHeader" scope="col" UniqueName="AKA">
    <A title="Click here to sort" href="javascript:__doPostBack('ctl00$ctl22$g_6f2f4cde_9491_4d9a_b866_c338a5db0248$g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid$ctl00$ctl02$ctl01$ctl07','')">AKA</A>
    </TH>
    </TR>
    </THEAD>
    <TBODY>
    <TR id="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid_ctl00__0" class="rgRow" vAlign="top">
    <TD vAlign="top" align="center">
    <A onclick="GoToLink(this);return false;" href="/ProjectProfileForm.aspx?LID=228" target="_self"><IMG border="0" alt="Edit" src="/images/edititem.gif" /></A>
    </TD>
    <TD vAlign="top" align="center">
    </TD>
    <TD vAlign="top" align="center">
    The Big one
    </TD>
    <TD vAlign="top" align="center">
    PRG0001
    </TD>
    <TD vAlign="top" align="center">
    PDN
    </TD>
    <TD vAlign="top" align="center">
    Revenue Growth
    </TD>
    <TD vAlign="top" align="center">
    Engineering
    </TD>
    <TD vAlign="top" align="center">
    the dummy project for testing
    </TD>
    </TR>
    </TBODY>
    </TABLE>
    <INPUT id="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid_ClientState" type="hidden" name="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_g_6f2f4cde_9491_4d9a_b866_c338a5db0248Grid_ClientState" autocomplete="off" value="" />
    </DIV>
    </DIV>
    </DIV>
    <DIV style="DISPLAY: none" id="ctl00_ctl22_g_6f2f4cde_9491_4d9a_b866_c338a5db0248_AjaxLoadingPanel">
    <IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" src="/Images/loading6.gif" />test
    </DIV>
    </TD>
    </TR>

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 21 Mar 2014, 01:37 PM
Hi Singh,

Could you please elaborate a little bit more about the issue which you are facing? If you want to hide the header and data items of the Edit column then you have to find the rendered html elements and set diplay attribute to none. if you search the net for hiding a html table column by using a jQuery you will find many solutions how to achieve that.

Regards,
Kostadin
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Grid
Asked by
Singh
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or