473,793 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide ButtonColumn of Datagrid

Hi all..

I have a datagrid in my system and I preview the datagrid in other
html page. Below are the code that I'm using:

Dim oStringWriter As System.IO.Strin gWriter = New
System.IO.Strin gWriter
Dim oHtmlTextWriter As System.Web.UI.H tmlTextWriter = New
System.Web.UI.H tmlTextWriter(o StringWriter)

Me.ClearControl s(DataGrid1)
DataGrid1.Rende rControl(oHtmlT extWriter)
Response.Write( oStringWriter.T oString())
Response.End

The datagrid that I've created contains a ButtonColumn (Select) in the
first column. The problem is that the above code will preview the
whole datagrid(all columns) while I don't want to preview the first
column. I want to preview the other columns which contains the data.

I don't want to set at the html code:
<asp:ButtonColu mn Visible="true" Text="Select" CommandName="Se lect">
since this may hide the ButtonColumn view at the system. I only to
hide it at the preview page.

Is there any way to do this at the code-behind of the asp.net web
form?Any help is greatly appreciated.

Thanks.

Feb 27 '07 #1
1 3008
On Feb 26, 7:28 pm, nuhur...@yahoo. com wrote:
Hi all..

I have a datagrid in my system and I preview the datagrid in other
html page. Below are the code that I'm using:

Dim oStringWriter As System.IO.Strin gWriter = New
System.IO.Strin gWriter
Dim oHtmlTextWriter As System.Web.UI.H tmlTextWriter = New
System.Web.UI.H tmlTextWriter(o StringWriter)

Me.ClearControl s(DataGrid1)
DataGrid1.Rende rControl(oHtmlT extWriter)
Response.Write( oStringWriter.T oString())
Response.End

The datagrid that I've created contains a ButtonColumn (Select) in the
first column. The problem is that the above code will preview the
whole datagrid(all columns) while I don't want to preview the first
column. I want to preview the other columns which contains the data.

I don't want to set at the html code:
<asp:ButtonColu mn Visible="true" Text="Select" CommandName="Se lect">
since this may hide the ButtonColumn view at the system. I only to
hide it at the preview page.

Is there any way to do this at the code-behind of the asp.net web
form?Any help is greatly appreciated.

Thanks.
I got the solution... ----DataGrid1.Colum ns(0).Visible = False
Feb 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6835
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article: http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx I have a problem when there are two DataGrid's on one form, and when I switch focus from one grid to the other. To be more precise, when I'm editing a combo box column in one grid, and then click in the combo column of...
2
4826
by: Steve B. | last post by:
How can I hide a datagrid row or set it's width to zero. I need to filter the grid and and show only rows with selected data. Steve
4
5691
by: Tim | last post by:
Hi, I am trying to hide the datagrid row header (the left most column that has the 'select' triangle in it which moves with the selected row). It seems to be fairly simple; this.dgStockMasterSummary.RowHeadersVisible = false; however it doesn't hide it. Hiding the column headers works just fine. Does anyone have any ideas?
1
1566
by: strout | last post by:
Is it possible to add a dropdownlist to pager area so that user can select how many records to display on a page? Thank Strout
2
1204
by: velmj | last post by:
Hi, I have multiple datagrids on my page. I would like to display only one datagrid at a time using a tab buttons. I used a client side javascript function to hide the datagrid which is wrapped by <div> tag. But it didnt work as i expected. once a datagrid becomes invisible it is not visible again. Any suggestions. Thanks,
1
3093
by: Randall Parker | last post by:
Title says it all. Using ASP.Net v1.1. Want to show some message when there are no records to show in a grid. Does one do that with the DataGrid control itself? Or in CodeBehind should one conditionally fill in a label control only when one tests and sees the resultset of a query is empty? How do you handle this case?
1
2159
by: P Dietz | last post by:
Hello, I'm using a datagrid to show data (ok, what else...), and by doubleclick on a row I first hide the Datagrid-Form and start another form to work with the data. After returníng to the Datagrid-Form and reload the data I would like to jump to the same row as i was before. To get the actual row before leave the form, I use aktID = dvProt(Me.dgProt.CurrentRowIndex)!naqs_ID.toString
2
1395
by: glenn | last post by:
Hello, I have a HyperLinkColumn in a DataGrid found in a Summary page. When the link is clicked on, I want to get the data for all fields in the database for that record and display this data on a Details page that does not display the data in a DataGrid but instead displays it in a series of databound label controls. Is this possible or do I need to display the data on my Details page in a
4
1532
by: wassssup | last post by:
i want to know is there a way to check wherether is there data inside a datagrid and hide the datagrid when there isn't any. for example i drag the datagridview from the toolbox and put it on the windows form, then in the coding i put : "select * from table where balance <50"; it should display only items below 50, but when there isn't any(all items are above 50), i want to hide the datagrid....is there a way to do this?
0
9671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10161
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.