BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi Jimmy,
Thanks for using Syncfusion products.
We would like to let you know that, DropDownListFor control will work well with template. We can use any template in the DropDownListFor control. For your convenience we have prepared the sample with the image and title as you have given in the update. Please download the sample from the following location.
http://www.syncfusion.com/uploads/user/forum/118516/DDL_For_value-644783507.zip
Also the value gets reflected and updated in the DropDownListFor control if we give the value that is binded in the fields of the DropDownListFor control as shown in the following code snippet.
[Controller] cars.Add(new Books { text = "Louis", value = "Louis", eimg = "7", desig = "Representative", country = "Australia" }); |
We have to give the value which we have binded in the DropDownListFor fields.
Please check with the sample. If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. Please let us know the Essential Studio version which you are using. This would be helpful for us to serve you better.
Please let us know if you have further concern.
Regards,
Saranya.S
Hi Jimmy,
Thanks for your update.
We would like to let you know that, in order to get the banner id as value, we have to map the ‘bannerId’ column to text field in dropdown control and get the same value with using same model while postback as shown in the following code snippet.
<code>
[cs]
publicActionResultIndex()
{
DropDownListPropertiesDropdownProperties =newDropDownListProperties();
DropdownProperties.DataSource = GetDataSource();
DropdownProperties.Template ="<img class='eimg' src='/images/Employees/${eimg}.png' alt='employee' width='100px'/><div class='ename'> ${bannerId} </div>";
DropDownListFieldsddlfields =newDropDownListFields();
ddlfields.Text ="bannerId";
DropdownProperties.DropDownListFields = ddlfields;
ViewData["DropdownModel"] = DropdownProperties;
returnView();
}
[HttpPost]
publicActionResultRegister(Booksmodel)
{
returnView(model);
}</code>
In the view page we have to map the text value as shown in the following code snippet.
<code>
[view]
@Html.EJ().DropDownListFor(model => model.bannerId,(Syncfusion.JavaScript.Models.DropDownListProperties)ViewData["DropdownModel"])
</code>
For your convenience we have modified the sample, please download the sample from the following location.
http://www.syncfusion.com/downloads/support/directtrac/135838/DDL_For_value259511479.zip
Please let us know if you have further concern.
Regards,
Saranya.S
Hi Jimmy,
Thanks for your update.
We would like to let you know that, we have modified the sample by changing “bannerId” to the int field as per your requirement. We have to map the “bannerId” to the value field and the “name” to the text field in which you can able to get the text “name” to display and get the value “bannerId” in the form postback since value will be posted in the form postback.
We have modified the sample to achieve your requirement, please download the sample from the following location.
http://www.syncfusion.com/uploads/user/forum/118516/DDL_For_value_(2)1315018977.zip
Please let us know if you have further concern.
Regards,
Saranya.S
Hi Jimmy,
Thanks for using Syncfusion products.
We would like to let you know that, the reported issue (Datetime value is not set for a DatePickerFor control) is a known issue in 12.4.0.24 version. This issue has been fixed and included in our latest service pack release (12.4.0.34) of Vol 4, 2014 and it is available for download under the following link location.
Kindly upgrade to the latest version to resolve the issue.
Please let us know if you have further queries.
Regards,
Saranya.S