on 2017 Nov 15 4:14 PM - last edited on 2024 Feb 04 1:37 AM by postmig_api_4
I would like to make a row with Bold type format in a grid on my addon, I mean in the bp on the payment run all the bp had select some payment method i would like to do that.
i woud like to select like this one.
my code is:
private 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
{
int nSelecRow = oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder)
string sValorGrid = Convert.ToString(oGrid.DataTable.GetValue("Código", nSelecRow));
// oGrid.Columns.Item("Código").TextStyle = 1;
}
thank you
Hi Esteban,
A sample:
oGrid.CommonSetting.SetRowFontStyle(nSelecRow, SAPbouiCOM.BoFontStyle.fs_Bold);
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank very useful as usual, just one question when i select the third for example they select the second one, i could put +1 to but i could have problem with the third row...
and the other question is, only want to select one , but i can press the botton twice for example and they mark both, how can i do that only one? my grid is in ms_Single..
thank you
Hi Esteban,
Use the nSelecRow + 1 will do the job properly. I tested and work fine for all lines.
For your second doubt, if the user change the line and click on the button for new line, you can clean the formatting of the old line. A sample:
oGrid.CommonSetting.SetRowFontStyle(oldSelection, SAPbouiCOM.BoFontStyle.fs_Plain);
Hope it helps.
Kind Regards,
Diego Lother
thank you, really works,
int nSelecRow = (oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder)) ;
oGrid.CommonSetting.SetRowFontStyle(nSelecRow +1, SAPbouiCOM.BoFontStyle.fs_Bold);
string sValorGrid = Convert.ToString(oGrid.DataTable.GetValue("Código", nSelecRow ));
I just put +1 in the nSelecRow and it works
the second thing, im try to do it, but how can declare the second one to change the font style?
oGrid.CommonSetting.SetRowFontStyle(oldSelection, SAPbouiCOM.BoFontStyle.fs_Plain);
maybe with a if?
int oldSelection = oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder) + 1;
thank you, and im sorry about my rookie question , greetings, and thank you again!
Hi Esteban,
You can declare a variable on your class scope, and use it to achieve your purpose. A sample:
int oldSelection = -1;
private 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 (oldSelection != -1)
oGrid.CommonSetting.SetRowFontStyle(oldSelection, SAPbouiCOM.BoFontStyle.fs_Plain);
int nSelecRow = (oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder));
oldSelection = nSelecRow + 1;
oGrid.CommonSetting.SetRowFontStyle(nSelecRow +1, SAPbouiCOM.BoFontStyle.fs_Bold);
string sValorGrid = Convert.ToString(oGrid.DataTable.GetValue("Código", nSelecRow ));
}
}
catch
{
}
}
Kind Regards,
Diego Lother
HI Diego,
sorry to bother you, two more question about the grid:
1) when a client is already created in the bp table, and in my form push the search buttoon, how can get the selected row in the business parner in my addon?
2) to get the value of the row and save in a edit.textbox how can i get it?
thank you again...
Esteban Peralta
Hi,
This question looks same as here. Please close one of the thread to avoid any misunderstanding and delay.
Kind regards,
ANKIT CHAUHAN
SAP SME Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
113 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.