|
Prev: Application not letting go of file.
Next: Seeking CSS, Javascript, HTML, PHP editor component....
From: Nick on 27 Jun 2008 06:05 Hey there, I have a GridView on an ASP.NET / VB page and currently it has an attribute called DataKeyNames which has a reference to an XML attribute name, for example. <asp:GridView CssClass="gridview" ID="mygridview" runat="server" AllowSorting="True" Width="100%" AutoGenerateColumns="False" AllowPaging="True" GridLines="None" DataKeyNames="id" .... xml snipette of row data <xmlnode id="0" param1="" param2="" /> This works fine, but I am trying to change it to XML Elements rather than attributes, i.e. <xmlnode> <id>0</id> <param1></param1> <param2></param2> </xmlnode> Unfortunately I'm not quite sure what to enter into DataKeyNames to allow the section via Element, any ideas how I do this? At current when I try to bind the data I just get told that id can't be found. Many thanks in advance for your help! Nick.
From: Nick on 27 Jun 2008 11:35 Hi there, Not to worry now, I have managed to resolve this issue by keeping the id as an attribute but changing all the other params to elements. The DataItem has to be typecast to an IXPathNavigable object during population of the grid and CreateNavigator is called and used in order to obtain the element values. Nick. "Nick" <a(a)a.com> wrote in message news:ujCoi1D2IHA.5564(a)TK2MSFTNGP06.phx.gbl... > Hey there, > > I have a GridView on an ASP.NET / VB page and currently it has an > attribute called DataKeyNames which has a reference to an XML attribute > name, for example. > > <asp:GridView CssClass="gridview" ID="mygridview" runat="server" > AllowSorting="True" Width="100%" > AutoGenerateColumns="False" > AllowPaging="True" > GridLines="None" > DataKeyNames="id" > > .... > > xml snipette of row data > > <xmlnode id="0" param1="" param2="" /> > > > > This works fine, but I am trying to change it to XML Elements rather than > attributes, i.e. > > <xmlnode> > <id>0</id> > <param1></param1> > <param2></param2> > </xmlnode> > > Unfortunately I'm not quite sure what to enter into DataKeyNames to allow > the section via Element, any ideas how I do this? At current when I try > to bind the data I just get told that id can't be found. > > Many thanks in advance for your help! > > Nick. >
|
Pages: 1 Prev: Application not letting go of file. Next: Seeking CSS, Javascript, HTML, PHP editor component.... |