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

Set columns in dataGrid

I have this code:
//Perform search

xslt.Transform(new XPathDocument(Server.MapPath("TIPTREECAT.xml")), xslArg,
sw, null);

StringReader sreader = new System.IO.StringReader("<root>" + sw.ToString() +
"</root>");

this.dataSet.ReadXml(sreader);

this.DataGrid.DataSource = dataSet;

this.DataGrid.DataBind();

How can I change colums I want to show in the grids? I want to show less
columns then there are in an xml data.

Thanks
Nov 18 '05 #1
3 1102
set the AutoGenerateColumns property to False. Then create column templates
for each column you want to display. The simplest version if this is the
BoundColumn:

<asp:BoundColumn DataField="FName"></asp:BoundColumn>

You can also right-mouse click the datagrid and go to Property Builder.
This utility will help you set up your datagrid.
"Mark Goldin" <ma********@comcast.net> wrote in message
news:eV**************@TK2MSFTNGP09.phx.gbl...
I have this code:
//Perform search

xslt.Transform(new XPathDocument(Server.MapPath("TIPTREECAT.xml")), xslArg, sw, null);

StringReader sreader = new System.IO.StringReader("<root>" + sw.ToString() + "</root>");

this.dataSet.ReadXml(sreader);

this.DataGrid.DataSource = dataSet;

this.DataGrid.DataBind();

How can I change colums I want to show in the grids? I want to show less
columns then there are in an xml data.

Thanks

Nov 18 '05 #2
What is "BoundColumn"?

"Bob Boran" <mc*******@hotmail.com> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
set the AutoGenerateColumns property to False. Then create column templates for each column you want to display. The simplest version if this is the
BoundColumn:

<asp:BoundColumn DataField="FName"></asp:BoundColumn>

You can also right-mouse click the datagrid and go to Property Builder.
This utility will help you set up your datagrid.
"Mark Goldin" <ma********@comcast.net> wrote in message
news:eV**************@TK2MSFTNGP09.phx.gbl...
I have this code:
//Perform search

xslt.Transform(new XPathDocument(Server.MapPath("TIPTREECAT.xml")), xslArg,
sw, null);

StringReader sreader = new System.IO.StringReader("<root>" +

sw.ToString() +
"</root>");

this.dataSet.ReadXml(sreader);

this.DataGrid.DataSource = dataSet;

this.DataGrid.DataBind();

How can I change colums I want to show in the grids? I want to show less
columns then there are in an xml data.

Thanks


Nov 18 '05 #3
Check the following link for sample and explanation of a boundcolumn. (watch for line wrap
http://samples.gotdotnet.com/quickst...id.aspx#column

HTH
Suresh

----- Mark Goldin wrote: ----

What is "BoundColumn"

"Bob Boran" <mc*******@hotmail.com> wrote in messag
news:eE**************@TK2MSFTNGP10.phx.gbl..
set the AutoGenerateColumns property to False. Then create colum template for each column you want to display. The simplest version if this is th
BoundColumn
<asp:BoundColumn DataField="FName"></asp:BoundColumn>>> You can also right-mouse click the datagrid and go to Property Builder This utility will help you set up your datagrid
"Mark Goldin" <ma********@comcast.net> wrote in messag

news:eV**************@TK2MSFTNGP09.phx.gbl..
I have this code
//Perform searc
xslt.Transform(new XPathDocument(Server.MapPath("TIPTREECAT.xml"))

xslArg
sw, null)
StringReader sreader = new System.IO.StringReader("<root>"

sw.ToString(
"</root>")
this.dataSet.ReadXml(sreader)
this.DataGrid.DataSource = dataSet
this.DataGrid.DataBind()
>>>> How can I change colums I want to show in the grids? I want to show les

columns then there are in an xml data
Thank
>>

Nov 18 '05 #4

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

Similar topics

7
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
2
by: Kevin | last post by:
Hi Al Can someone tell me how to hide colums in a datagrid. I have a one datagrid that is a master and child and I would like to hide specific columns, how do I do this TI Kevin
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
1
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date...
6
by: John Ruiz | last post by:
Greetings, I originally posted this to microsoft.public.dotnet.framework.aspnet.datagridcontrol two weeks ago, but no one was able to answer. I am unable to dynamically add columns to a...
3
by: Allen K | last post by:
Hi, I'm programmatically creating a HyperLink column for my datagrd ( in addition to Bound Columns created through the VS.NET Visual Interface ). However, when a Postback occurs, this column...
8
by: Hanson | last post by:
I have a datagrid control in an aspx page. The datagrid columns will be dynamically generated according to the pre-page's search condition, I want to hide some columns in the datagrid. is that...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
0
by: tafpin | last post by:
I have an application with a datagrid. In the IDE I have 2 template columns. The first has an image button and the second contains a link button. According to the results that I get back I must...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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:
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.