Adding coloumn in grid dynamically

Hi All ,

Is it possible to add a column in grid dynamically , for example if have to show 16 values of an object so i made values as row now the no of same object may vary from 1 to 50 depending upon no object selected now i want to show the vales in different column each object has unique identity. any help will be appriciated

thanks to all

Hi vikrant,

i m not understand well but i think u want same object for differit field and different values…

for that purpose u can creat array elements in EDT(this is in 2009) …we can create no.of arrays

for example u create one EDT like Address, in that array elements we can create no.of address fields with different names…

i think this information is useful to you…

Hi Suresh,

thanks for your reply .I am sorry i could explain properly . Now I am trying once again to explain …

First thing I have to show the data in grid

lets take example of an object as a Car now i have fixed 16 parameters for describing a car

since parameter are fixed but the number of car chosen for comparison can vary

now what i want I should be able to to show the data for all the cars chosen by user for comparison

see the picture given

here the user selected four models for comparison but next time he can chose 6 or 7 then we have to increase the no of column in grid which is my problem

I hope i have explained clearly

Hi,

I may wrong.I believe 16 parameter is fixed.

Create one more table(Temp Table) with 16 parameter and CarId

User will select list of cars.

Based on the user selection you loop it and insert data to tamp table with car id.

Carid parm1 parm2 parm3…

BMW Blue …

Audi Orange …

This will works if your parameter is fixed.

I could not understand and give more info since image is not visible.

no dude parameters are not fix they may change in future that is why i have problem

I know this can be done, I have had a developer do it for me. Could somehow make a method to alter the Visible (yes/no) property of the form for the field or fields you wish to possibly display. Say if 5 of the 16 fields are blank those 5 would not display?

I am not so convinced your data structure should be parameters, you seem to need more table and data flexibility.

Hi vikrant,

if u want to selected records want to show in grid for that long time i tryied like this way once u try…

void SelectedRecords()
{

BankTable bankTable ;
;
//getFirst method gets all the selected records in the grid
bankTable = bankTable_ds.getFirst(true);

while (bankTable )
{


}
}

Hi Mike,

If fields are fixed then we can use visible,invisible based on the condition.But this requirement is bit confusing.

For example

If another car has 20 property,we have to create(16+4 = 20) 4 more fields in back end.It is not good practice.

Experts any another solution?

Hi, You have to build the fields in the grid dynamically based on the parameters chosen. Refer http://www.axaptapedia.com/Runtime_form_controls

Hi Saju and Mike

The 16 parameter are in a master table and are fixed but they can increase in future if they increase we will add them in master table from where we are getting these 16 parameters . And if any car dose not have any property out of these 16 or more there we can show null or NA.

THANKS TO YOU ALL