cancel
Showing results for 
Search instead for 
Did you mean: 

Get Grid Combobox selected index

Former Member
0 Kudos

Hi,

I can't get the index of selected combo box inside my grid. I can change the value of combox using only this code.

oForm.Items("grdConfirm").Specific.Columns.item(0).SetSelectedValue pVal.Row, oForm.Items("grdConfirm").Specific.Columns.item(0).ValidValues.item(0)

Thanks,

Raphael

Accepted Solutions (0)

Answers (1)

Answers (1)

edy_simon
Active Contributor
0 Kudos

Hi Raphael,

May I know why you need the index ?

I would usually get the Value directly from the DataTable.

Regards

Edy

Former Member
0 Kudos

oForm.Items("grdConfirm").Specific.Columns.item(0).SetSelectedValue pVal.Row, oForm.Items("grdConfirm").Specific.Columns.item(0).ValidValues.item(0)

i want to change the value of selected item in combo box.

edy_simon
Active Contributor
0 Kudos

Hi Raphael,

Dim oGrid as SAPbouiCOM.Grid = oForm.Items("grdConfirm").Specific

oGrid.DataTable.SetValue(0, oGrid.GetDataTableRowIndex(pVal.Row), "NewValue")


--New Value is the value of the combobox that you want. (not the index)


Regards

Edy



Former Member
0 Kudos

Hi Edy,

How can I get the value of combo box item that I selected?

Thanks,

Raphael

Former Member
0 Kudos

Hi Edy,

I am having this error

Data Table - exceeds column data size [66000-148]

Thanks,

Raphael

edy_simon
Active Contributor
0 Kudos

Hi Raphael,

The value you are trying to assign to this column exceeds the data size of the column.

To get the Value Selected.

Dim oGrid as SAPbouiCOM.Grid = oForm.Items("grdConfirm").Specific

oGrid.DataTable.GetValue(0, oGrid.GetDataTableRowIndex(pVal.Row))

Make sure that the 0 is the columns you are trying to set/get.

Regards

Edy