473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP.NET Bound Columns

Hi,
I have recently started developing ASP.net applications using VB.net.
Well, I created this huge query to retrieve data from SQL Server and create a pivot table, which means I'm creating columns of values. It all works fine and I have a datagrid which displays the data like the way I want.

I'm using Bound columns where I'm defining the Name and Datafields to show for my datagrid columns. All of this was the easy part.

Now, my query creates 55 columns which makes my data grid look like an I-Max screen (weeeheee). To shorten the looks of the grid what I can do is show columns which has a value > 0 and do not show the ones which do not. As I review the data in my I MAX grid there are loads of columns which have zeros and there visibility of no use to me. However, I cannot have zero values columns totally not show in my grid as they might have values based on selection made(business logic).

So, how can I make something like this.... in my code behind

IF <asp:boundcolumn headertext="3RT " datafield="3RT " /> < 0 THEN <asp:boundcolumn headertext="3RT FEE " datafield="Z510" /> .Visible = false


I know the above does not make sense as coding goes but this is just to show what I wanna do in the terms of logic. Remember I have 55 columns like that and I wanna have the same condition for all of 'em.

I'll appreciate any help.
Thanks.
Feb 9 '07 #1
1 771
kenobewan
4,871 Expert 4TB
Here is an article that shows how top hide a column using a headertext:
Hide DataGrid Columns via HeaderText
Feb 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Cindi Simonson | last post by:
Hi, I have a form with a combo box containing 4 columns of data. The form also contains 3 print buttons where the goal is to open 3 different reports according to the value in one of the...
15
by: John Blair | last post by:
Hi, Code attached but the line that gives me an error is MyDataGrid.Columns(2).Visible = False It actually gives me an error for any value instead of 2 even when 9 bound columns of data exist....
1
by: Chad Devine | last post by:
Alright, I am posting my solution to a problem I've been having. I have finally found the answer, and it took me a while so I thought I'd provide the final solution here, since it may be benificial...
4
by: Raed Sawalha | last post by:
i have datagrid , I added a bound column and I need to map it with two data fields ...is this possible? <asp:datagrid id=dgInbox runat="server" EnableViewState="False"...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
0
by: Dave | last post by:
I'm having trouble trying to get some bound datagrids to work. I even tried to use some examples that were given to me, but I can't get those to work, either. I have customers, who have orders,...
4
by: Tomasz Jastrzebski | last post by:
Hello Everyone, I have a GridView control bound to a plain DataTable object. AutoGenerateEditButton is set to true, Edit button gets displayed, and RowEditing event fires as expected.
5
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but...
1
by: sivagururaja | last post by:
Hi All, How can i bound the column in the gridview dynamically. When i tried to bound the column using the Code behind, it won't work. Here is my code. BoundColumn bc = new BoundColumn();...
0
by: TonyJ | last post by:
Hello! I'm unsure when I can use a bound datagrid and when I can't. What limitations has a bound datagrid? 1. For example if I want to manipulate the data in the datasource before displaying...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.