Set columns in dataGrid

  • Thread starter Thread starter Mark Goldin
  • Start date Start date
M

Mark Goldin

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
 
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.
 
What is "BoundColumn"?

Bob Boran said:
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.


sw.ToString()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top