Skip to Content
author's profile photo Former Member
Former Member

Bind data to grid

I have created grid through screen painter.How can I bind data to the column of the grid.

Regards,

Dilip Kumbhar

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2007 at 09:23 AM

    Hi dilip if your data is being bound to the grid at all times it is better to do the binding at design time itself.. In your screen painter,you will see the option add the tablename ,databind and fieldname as you are doing thru your code. All you have to do is highlight the specific column and enter the respective fields.. Now if you are using UDT's then do mention the @symbol at the beginin of the tablename.. Best of luck

    Regards

    Aris

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear friends,

      I solved the problem with the help of sample example.The grid could not be created using screen painter.I refrerred example "C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\19.Grid".Thanks for your help.

      Regards,

      Dilip Kumbhar

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2007 at 08:20 AM

    dear dilip,

    it is very simple... after adding dbdatasource to your form. uhave to bind each and every field from table.

    oColumn = oColumns.Item("column1_id");

    oColumn.DataBind.SetBound(true, "b1_table_name", "field_name");

    say your column name is "name" and want to bind it to "firstName" of OHEM table (b1 table). (firstName is the column in table OHEM)

    be carefull, for user table use @( like @table_name) before table name...

    it will help u.

    if satisfied, rewards points

    regards

    nirdesh panwar

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      dear dilip,

      after binding every coloumn of matrix, we have to load it.

      for that, just write down--

      oMatrix.Clear();

      oMatrix.AutoResizeColumns();

      oDBDataSource.Query(null);

      oMatrix.LoadFromDataSource();

      these lines will fill the matrix.

      and make sure that there shud be some values in table.

      hope it give give idea to u,

      if satisfied, rewards points..

      regards

      nirdesh panwar