how to hide column data but keep column header text

 Hello,

i want to hide my column data programmatically (C#) but still keep the column and its header.

Like if i have a column with header "Title". All the data in this column must not be visible.

any suggestion?

 

Thank you 

0
donkaiser
5/31/2007 4:22:56 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

3 Replies
752 Views

Similar Articles

[PageSpeed] 57

If it is all the data in a given column, then one way of doing it, would be to change:

SELECT A, B, C, TITLE FROM TABLE
to
SELECT A, B, C, TITLE, '' AS TITLE2 FROM TABLE

Duplicate the Title column and change the data that is displayed in the second to TITLE2. For those that are allowed to see the data, show the first, for those that are not, show the second.

You can also do it by turning the column into a template column giving the resultant control a name so its visible attribute can be turned off or on.


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
5/31/2007 5:15:16 PM

 sorry but im new to asp.net.

do you have a working example of a template column?

 Thank you
 

0
donkaiser
5/31/2007 8:24:32 PM

Have a look at


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
6/1/2007 6:26:38 AM
Reply:

Similar Artilces:

Is there a way to add extra control to header of a Grid column, but still keep the default column name? thanks
I am using Grid, and I add template field <asp:TemplateField HeaderText="name" SortExpression="something">if I want to have special header, I can use HeaderTemplate, but with HeaderTemplate added ,the headertext will not show, if there a way I can just add a control beside the headertext? since I don't want to handle the column sort. thanks I am sure there is a better way to do this, but in the past I have used the following method although I left out the commandname and arguments protected void GridView1_DataBound(object sender, EventArgs e) { string celltext = GridView1.H...

Inserting BLOB Type column data with other columns data(normal Text)
In below code, SQL Statement is used to Insert BLOB Type data using Serialization. It is required to insert other (normal text) with BLOB Type data as well. Like to get below SQL statement amended so that all the columns(ID,name, blob) can be inserted. Just now below code working fine Inserting BLOB Type data. I think it is not stright forward way to insert all the columns(normal text) with BLOB?  1 protected void button2_Click(object sender, EventArgs e) 2 { 3 //Connection string 4 string oradb = datasource= mysource;userid="xyz" password="passwo...

Gridview scrolling with Fixed Header
Hi   I want to keep the Headers fixed and  scroll the GridView . I am using the following the code.  <HeaderStyle HorizontalAlign="Left" ForeColor="Black" CssClass="Freezing" BackColor="#E0E0E0" />.Freezing { position:relative ; top:auto; /* top:this.offsetParent.scrollTop-1; */ /* top:expression(this.Parent.scrollTop); */z-index: 10; }  It works fine for Bound columns . It does not work for Dropdown columns. when i scroll the grid Dropdown box hides the Header text. My code is below.  <div class="&...

When is a column not a column?
I have several extremely similar datawindows that I have to maintain that go against the same table. Recently, I had to add a column to that table, and also add the column to ALL of these datawindows that go against this table. I added the column to the first datawindow, set up the edit control style, etc. I then did a copy/paste of the columns edit control to the remaining dw's (of course remembering to first add the column in SQL). Everything (update props, column specs, column props) seems to indicate that the pasted column is linked to the column I selected, HOWEVER, when I...

data presenttion with dynamic header and columns also fliping rows/columns
 I have to data in data set in the form  CustomerName , dateof theWeek abc                    1 januaryabc1                    1 januaryxyz                     1 january dfg                       2 januaryhsg            &nb...

Hide Blank Data Column on ReportViewer Control
If an optional data field is not selected, is it possible to hide (or exclude) header text on a ReportViewer control.  I am working with Visual Studio 2008, and Visual Basic .Net, a Dataset, and an .rdlc Report file, and utilize a dynamic sql query in my code. Thanks in advance!           RobHellest: If an optional data field is not selected, is it possible to hide (or exclude) header text on a ReportViewer control.  Which header text you are refering to, a colum header in a table? If ye...

Issue with Template Columns & Bound Columns while updating the data in a GridView control
Hi, I'm facing the below problem (In general, ObjectDataSource is driving me crazy ! ) I have a simple gridview control and an ObjectDataSource is used to populate the grid. I'm trying to update a row and the corresponding tableadapter methods & stored procedure are in place. Each row has 2 checkboxes and 2 textboxes in edit mode. When the change the values in edit mode and hit update, the checkbox values changed are saved into the Database properly, whereas the textbox values are not being saved. If the textbox column is a bound column then the column is updated with <NULL> in...

How do I turn 2 columns of data into 6 columns of data?
I am pulling the Display Name and Fax Number from Active Directory.  It gets put into a datatable, then fed to a DataGrid.  I end up with a format like this: dn fn dn fn dn fn etc. What I need to do is format it like this: dn fn dn fn dn fn dn fn dn fn dn fn I can try a DataList and use <%# DataBinder.Eval(Container.DataItem, "cn" %>, but then the same values would be put in the same place as the code looped through the search results. Does anyone know how to change the actual column layout of a DataGrid or DataList so the data is displayed horizontal...

Merge two text columns into one text column
Hi Everyone.. I would like to know what is the best way to merge two text column into one test column in the table. Thanks pbj ANY HELP PLS.. Are you using any front end application or unix or just the isql to merge two text datatype columns? If you are using any front end application then it should not be a problem to merge the two text datatype columns. ...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

Gridview input text field column
Using C# I have a gridview and added a template column called qty. I placed a button on the page and when clicked I call my code behind. While im looping thru the rows, all of the columns appear except the qty field. I'm assuming since I converted it to a template field that I need to do some binding to have it available in the GridView? Here is the code: foreach (GridViewRow row in GridView2.Rows){ Response.Write("text : "+row.Cells[5].Text); } If I change the cell above to - row.Cells[4].text it returns the 4th column just fine, but this column is not a template field - its a regular ...

Hide Gridview Column (incl Header) if contains no data
I have a gridview but frequently some of the cells in a row are blank, if this is the case for all the rows of returned data i would like to hide the entire column. Any ideas?  I came up with:  For i As Integer = 0 To GridView4.Rows.Count - 1 Dim row As GridViewRow = GridView4.Rows(i) If row.Cells(i).Text = "" Then row.Cells(i).Visible = False End If Next But it doesnt work at all : ( Here's a quick example: ASPX <%@ page language="VB" autoeventwireup="fal...

Grid view hiding columns and changing header text
Hi I have a web page where the columns displayed in a gridview depends on the settings in web config. I itterate through the columns and check the header text and if its the "name" of the value which is stored in web  config, it sets the visibility appropriately. I thought this was a pretty robust approach - if new columns were added, irrespective of postion, the displayed columns would still be those the user expected from web config. So the next request was that the header text was configuerable.... Ive searched the grid view for some sort of key on the columns (other than o...

how to combine full-text COLUMN data search w/ full-text CONTENT data search
how can i combine full-text COLUMN data search w/ full-text CONTENT data search? i am trying to access, in a single stored proc, both the full-text COLUMN data(sql server columns) and the full-text CONTENT data(documents in file system). i can successfully access each via there respective data providers; full-text COLUMN data: System.Data.SqlClient full-text CONTENT data: System.Data.OleDb however, i would like to UNION these data requests into a single stored proc, and therefore, thru a single data provider. is it possible to merge these to into a single stored proc and ...

Web resources about - how to hide column data but keep column header text - asp.net.presentation-controls

Politics, Political News - The Capitol Column
Covering the politics of science, technology, business, entertainment, Capitol Hill, and health.

Column (typography) - Wikipedia, the free encyclopedia
In typography , a column is one or more vertical blocks of content positioned on a page, separated by gutters and/or rules . Columns are most ...

Column 8: 'Don't order anything'
A word of warning about the true meaning of Australia Post's 'Hold Mail' service from Brian Jeffrey, of Cook, ACT.

Column 8: 'I am the Jenny doll'
&quot;I am the Jenny doll, and was a flight attendant with Qantas for 13 years,&quot; writes Jennie Leroy (nee Tregaskis, Column 8, Monday). ...

Paris attacks: column in IS magazine warns of 9/11-scale attack to come
Under the byline of a hostage British journalist, Islamic State warns that it may attempt a terrorist attack even bigger than 9/11.

Column 8: More weird 'hotel signage'
&quot;I have more weird 'hotel signage',&quot; offers George Watson, of Grafton (Column 8, Thursday). &quot;The following was posted on the wall ...

The 10 Best Online Columns Of All Time . . .
Former Biglaw partner and inhouse columnist Mark Herrmann identifies the ten best online columns of all time.

NY Times Ends Joe Nocera’s Column
The New York Times is ending Joe Nocera’ s bi-weekly op-ed column. Nocera’s last column, which focuses on business, Wall Street and regulation, ...

Mark Bittman's "Fast Company" Column Starts Today
The best-selling author and Emmy award-winning TV personality is writing about his startup experiences exclusively for Fast Company . The influence ...

ISIS militants tie captives to Palmyra's columns before blowing them up
ISIS militants tie captives to Palmyra's columns before blowing them up

Resources last updated: 11/21/2015 1:47:54 AM