combo doubt in grid

I have a grid with combo column in second column and from that combo id field should be displayed in 0th column and another text column in 1st column how to do it please help me

thanks in advance

Hi All
I found the solution using this link

viewtopic.php?f=4&t=18080

But when i am using the following code my column 0 and column 1 values are changing always until the cellIndex reaches 7 th column

My doubt is when i select cellindex 0 then cellIndex1 need to be changed but now what is happening is when i am changing cellindex 2 , 3,4,5,6,7 also cellindex 0 and cellindex 1 values are changing. please solve my problem

[PHP]
if(cellIndex==2 && cellIndex==3 && cellIndex==4 && cellIndex==5 && cellIndex==6 && cellIndex==7)
{

	return false;
}
else 

{

		 myGrid.cells(rowId,0).setCValue(oldvalues);
		 myGrid.cells(rowId,1).setCValue(newvalues);
}

[/PHP]

Hi,

grid.attachEvent("onEditCell",function(stage,rowId,cellIndex,value){ if(stage==2&&cellIndex==0){ grid.cells(rowId,1).setValue(value); return false } return true })

Hi Alexandra
Thanks for Reply
The code you sent is working well but my grid column 0 value displayed as “XX-27” format in ‘coro’ field(combo box) column from the combo box field i need to poplate XX in column1 and 27 to column0

You sent the following code

grid.attachEvent("onEditCell",function(stage,rowId,cellIndex,value){
    if(stage==2&&cellIndex==0){
         grid.cells(rowId,1).setValue(value);
         return false
    }
    return true
})

I Changed to get my work done in the following way

myGrid.attachEvent("onEditCell",function(stage,rowId,cellIndex,value){
		if(stage==2&&cellIndex==0){
			value1=value.split("-");
			var values0= value1[0];
			 myGrid.cells(rowId,1).setValue(values0);
         	return false
   		 }
        return true
	})

what i want now is in the grid 27 to be displayed in cellIndex0 and XX to be displayed in the cellIndex1 fields

help me please

i need to poplate XX in column1 and 27 to column0

i could be done as follows:

myGrid.attachEvent("onEditCell",function(stage,rowId,cellIndex,value){ if(stage==2&&cellIndex==0){ value1=value.split("-"); var values0= value1[0]; myGrid.cells(rowId,1).setValue(values0); return value1[1]; } return true })

Hi Alexandra

Thanks once again for your reply

myGrid.attachEvent("onEditCell",function(stage,rowId,cellIndex,value){
		  if(stage==2&&cellIndex==0){
			   value1=value.split("-");
			   var values0= value1[0];
			    var values1= value1[1];
			   myGrid.cells(rowId,1).setValue(values0);
			   myGrid.cells(rowId,0).setValue(values1);
			   return  value1[1];
		   }
		   return true
		})

The above code worked for me
otherwise i was getting in cellindex0 th column xx-27 and in cellindex1 i was getting 27
When i added these two rows in the function i am able to get the desired result

[quote]
   var values1= value1[1];
			   myGrid.cells(rowId,0).setValue(values1);
[/quote]

Thanks again for your reply