GridViews in ASP.net; C#

Posted by user301802 on Stack Overflow See other posts from Stack Overflow or by user301802
Published on 2010-03-25T15:20:56Z Indexed on 2010/03/25 15:23 UTC
Read the original article Hit count: 450

Filed under:

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

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

This is what I have so far done:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FS_PS2FS._Default" %>

PS2FS Client                                                                                           


  " 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">

</div>
    <asp:SqlDataSource ID="PS2FS_FS" runat="server" ConnectionString="<%$ ConnectionStrings:FreightsmartWebConnection %>"
        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">
    </asp:SqlDataSource>

    &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
    <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">
        <FooterStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="Black" CssClass="normal" />
        <Columns>
            <asp:BoundField DataField="P2FV_ProcessId" HeaderText="Process ID" SortExpression="P2FV_ProcessId" Visible="False" />
            <asp:BoundField DataField="P2FV_ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                SortExpression="P2FV_ID" />
            <asp:BoundField DataField="P2FV_MessageType" HeaderText="Message Type" SortExpression="P2FV_MessageType" />
            <asp:BoundField DataField="P2FV_MessageText" HeaderText="Message Text" SortExpression="P2FV_MessageText" />
            <asp:BoundField DataField="P2FV_FileName" HeaderText="File Name" SortExpression="P2FV_FileName" />
            <asp:BoundField DataField="P2FV_CreateDate" HeaderText="Create Date" SortExpression="P2FV_CreateDate" />
            <asp:BoundField DataField="P2FV_CreateUser" HeaderText="Create User" SortExpression="P2FV_CreateUser" />
        </Columns>
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" BorderStyle="Outset" CssClass="normal" Wrap="True" />
        <PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <EditRowStyle BackColor="#999999" />
    </asp:GridView>

</form>

© Stack Overflow or respective owner

Related posts about c#