title: GridViews in ASP.net; C#
body: <p>I am creating gridviews using C# and ASP.net ... I need help in creating 2 gridviews which they have same processID and getting data from different SQL tables in the same database..When I click on the one first row of the first gridview it should give me the list of files with the same processID and its details in the second gridview</p>
  
  <p>One process ID has many different xml files stored in it
  for example processID = 7A413EA4-8ECE-472D-92BE-F58C22E5C567 in the first gridview 
  so all the xml files with the username, date, login date  having the same processID in the second table should show up on selecting the row in the first table</p>
  
  <p>This is what I have so far done:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FS_PS2FS._Default" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;PS2FS Client&lt;/title&gt;
  &lt;/head&gt;
  &lt;body bgcolor="lightgrey"&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
          &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
          &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
          &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;
          &lt;asp:Label ID="heading" runat="server" Font-Bold="True" Font-Names="Times New Roman"
              Font-Size="XX-Large" Font-Underline="True" ForeColor="MidnightBlue" Text="PS2FS CLIENT" CssClass="normal" Height="41px" Width="227px" BorderStyle="Outset" BorderWidth="5px"&gt;&lt;/asp:Label&gt;&lt;br /&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &lt;asp:GridView ID="LOG_GridView" runat="server" AllowPaging="True" AutoGenerateColumns="False"
              CellPadding="4" DataSourceID="FS_PS2FS" ForeColor="#333333" Height="300px" Width="943px" HorizontalAlign="Center" CssClass="AlternatingRowStyle" PageSize="6" SelectedIndex="0" OnSelectedIndexChanging="LOG_GridView_SelectedIndexChanging" BorderColor="#999999"&gt;
              &lt;FooterStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="Black" CssClass="normal" /&gt;
              &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" VerticalAlign="Middle" CssClass="RowStyle" /&gt;
              &lt;EditRowStyle HorizontalAlign="Left" VerticalAlign="Middle" CssClass="normal" Font-Names="Cambria" BackColor="#999999" /&gt;
              &lt;SelectedRowStyle BackColor="#FFFFC0" Font-Bold="True" ForeColor="#333333" BorderStyle="Outset" CssClass="SelectedRowStyle" BorderColor="Yellow" /&gt;
              &lt;PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" VerticalAlign="Middle" /&gt;
              &lt;HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" CssClass="HeaderStyle" /&gt;
              &lt;AlternatingRowStyle BackColor="White" HorizontalAlign="Center" ForeColor="#284775" /&gt;
              &lt;Columns&gt;
                  &lt;asp:CommandField HeaderText="Select" ShowSelectButton="True" /&gt;
                  &lt;asp:BoundField DataField="LOG_ProcessId" HeaderText="Process ID" SortExpression="LOG_ProcessId" /&gt;
                  &lt;asp:BoundField DataField="LOG_Id" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                      SortExpression="LOG_Id" /&gt;
                  &lt;asp:BoundField DataField="LOG_FileName" HeaderText="File Name" SortExpression="LOG_FileName" /&gt;
                  &lt;asp:BoundField DataField="LOG_Date" HeaderText="Date" SortExpression="LOG_Date" /&gt;
                  &lt;asp:BoundField DataField="LOG_Description" HeaderText="Description" SortExpression="LOG_Description" /&gt;
                  &lt;asp:BoundField DataField="LOG_UserId" HeaderText="User ID" SortExpression="LOG_UserId" /&gt;
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
          &amp;nbsp;
          &lt;asp:SqlDataSource ID="FS_PS2FS" runat="server" ConnectionString="&lt;%$ ConnectionStrings:FreightsmartWebConnection %&gt;"
              SelectCommand="SELECT [LOG_Id], [LOG_FileName], [LOG_Description], [LOG_Date], [LOG_ProcessId], [LOG_Details], [LOG_UserId] FROM [FS_LOG_PS2FS] ORDER BY [LOG_Date] DESC"&gt;
          &lt;/asp:SqlDataSource&gt;
          &lt;br /&gt;
  
  
  &lt;/div&gt;
      &lt;asp:SqlDataSource ID="PS2FS_FS" runat="server" ConnectionString="&lt;%$ ConnectionStrings:FreightsmartWebConnection %&gt;"
          SelectCommand="SELECT [P2FV_ID], [P2FV_MessageType], [P2FV_MessageText], [P2FV_FileName], [P2FV_ProcessId], [P2FV_CreateDate], [P2FV_CreateUser] FROM [FS_LOG_PS2FS_Validation] ORDER BY [P2FV_CreateDate] DESC"&gt;
      &lt;/asp:SqlDataSource&gt;
  
      &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;
      &lt;asp:GridView ID="LogValidation_GridView" runat="server" AutoGenerateColumns="False" CellPadding="4"
          DataSourceID="PS2FS_FS" ForeColor="#333333" Height="300px" Width="940px" AllowPaging="True" HorizontalAlign="Center" PageSize="6" OnRowUpdated="LogValidation_GridView_RowUpdated" BorderColor="#999999"&gt;
          &lt;FooterStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="Black" CssClass="normal" /&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField DataField="P2FV_ProcessId" HeaderText="Process ID" SortExpression="P2FV_ProcessId" Visible="False" /&gt;
              &lt;asp:BoundField DataField="P2FV_ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                  SortExpression="P2FV_ID" /&gt;
              &lt;asp:BoundField DataField="P2FV_MessageType" HeaderText="Message Type" SortExpression="P2FV_MessageType" /&gt;
              &lt;asp:BoundField DataField="P2FV_MessageText" HeaderText="Message Text" SortExpression="P2FV_MessageText" /&gt;
              &lt;asp:BoundField DataField="P2FV_FileName" HeaderText="File Name" SortExpression="P2FV_FileName" /&gt;
              &lt;asp:BoundField DataField="P2FV_CreateDate" HeaderText="Create Date" SortExpression="P2FV_CreateDate" /&gt;
              &lt;asp:BoundField DataField="P2FV_CreateUser" HeaderText="Create User" SortExpression="P2FV_CreateUser" /&gt;
          &lt;/Columns&gt;
          &lt;RowStyle BackColor="#F7F6F3" ForeColor="#333333" /&gt;
          &lt;SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" BorderStyle="Outset" CssClass="normal" Wrap="True" /&gt;
          &lt;PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" /&gt;
          &lt;HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /&gt;
          &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
          &lt;EditRowStyle BackColor="#999999" /&gt;
      &lt;/asp:GridView&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>
  </p>