Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Feb 04, 2008 08:22
open dhtmlx forum
ed to ro cell type

i have a grid with two columns (department, Description) with the first one is of type coro and the second one is of type ed. The values for the first column is being populated using a datareader as follows:

Response.Write("<column width=\"75\" type=\"coro\" align=\"left\" sort=\"int\">Department");
while (drDept.Read())
{
Response.Write("<option value=\"" + drDept["Description"] + "\">" + drDept["Department"] + "</option>");

}
Is there a way i can have a functionality when a user selects a department from the first cell the second cell should have the value of description for the corresponding department and the second cell of ed type should be changed to ro type.
Answer posted by Support on Feb 04, 2008 09:46
Something similar to next may work

    grid.attachEvent("onEditCell",function(stage,id,ind,value){
       if (stage==2 && ind==0){ //cell in first column changed
          grid.setCellExcellType(id,ind,"ro") //set second cell as readonly
          grid.cells(id,1).setValue(some_custom_get_description(value));   //set value of cell in second column
       }
        return true;
    });
Answer posted by shrishti on Mar 13, 2008 05:20
grid.setCellExcellType() is available only with pro edition. To achieve the same functionality with standard edition, what can be done?
Answer posted by Support on Mar 13, 2008 07:49
There is no way to truly change cell type, but if you need just made it readonly you can use

       if (stage==2 && ind==0){ //cell in first column changed
          grid.cells(id,1).setDisabled(true); // disable cell, which means it will be readonly