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
  1. Home
  2. General Programming
  3. C#
  4. Winform DataGrid HELP HELP!

Winform DataGrid HELP HELP!

Scheduled Pinned Locked Moved C#
helpquestioncss
1 Posts 1 Posters 0 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.
  • L Offline
    L Offline
    Looney Tunezez
    wrote on last edited by
    #1

    Hey, This is driving me up the wall! Some one please help,please please! Heres the situation I have a set of 3 grids. They bind correctly as follows //Parent Grid dataGrid1.DataSource=parent; //Child Grid dataGrid2.DataSource=parent; dataGrid2.DataMember="Parent.Child"; //Grand Child Grid dataGrid3.DataSource=parent; dataGrid3.DataMember="Parent.ChildToGrandChild"; The relation works beautifully.Been working for months now. Here is the issue: I have to filter out data in the child grid ie dataGrid2, which in turn will affect dataGrid3 which is fine. I have tried using the RowFilter property of the DefaultView exposed by the DataTable, but to no avail. Filter does not take effect and it renders all the rows. These are the methods i have tried. 1. ((System.Data.DataTable) dataGrid2.DataSource).ChildRelations["Parent.Child"].ChildTable.DefaultView.RowFilter = " [FilterMeNow] = '1'"; does not work. 2. I tried setting up the filter before establishing the databinding but after the relation is set, again it wont work. e.g. patient.DataSet.Tables[1].DefaultView.RowFilter="[FilterMeNow]= '1'"; dataGrid2.DataSource=patient; dataGrid.DataMember="Parent.ToChild"; 3. Googling it leads to me to think setting the row filter is the way to go....but nothing seems to happen. Though it works for me when i am using it on a single non-relationed datagrid. I know RowFilter works because I have been using it for single grid all year long. So how do i go about using it in master-child relation datagrid. Am I just supposed to refresh the grids after they are bound, resulting in the row filter to take affect. If so, how? Desperate plead other wise i will have to write 2 procedures, one with filtered data and one without filtered data. which to me seems absolutely horrendous, kind of defeating the whole purpose of the row filter functionality. so please rescue me from this ! Frusturated Looney Tunezez Cheers! Looney Tunezez "If you build it.... .....BUGS will come!" -JB
    Application.Run(new Form1(this.Dispose())); <--WHAT :wtf::confused::eek:
    "Stability. What an interesting concept" - Chris Maunder

    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