This website is not affiliated with, sponsored by, or approved by SAP AG.

cl_gui_alv_grid and checkbox (Color a Row)

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

cl_gui_alv_grid and checkbox (Color a Row)

Postby jamiguel7777 » Wed Jan 21, 2015 5:48 pm

Hi Friends i have been developed my ABAP program using cl_gui_alv_grid with a checkbox column i am basedon this sample:

BCALV_EDIT_05

ALL is ok, i detect (or know wich rows was selected with the checkbox).

i want now when user click on a checkbox for select 1 row, want coloring the row, how do it?

need detect a Click event? and dothe job? or?


any advice or tutorial or code?

thanks
jamiguel7777
 
Posts: 11
Joined: Tue Jan 20, 2015 10:47 am

Re: cl_gui_alv_grid and checkbox (Color a Row)

Postby Gothmog » Thu Jan 22, 2015 8:26 am

Why don't you let the standard line selection do it?
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1943
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: cl_gui_alv_grid and checkbox (Color a Row)

Postby jamiguel7777 » Thu Jan 22, 2015 10:37 am

Because the user selection can show 1000 rows

The user can select row: 1,40,170,350,700,780

and is better with a checkbox.

The Checkbox column is the first.

Now i pretend, if user check the row1, and in the third column have a value: '002' then coloring the row with RED color. if is different the third column to '002' then the color is white.

i am try know how to detect the click event on the cl_gui_alv_grid.

Thanks
jamiguel7777
 
Posts: 11
Joined: Tue Jan 20, 2015 10:47 am

Re: cl_gui_alv_grid and checkbox (Color a Row)

Postby Rich » Tue Jan 27, 2015 7:39 am

There are two fields in the Layout structure (INFO_FNAME CTAB_FNAME) which control the colouring of either an entire row or individual cells within a row. These fields specify a field in your itab.

During your click event, read the relevant row of the data table and set the fields that the above mention to the correct colour codes, then refresh your grid if needed.
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool


Return to ABAP

Who is online

Users browsing this forum: No registered users and 8 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.