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.
Thanksset 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" <markgoldin@.comcast.net> wrote in message
news:eV#EXH0#DHA.3668@.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
What is "BoundColumn"?
"Bob Boran" <mcsdsmurf@.hotmail.com> wrote in message
news:eEkdDc0#DHA.3220@.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" <markgoldin@.comcast.net> wrote in message
> news:eV#EXH0#DHA.3668@.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
Check the following link for sample and explanation of a boundcolumn. (watch for line wrap
http://samples.gotdotnet.com/quicks...rid.aspx#column
HTH
Suresh
-- Mark Goldin wrote: --
What is "BoundColumn"
"Bob Boran" <mcsdsmurf@.hotmail.com> wrote in messag
news:eEkdDc0#DHA.3220@.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" <markgoldin@.comcast.net> wrote in messag
> news:eV#EXH0#DHA.3668@.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
>>>>>>
Thursday, March 29, 2012
Set columns in dataGrid
Labels:
asp,
code,
columns,
datagrid,
mappath,
net,
null,
perform,
searchxslt,
server,
sreader,
stringreader,
tiptreecat,
transform,
xml,
xpathdocument,
xslarg
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment