Datagrid source= datarow array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rodchar

    Datagrid source= datarow array

    Hey all,

    I have an array of data rows that when I bind it to a datagrid it shows all
    those extra rows in addition to my fields. How do I hide those fields?

    I tried using the TableStyles property but seems like it's getting overridden.

    Any ideas?

    Thanks in advance,
    rodchar
  • Cor Ligthert

    #2
    Re: Datagrid source= datarow array

    Rodchar,

    An array of datarows seems difficult to me to bind that to the columnstyles.

    Normally is used the normal container for datarows "the datatable" with as
    view the dataview which are make it so simple to select the proper columns
    or rows.

    I think you take the hard way, I am as well curious if somebody did that as
    well.
    It is such a nice build in feature ADONET.

    Cor
    [color=blue]
    > I have an array of data rows that when I bind it to a datagrid it shows[/color]
    all[color=blue]
    > those extra rows in addition to my fields. How do I hide those fields?
    >
    > I tried using the TableStyles property but seems like it's getting[/color]
    overridden.[color=blue]
    >
    > Any ideas?
    >
    > Thanks in advance,
    > rodchar[/color]


    Comment

    • Cor Ligthert

      #3
      Re: Datagrid source= datarow array

      Rodchar,

      Just clone the original table and add the datarows to that by looping
      through it, you can use for that the datarow.itemarr ay

      I hope this gives an idea?

      Cor

      "rodchar" <rodchar@discus sions.microsoft .com>
      [color=blue]
      > What I'm using is the GetChildRows method which returns an array of[/color]
      datarows.[color=blue]
      > How do I get those rows into an empty table and then bind to my datagrid?
      >
      >
      > "Cor Ligthert" wrote:
      >[color=green]
      > > Rodchar,
      > >
      > > An array of datarows seems difficult to me to bind that to the[/color][/color]
      columnstyles.[color=blue][color=green]
      > >
      > > Normally is used the normal container for datarows "the datatable" with[/color][/color]
      as[color=blue][color=green]
      > > view the dataview which are make it so simple to select the proper[/color][/color]
      columns[color=blue][color=green]
      > > or rows.
      > >
      > > I think you take the hard way, I am as well curious if somebody did that[/color][/color]
      as[color=blue][color=green]
      > > well.
      > > It is such a nice build in feature ADONET.
      > >
      > > Cor
      > >[color=darkred]
      > > > I have an array of data rows that when I bind it to a datagrid it[/color][/color][/color]
      shows[color=blue][color=green]
      > > all[color=darkred]
      > > > those extra rows in addition to my fields. How do I hide those fields?
      > > >
      > > > I tried using the TableStyles property but seems like it's getting[/color]
      > > overridden.[color=darkred]
      > > >
      > > > Any ideas?
      > > >
      > > > Thanks in advance,
      > > > rodchar[/color]
      > >
      > >
      > >[/color][/color]


      Comment

      • Cor Ligthert

        #4
        Re: Datagrid source= datarow array

        Why do you than not use the relation to set the databinding of the datagrid?

        Sample changed from an original program so watch typos
        \\\
        DataRelatieGF = New DataRelation _
        ("Gfunct", dsG.Tables("g") .Columns("ng"), _
        dsG.Tables("gf" ).Columns("ng") )
        dsG.Relations.A dd(DataRelatieG F)

        dgGroepen.SetDa taBinding(dsG, "g")
        dgGroepFuncties .SetDataBinding (dsG, "g.gf")
        ///

        Cor


        Comment

        • rodchar

          #5
          Re: Datagrid source= datarow array

          ok, that worked. Now, how do I sync the datagrid with the drop down list?

          "Cor Ligthert" wrote:
          [color=blue]
          > Why do you than not use the relation to set the databinding of the datagrid?
          >
          > Sample changed from an original program so watch typos
          > \\\
          > DataRelatieGF = New DataRelation _
          > ("Gfunct", dsG.Tables("g") .Columns("ng"), _
          > dsG.Tables("gf" ).Columns("ng") )
          > dsG.Relations.A dd(DataRelatieG F)
          >
          > dgGroepen.SetDa taBinding(dsG, "g")
          > dgGroepFuncties .SetDataBinding (dsG, "g.gf")
          > ///
          >
          > Cor
          >
          >
          >[/color]

          Comment

          • Cor Ligthert

            #6
            Re: Datagrid source= datarow array

            You nowhere told you where using a dropdownlist, do I understand that this
            is a Webform application. However this confuses me, because in that do as
            far as I know not exist tablestyles?

            Cor


            Comment

            • Cor Ligthert

              #7
              Re: Datagrid source= datarow array

              Rodchar,

              You are probable talking about a combobox (dropdown and dropdownlist are
              controls from a webform).

              Probably you can use binding the combobox text to the column in your
              datasource table using something as

              combobox.DataBi ndings.Add(New Binding("Text", dataset1.Tables (0),
              "Mycolumnam e"))

              (know that the combobox in my opinion acts sometimes strange with binding)

              I hope this helps?

              Cor

              "rodchar" <rodchar@discus sions.microsoft .com> >

              On a form, my dropdown list is bound to a column in my master table. The[color=blue]
              > datagrid is now, thanks to you, bound to the data relation name. However,[/color]
              I[color=blue]
              > don't know how to sync the datagrid to the drop down list selected value.
              >
              > "Cor Ligthert" wrote:
              >[color=green]
              > > You nowhere told you where using a dropdownlist, do I understand that[/color][/color]
              this[color=blue][color=green]
              > > is a Webform application. However this confuses me, because in that do[/color][/color]
              as[color=blue][color=green]
              > > far as I know not exist tablestyles?
              > >
              > > Cor
              > >
              > >
              > >[/color][/color]


              Comment

              Working...