Updating Grid View from List Box

shineolivia

New Member
I have a list box like this,\[code\]<asp:ListBox ID="ListBox1" runat="server" Height="175px" Width="213px"> <asp:ListItem Value="http://stackoverflow.com/questions/11076156/all">All</asp:ListItem> <asp:ListItem Value="http://stackoverflow.com/questions/11076156/programmer">Computer Programmer</asp:ListItem> <asp:ListItem Value="http://stackoverflow.com/questions/11076156/itss">Information Technologies Support Services</asp:ListItem> <asp:ListItem Value="http://stackoverflow.com/questions/11076156/analyst">Systems Analyst</asp:ListItem> </asp:ListBox>\[/code\]and a Grid View like this,\[code\]<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="XmlDataSource1"> <Columns> <asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" /> <asp:BoundField DataField="program" HeaderText="Program" SortExpression="program" /> </Columns> </asp:GridView> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml" TransformFile="~/XSLTFile.xslt"></asp:XmlDataSource>\[/code\]Grid View is getting values from a XML & XSLT file. What I want to do is, when user selects suppose Computer Programmer from list box, the grid view should get updated with the results of only those have this program. How can I do this? Do I have to bind the xml with List Box?
 
Back
Top