bueno tengo mi boton con clickafter, el cual tiene un case como tu me recomendaste con los caption, y para poder llenar la grilla en el case find: voy un método que hace esto:
public void grBusVlr () {
SAPbobsCOM.Recordset oRecordset1 = ((SAPbobsCOM.Recordset)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
oitem = oForm.Items.Item("grdpy");
oGrid = ((SAPbouiCOM.Grid)(oitem.Specific));
string vlGrilla = null;
string Sql10 = "select t0.PayMethCod as 'grcode',t1.Cardcode as 'cod' from OPYM as t0 left join ocrd as t1 on t0.PayMethCod= t1.pymcode where t1.cardcode='" + EditText0.Value.ToString() + "'";
oRecordset1.DoQuery(Sql10);
string Extraerdequery10 = oRecordset1.Fields.Item("grcode").Value.ToString();
vlGrilla = Extraerdequery10;
oForm.DataSources.DataTables.Item("grPagdt");
oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT distinct t0.PayMethCod AS 'Código',t0.Descript as' Descripción',t0.Active as 'Activo' from OPYM as t0 left join ocrd as t1 on t0.PayMethCod= t1.pymcode where t0.type='O' ");
//oGrid.DataTable = oForm.DataSources.DataTables.Item("grPagdt2");
oGrid.Columns.Item("Activo").Type = SAPbouiCOM.BoGridColumnType.gct_CheckBox;
//para agregar el link buton a la grilla
oGrid.Columns.Item("Código").Type = SAPbouiCOM.BoGridColumnType.gct_EditText;
SAPbouiCOM.EditTextColumn oEdit = (SAPbouiCOM.EditTextColumn)oGrid.Columns.Item("Código");
oEdit.LinkedObjectType = "147";
//oCBC.ValidValues.Add(oRec.Fields.Item(0).Value.ToString(), oRec.Fields.Item(1).Value.ToString());
//algo parecido a lo que hace el boto de fijar metodo, lo hago aca para que el viejaSel no sea -1 y pueda sacar la linea en negrita
//string valor = (string)oGrid.DataTable.GetValue("Código", 2); esto es para saber lo que lleva una linea en especifico
for (int iRows = 0; iRows <= oGrid.Rows.Count - 1; iRows++)
{
if ((string)oGrid.DataTable.GetValue("Código", iRows) == vlGrilla)
{
if (viejaSel != -1)
oGrid.CommonSetting.SetRowFontStyle(viejaSel, SAPbouiCOM.BoFontStyle.fs_Plain);
oGrid.CommonSetting.SetRowFontStyle(iRows + 1, SAPbouiCOM.BoFontStyle.fs_Bold);
viejaSel = iRows + 1;
}
}
}
mas que nada primero para que me re dibuje la grilla y ponga la linea ne negrita.
el boton que fija el metodo estandar despues de que hace la actualizacion, es decir hay un cambio le cambio el caption a ok.

int viejaSel = -1;
String sValorGrid;
public void Button2_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent )
{
BubbleEvent = true;
try
{
if (oGrid.Rows.SelectedRows.Count > 0) //VERIFICA QUE EXISTA UN ROW SELECCIONADO
{
if (viejaSel != -1)
oGrid.CommonSetting.SetRowFontStyle(viejaSel, SAPbouiCOM.BoFontStyle.fs_Plain);
int nSelecRow = (oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder));
viejaSel = nSelecRow + 1;
//oApp.SetStatusBarMessage("El dato es " + oldSelection + nSelecRow);
//seleccion el row y se destaca en negrita
oGrid.CommonSetting.SetRowFontStyle(nSelecRow + 1, SAPbouiCOM.BoFontStyle.fs_Bold);
sValorGrid = Convert.ToString(oGrid.DataTable.GetValue("Código", nSelecRow));
// Button0.Caption = "Update";
if (Button0.Caption=="OK"){
Button0.Caption ="Update";
}
}
}
catch (Exception)
{
oApp.SetStatusBarMessage("Error en el boton: " + oCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);
}
}
para que así se vaya al case ok, estoy redirigiendo lo mal?
igual intenteba con
goto caption ""
pero de la misma manera sale.