Skip to Content
0

Bold type format a row in grid sap business one

Nov 15, 2017 at 04:14 PM

69

avatar image
Former Member

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

grilla.png (30.5 kB)
grilalbp.png (31.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
DIEGO LOTHER Nov 15, 2017 at 04:28 PM
1

Hi Esteban,

A sample:

oGrid.CommonSetting.SetRowFontStyle(nSelecRow, SAPbouiCOM.BoFontStyle.fs_Bold);

Hope it helps.

Kind Regards,

Diego Lother

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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

0
Former Member
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!

0

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

1
Former Member
DIEGO LOTHER

Thank you Diego, really works all, thank you so much :)

greetings!

0
Former Member
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

0
ANKIT CHAUHAN
Nov 15, 2017 at 04:26 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

thank you, i delete it

0