Cancel
Showing results for 
Search instead for 
Did you mean: 

How to add text to column by using UIBLOCK List's add button?

Experimenter
Experimenter

 

 

Hi everyone,

 

I am currently working some method with C#, but I am not have many experience on programing, now got problem for sure.

 

quentions are below:

 

When I using List block from UIBLOCK, joing the add button and connecting the SeedfileDlx.

 

And I know if I want to add some text to column by using the add button, need to edit some code in the AddCallBack on C#.

 

Q1. What return value should I give in AddCallback?

 

       here is my code:

 

    public int AddCallback (NXOpen.BlockStyler.SetList set_list)
{
string[] jj = new string[] { "22", "11", "33", "55", "55" };
set_list.SetItemText(list0,jj);

 

return ;
}

 

I don't know what method I shoud use or if it's correct(I try so many method,ex :  SetString(),AddNewSet()... etc.). Because the UIBLOCK is not like WindosForm that i can't use the same way to edit the list.

 

I was stuck on this problem for a weeks.

 

If someone can help solve this problem, I would be very grateful.

 

best regards,

 

Dean

 

 

3 REPLIES

Re: How to add text to column by using UIBLOCK List's add button?

Phenom
Phenom

Not sure if you need a simple listbox or you need the setlist.

 

If you need the setlist, there is an example on solution center that demonstrates use of SetList.

 

 

https://solutions.industrysoftware.automation.siemens.com/view.php?sort=desc&q=setlist&dt=nx-api&fil... 

 

 

Suresh

Re: How to add text to column by using UIBLOCK List's add button?

Experimenter
Experimenter

thanks, the update_cb of example helps a lot!

Re: How to add text to column by using UIBLOCK List's add button?

Experimenter
Experimenter

Sorry, the URL you posted is not available now, could you please give me an example of the usage of the SetList, thank you.