473,387 Members | 1,303 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.

DataColumns

Hi Folks,
I would like to know how can i specify columns in my DataGrid manually ?
I have a proc that is binding my DataGrid with 15 columns and i want just
some of these columns, how can i ?

Thanks in advance

--
Please, check my theSpoke:
http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx
Nov 19 '05 #1
1 938
Hi,
First you have to set the autogeneratecolumns property to false for the
datagrid. then you can add columns in the aspx file or in the code behind
file.

code for aspx
<Columns>
<asp:BoundColumn DataField="[colname]" HeaderText="nameforthecol">
</asp:BoundColumn>
</columns>
or in code behind like

Dim bcTemp As BoundColumn = new BoundColumn
bcTemp.DataField = "[colname]"
bcTemp.HeaderText = "nameforthecol"
dgFileList.Columns.Add(bcTemp)
--
HTH
srini
http://www.expertszone.com
"Paperback Writer" wrote:
Hi Folks,
I would like to know how can i specify columns in my DataGrid manually ?
I have a proc that is binding my DataGrid with 15 columns and i want just
some of these columns, how can i ?

Thanks in advance

--
Please, check my theSpoke:
http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx

Nov 19 '05 #2

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

Similar topics

4
by: Chris H. | last post by:
Fellow .Netters, I have come to an impass trying to "hide" a column on a data grid - I'm sure it's a fairly simple thing (but so am I, that's why I'm stuck) Imagine if you will that I have a...
4
by: Chris H. | last post by:
Fellow .Netters, I have come to an impass trying to "hide" a column on a data grid - I'm sure it's a fairly simple thing (but so am I, that's why I'm stuck) Imagine if you will that I have a...
9
by: G .Net | last post by:
Hi Can anybody help with a problem with Expressions for DataColumns Suppose I have a table with three fields A, B and C. I want an expression in column C so that C = 2 * A if A is not...
0
by: Nergock | last post by:
Have anyone run into this difference with SQL Server 2005 and the SqlDataTable Load method? In SQL Server 2000, when I create a table using the SqlDataTable.Load method passing it 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
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
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,...
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
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...
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...

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.