I am creating a web page with a form where people can score websites. To create this form I have to get certain default values from a MySQL database and create a grid with these rows of data (Metrics). And for each row created with default values (Metrics) there must be a listbox (Score_Value) in that row with its own values (Measure_Unit_LOV_Display_Name) specific for that row loaded. Each row has its own hidden ID (Measure_Unit_ID) that I can use to search the values for each row's listbox (Score_Value). I can see the lines in the listbox coincide with the amount of values for that listbox but it is empty lines. Why are the values not showing? 😕
Code:
function EditableGrid1_Score_Value_BeforeShow(& $sender)
{
$EditableGrid1_Score_Value_BeforeShow = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $EditableGrid1; //Compatibility
$db = null;
$db = new clsDBConnection1();
$SQL = "SELECT Measure_Unit_LOV_ID, Measure_Unit_LOV_Display_Name, Measure_Unit_LOV_Value \n" .
"FROM Measure_Unit_LOV where Measure_Unit_ID = " . $EditableGrid1->Measure_Unit_ID->GetValue();
$db->query($SQL);
$Measure_Unit = array();
while ($db->next_record())
{
$a = array();
$a["Measure_Unit_LOV_Display_Name"] = $db->f("Measure_Unit_LOV_Display_Name");
$a["Measure_Unit_LOV_Value"] = $db->f("Measure_Unit_LOV_Value");
$a["Measure_Unit_LOV_ID"] = $db->f("Measure_Unit_LOV_ID");
$Measure_Unit[] = $a;
}
$EditableGrid1->Score_Value->Values = $Measure_Unit;
$EditableGrid1->Score_Value->BoundColumn = $Measure_Unit["Measure_Unit_LOV_ID"];
$EditableGrid1->Score_Value->TextColumn = $Measure_Unit["Measure_Unit_LOV_Display_Name"];
$db->close();
return $EditableGrid1_Score_Value_BeforeShow;
}
Any ideas welcome.