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()
 
Back
Top