Datagrid problems

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

    #1

    Datagrid problems

    why i have no datas in my datagrid but i have 16 rows but no columns.
    16 rows that is the correct rows for all my datas but i dont see thes datas
    in my datagrid.

    someone a idea?

    Thanks Jens

    // Set up the DataAdapter and fill the DataSet

    da.SelectComman d = cmdSelect;
    da.UpdateComman d = cmdUpdate;
    da.DeleteComman d = cmdDelete;

    dataGridTableSt ylePeriode.Grid ColumnStyles.Ad d(dataGridTextB oxColumnID);
    dataGridTableSt ylePeriode.Grid ColumnStyles.Ad d(dataGridTextB oxColumnName);
    // etc...

    dataGridClient. TableStyles.Add (dataGridTableS tyleClient);
    da.Fill(ds, "tblClient" );

    dataGridClient. SetDataBinding( ds, "tblClient" );



  • pcPirate

    #2
    Re: Datagrid problems

    Jens,
    Perhaps you could try this:[color=blue]
    > // Set up the DataAdapter and fill the DataSet
    >
    > da.SelectComman d = cmdSelect;
    > da.UpdateComman d = cmdUpdate;
    > da.DeleteComman d = cmdDelete;
    >[/color]

    DataGridTextBox Column dataGridTextBox ColumnID= new DataGridTextBox Column();

    dataGridTextBox ColumnID.Mappin gName = "ID"; //ID is supposed to be the
    field name from "tblClient" table

    dataGridTextBox ColumnID.Header Text = "ID"; //This is the header text

    dataGridTextBox ColumnID.Width = 80;
    [color=blue]
    > dataGridTableSt ylePeriode.Grid ColumnStyles.Ad d(dataGridTextB oxColumnID);[/color]

    Do the same as the above for field "Name"...[color=blue]
    > dataGridTableSt ylePeriode.Grid ColumnStyles.Ad d(dataGridTextB oxColumnName);
    > // etc...
    >
    > dataGridClient. TableStyles.Add (dataGridTableS tyleClient);
    > da.Fill(ds, "tblClient" );
    >
    > dataGridClient. SetDataBinding( ds, "tblClient" );[/color]

    Hopefully would be helpful,
    pcPirate


    Comment

    • pcPirate

      #3
      Re: Datagrid problems

      Jens,
      Perhaps you could try this:[color=blue]
      > // Set up the DataAdapter and fill the DataSet
      >
      > da.SelectComman d = cmdSelect;
      > da.UpdateComman d = cmdUpdate;
      > da.DeleteComman d = cmdDelete;
      >[/color]

      DataGridTextBox Column dataGridTextBox ColumnID= new DataGridTextBox Column();

      dataGridTextBox ColumnID.Mappin gName = "ID"; //ID is supposed to be the
      field name from "tblClient" table

      dataGridTextBox ColumnID.Header Text = "ID"; //This is the header text

      dataGridTextBox ColumnID.Width = 80;
      [color=blue]
      > dataGridTableSt ylePeriode.Grid ColumnStyles.Ad d(dataGridTextB oxColumnID);[/color]

      Do the same as the above for field "Name"...[color=blue]
      > dataGridTableSt ylePeriode.Grid ColumnStyles.Ad d(dataGridTextB oxColumnName);
      > // etc...
      >
      > dataGridClient. TableStyles.Add (dataGridTableS tyleClient);
      > da.Fill(ds, "tblClient" );
      >
      > dataGridClient. SetDataBinding( ds, "tblClient" );
      >
      >
      >[/color]


      Comment

      Working...