cancel
Showing results for 
Search instead for 
Did you mean: 

how to disable specific rows specific row of a grid using Asp.net with c#.

Former Member
0 Kudos

how to disable specific rows specific row of a grid using Asp.net with c#. thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

To answer the question from the last thread:

i know its difficult . please explain this point.

You can achieve it through a workaround of handling the events on that row and stopping the cursor from entering.

So, you can not disable a row (in 2007, and 8.8 - I am not sure about 8.81, I have not used it yet).

But what you can do, is handle any events that happen on that row and block them.

First of all, If you have not learnt about handling events in SAP B1 UI API, I suggest looking at the SDK samples : C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\02.CatchingEvents and also checking the helpfile.

Second, the code sample posted by David Nussbok in the previous thread is the solution:

if pval.EventType = et_GOT_FOCUS and pval.Row = 3 then
    bubbleevent = false
    oForm.Items.Item("txtUID").Click
end if

That code simply says:

If the user tries to put focus on row number 3

disable the event from happening (bubblevent = false)

and click somewhere else (in this case, a text box called "txtUID", you can replace it with any item on your form, or even the next row)

It is in VB.NET, but is easy to translate to C#.NET. If you have any misunderstanding of the code, please again go over samples and help file as these are concepts of the UI that need to be understood before you can move on to more complicated projects.

Former Member
0 Kudos

thanks njmod1 for ur advice , i know to handle events ,

if (val.FormTypeEx == "" & val.ItemUID == "" & val.ColUID == "" & val.Row != -1 )

{

if( val.EventType == SAPbouiCOM.BoEventTypes.et_CLICK)

Function

}

The problem for me is that. Focus is not redirecting. Also the grid is field by query . its not a textbox or something like that. i use one amoung the query field for my purpose. its the only issue for me . Any way thank you for your replay.