Hi stworthy,
I am aware of both the onChange and onSelect. My problem is that I am unable to fire the server side event within them. In the below example I have tried to add the newly selected value as the selected item in the original "select" and then firing its change function. Unfortunately, although this causes a postback it never calls the SelectedIndexChanged event.
$(document).ready(function () {
//var currName = $('#ctl00_PageContent_CardIdFilter').attr('name');
$('#ctl00_PageContent_CardIdFilter').combogrid({
panelWidth: 600,
panelHeight: 360,
width: 250,
mode: 'remote',
striped: 'True',
idField: 'CardId',
textField: 'CardName',
fitColumns: 'true',
loadMsg: 'Searching...',
pagination: 'True',
pageSize: '10',
onSelect: function (rowIndex, rowData) {
var o = new Option(rowData.CardName, rowData.CardId);
$(o).html(rowData.CardName);
$('#ctl00_PageContent_CardIdFilter').prepend(o);
$('#ctl00_PageContent_CardIdFilter').val(rowData.CardId);
$('#ctl00_PageContent_CardIdFilter').change();
},
etc
protected override void CardIdFilter_SelectedIndexChanged(object sender, EventArgs args)
{
// Never gets called
}
I believe this is because when a combogrid is created it removes the name from the original select and sets that same name to the hidden combo-value.
<select
onchange = "javascript:setTimeout('__doPostBack(\'ctl00$PageContent$CardIdFilter\',\'\')', 0)"
id = "ctl00_PageContent_CardIdFilter"
class = "Filter_Input combogrid-f combo-f"
onkeypress = "dropDownListTypeAhead(this,false)"
onfocus = "try{document.getElementById("__LASTFOCUS").value=this.id;}catch(e){}"
comboname = "ctl00$PageContent$CardIdFilter"
style = "display: none;" >
< /select>
<input type="hidden" class="combo-value" name="ctl00$PageContent$CardIdFilter" value="">
Unfortunately I am not able to call a generic (e.g. newly created) server side function as I am trying to fit this within a framework that autogenerates a lot of code - including the SelectedIndexChanged.