Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Nested gridview

Nested gridview

Scheduled Pinned Locked Moved ASP.NET
helpcssdatabasewpfsysadmin
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    janat_Al_donia
    wrote on last edited by
    #1

    hi every body Im in big trouble please help me im using obout grid control and ineed to put detailed grid inside it the problem is how can i know the branch id that i need in the select query for the child grid i try using OnRow databound method but it give me null referance exception this part of code protected void OnGridRowDataBound(object sender, GridRowEventArgs e) { if (e.Row.RowIndex != -1 && e.Row.DataItem != null) { GridView GrdChildFind= new GridView(); GrdChildFind = (GridView)(e.Row.FindControl("grid2")); GrdChildFind.DataSource = GetBranchInfo(((DataRowView)e.Row.DataItem)["Branch_Id"].ToString()); GrdChildFind.DataBind(); and this the definsion of detailed grid <MasterDetailSettings LoadingMode="OnCallback" /> <DetailGrids> <obout:DetailGrid runat="server" ID="grid2" AutoGenerateColumns="false" AllowAddingRecords="true" ShowFooter="true" PageSize="5" FolderStyle="styles/premiere_blue" ForeignKeys="Branch_Id" OnInsertCommand="Insert2" OnUpdateCommand="Update2" OnDeleteCommand="Delate2"> <ClientSideEvents OnClientInsert="Insert2" OnClientUpdate="Update2" OnClientDelete="Delete2" /> <Columns>

    M A 2 Replies Last reply
    0
    • J janat_Al_donia

      hi every body Im in big trouble please help me im using obout grid control and ineed to put detailed grid inside it the problem is how can i know the branch id that i need in the select query for the child grid i try using OnRow databound method but it give me null referance exception this part of code protected void OnGridRowDataBound(object sender, GridRowEventArgs e) { if (e.Row.RowIndex != -1 && e.Row.DataItem != null) { GridView GrdChildFind= new GridView(); GrdChildFind = (GridView)(e.Row.FindControl("grid2")); GrdChildFind.DataSource = GetBranchInfo(((DataRowView)e.Row.DataItem)["Branch_Id"].ToString()); GrdChildFind.DataBind(); and this the definsion of detailed grid <MasterDetailSettings LoadingMode="OnCallback" /> <DetailGrids> <obout:DetailGrid runat="server" ID="grid2" AutoGenerateColumns="false" AllowAddingRecords="true" ShowFooter="true" PageSize="5" FolderStyle="styles/premiere_blue" ForeignKeys="Branch_Id" OnInsertCommand="Insert2" OnUpdateCommand="Update2" OnDeleteCommand="Delate2"> <ClientSideEvents OnClientInsert="Insert2" OnClientUpdate="Update2" OnClientDelete="Delete2" /> <Columns>

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      janat_Al_donia wrote:

      Im in big trouble please help me

      And you are creating same for us too by not even putting the code in pre tags.

      janat_Al_donia wrote:

      im using obout grid control and ineed to put detailed grid inside it

      I would suggest you to to rather use the obout forum for this.

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      1 Reply Last reply
      0
      • J janat_Al_donia

        hi every body Im in big trouble please help me im using obout grid control and ineed to put detailed grid inside it the problem is how can i know the branch id that i need in the select query for the child grid i try using OnRow databound method but it give me null referance exception this part of code protected void OnGridRowDataBound(object sender, GridRowEventArgs e) { if (e.Row.RowIndex != -1 && e.Row.DataItem != null) { GridView GrdChildFind= new GridView(); GrdChildFind = (GridView)(e.Row.FindControl("grid2")); GrdChildFind.DataSource = GetBranchInfo(((DataRowView)e.Row.DataItem)["Branch_Id"].ToString()); GrdChildFind.DataBind(); and this the definsion of detailed grid <MasterDetailSettings LoadingMode="OnCallback" /> <DetailGrids> <obout:DetailGrid runat="server" ID="grid2" AutoGenerateColumns="false" AllowAddingRecords="true" ShowFooter="true" PageSize="5" FolderStyle="styles/premiere_blue" ForeignKeys="Branch_Id" OnInsertCommand="Insert2" OnUpdateCommand="Update2" OnDeleteCommand="Delate2"> <ClientSideEvents OnClientInsert="Insert2" OnClientUpdate="Update2" OnClientDelete="Delete2" /> <Columns>

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Check if e.Row.FindControl actually gets the GridView or not. In case of normal GridView we use e.Item.FindControl... :doh:

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups