473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set columns in dataGrid

I have this code:
//Perform search

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

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

this.dataSet.Re adXml(sreader);

this.DataGrid.D ataSource = dataSet;

this.DataGrid.D ataBind();

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 1110
set the AutoGenerateCol umns property to False. Then create column templates
for each column you want to display. The simplest version if this is the
BoundColumn:

<asp:BoundColum n DataField="FNam e"></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********@com cast.net> wrote in message
news:eV******** ******@TK2MSFTN GP09.phx.gbl...
I have this code:
//Perform search

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

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

this.dataSet.Re adXml(sreader);

this.DataGrid.D ataSource = dataSet;

this.DataGrid.D ataBind();

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 "BoundColum n"?

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

<asp:BoundColum n DataField="FNam e"></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********@com cast.net> wrote in message
news:eV******** ******@TK2MSFTN GP09.phx.gbl...
I have this code:
//Perform search

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

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

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

this.dataSet.Re adXml(sreader);

this.DataGrid.D ataSource = dataSet;

this.DataGrid.D ataBind();

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 "BoundColum n"

"Bob Boran" <mc*******@hotm ail.com> wrote in messag
news:eE******** ******@TK2MSFTN GP10.phx.gbl..
set the AutoGenerateCol umns property to False. Then create colum template for each column you want to display. The simplest version if this is th
BoundColumn
<asp:BoundCol umn DataField="FNam e"></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********@com cast.net> wrote in messag

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

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

sw.ToString(
"</root>")
this.dataSet.Re adXml(sreader)
this.DataGrid.D ataSource = dataSet
this.DataGrid.D ataBind()
>>>> 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
7669
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 Impact Summary</td> </tr> <tr> <td colspan=2></td>
3
2533
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 "Resource" with the following structure : Resource{,en,fr,es} Yes.. these are the only languages supported actually. A couple of rows in that table would...
2
2117
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
840
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 controlling the visibility of columns in the DataGrid control. The problem usually comes down to one fact. The DataGrid has a property called...
1
2303
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 and Currency format, all others are strings. I'd like to build one datagrid to handle this datagrid dynamically. I have it working now, all except...
6
2431
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 DataGrid in a web user control (.ascx) I am creating. This applies to VS.NET 2003 / Framework 1.1.
3
1334
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 simply disappears, as if it doesn't exist in ViewState.. However, the columns I created in the VS.NET DataGrid editor appear just fine.. Can someone...
8
7306
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 anyway to do that?
2
6384
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
1739
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 add more columns to the datagrid. This is a sample of how I am adding these colums: templateColumn = New TemplateColumn
0
7701
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...
0
7615
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...
1
7677
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...
0
7979
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...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.