Get KoolPHP UI with 30% OFF!

Dynamic data source for dropdown column type

Ray
I would like to populate a dropdown column type by using a dynamic data source - instead of having a static list of items. Has anyone been able to figure out how to do this? Thanks for any insight!
Posted Jul 24, 2015 Kool
Peter
Do you mean you look for something like this http://demo.koolphp.net/Examples/KoolGrid/Advanced/Ajax_Template/index.php
If it is true, then you look for the GridTemplate feature.
Posted Jul 24, 2015 Kool
Ray
Yes, that's what I was looking for - Thanks
Posted Jul 24, 2015 Kool
Timothy Graber
I pasted the sample code into a test script and I get the following error messages
Warning: mysql_set_charset() expects parameter 2 to be resource, null given in /var/www/KoolControls/KoolGrid/koolgrid.php on line 1
Warning: mysql_query() expects parameter 2 to be resource, null given in /var/www/KoolControls/KoolGrid/koolgrid.php on line 1
Warning: mysql_fetch_field() expects parameter 1 to be resource, null given in /var/www/KoolControls/KoolGrid/koolgrid.php on line 1
Warning: mysql_free_result() expects parameter 1 to be resource, null given in /var/www/KoolControls/KoolGrid/koolgrid.php on line 1
More warnings and message display and then a small grid at the bottom. I can try to enter a new company, but the Continent and Country drop downs do not have any values. I've checked the database, and there are values in both tables. All the other demo pages seem to work ok...
Posted Nov 24, 2015 Kool
Igor
Hi,
simple one...
mysql connection
........
	
$column = new GridDropDownColumn();
$column->HeaderStyle->Align = "center";
$column->DataField = "fieldnameX";
$column->HeaderText = "Name";
    $result = mysql_query('select * from tableA');
    while($row=mysql_fetch_assoc($result))
    {
       $column->AddItem($row["fieldnameX"],$row["fieldnameX"]);
	 }
$grid->MasterTable->AddColumn($column);

Chears
Igor
Posted Jun 9, 2016 , edited Jun 13, 2016 Kool