cancel
Showing results for 
Search instead for 
Did you mean: 

Bind data to grid

Former Member
0 Kudos

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

Regards,

Dilip Kumbhar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

objForm = SBO_Application.Forms.Item("Grid")

objForm.Visible = True

oDBDataSource = oForm.DataSources.DBDataSources.Add("OITM")

oColumn = oColumns.Item("ItemName")

oColumn.DataBind.SetBound(True, "OITM", "ItemName")

How to set data source for the grid ? It gives error of null exception .

Former Member
0 Kudos

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