473,404 Members | 2,213 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,404 software developers and data experts.

Display selected fields in datagrid

Hello group,

I using a datagrid to display output of a query, now the problem is that it
displays all column of query in columns of grid, ( e. g.)is it possible that
i fetch Employee name ,age and salary and i display only name and age..

Thanks

Andy
Nov 18 '05 #1
2 1341
You have to use AutogenerateColumns = False and define the columns that you
want to display
e.g.

<asp:datagrid autogeneratecolumn=false runat="server" id="dg">
<Columns>
<asp:BoundColumn DataField="EmployeeName" />
<asp:BoundColumn DataField="Age" />
<asp:BoundColumn DataField="Salary" Visible="false" />
</Columns>
</asp:daatgrid>

Regards
Martin

"anand" <an****@armour.com> wrote in message
news:eL**************@TK2MSFTNGP12.phx.gbl...
Hello group,

I using a datagrid to display output of a query, now the problem is that it displays all column of query in columns of grid, ( e. g.)is it possible that i fetch Employee name ,age and salary and i display only name and age..

Thanks

Andy

Nov 18 '05 #2
Thanks Martin....

Regards,

Anand

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:#h**************@TK2MSFTNGP11.phx.gbl...
You have to use AutogenerateColumns = False and define the columns that you want to display
e.g.

<asp:datagrid autogeneratecolumn=false runat="server" id="dg">
<Columns>
<asp:BoundColumn DataField="EmployeeName" />
<asp:BoundColumn DataField="Age" />
<asp:BoundColumn DataField="Salary" Visible="false" />
</Columns>
</asp:daatgrid>

Regards
Martin

"anand" <an****@armour.com> wrote in message
news:eL**************@TK2MSFTNGP12.phx.gbl...
Hello group,

I using a datagrid to display output of a query, now the problem is that

it
displays all column of query in columns of grid, ( e. g.)is it possible

that
i fetch Employee name ,age and salary and i display only name and age..

Thanks

Andy


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
Nov 18 '05 #3

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

Similar topics

19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
1
by: kll | last post by:
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data...
18
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
0
by: wwcoop | last post by:
I am connected to an Access Database. I am reading a Yes/No field from the DB which translates back as True/False in the text field of my datagrid. I want to use a checkbox to show the value...
1
by: ArizonaState | last post by:
I have a Stored Proc which outputs the sum of various fields from a table. CODE ... ... COMPUTE SUM(Field1), SUM(Field2), SUM(Field3)... /CODE I am able to execute the SProc and obtain...
2
by: giandeo | last post by:
Hello all, It's almost a couple of weeks since i am struggling to get this code work. Unfortunately, i am stuck. There seems to be no hope... Please Help....... I am working with an asp page...
2
by: Iain Wilson | last post by:
Hi Can anyone please advise if this is possible and if so how I would go about it (a pointer to an example would be greatly appreciated). Using C# - Web Application I have a DropDownList with...
2
by: kurtzky | last post by:
i created a form that should function as follows: i will enter a number in a textbox..then it should query from the database all the records which has that number..these records will have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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,...

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.