Hi,
Can you help me with the following.
I'am using the RadGrid inside the RadComboBox itemtemplate and I have problems with setting the combobox selected text/value on grid's OnRowSelected client side event. When I select a row from grid after the page has been loaded then the combobox selected text will be every grid row's values concatenated but when I select a new row after that then the selected text will be displayed correctly. Can you tell me why this happens?
I also want to access the combobox selected text/value on server side after postback. I added trackChanges() and commitChanges() methods like below but still the combo.ClientChanges count property is 0 e.g. after asp:button click.
Grid is grouped by two columns, so is it possible to configure combobox so that if user clicks the category row then combobox should not be closed?
Thanks,
Pete
Can you help me with the following.
I'am using the RadGrid inside the RadComboBox itemtemplate and I have problems with setting the combobox selected text/value on grid's OnRowSelected client side event. When I select a row from grid after the page has been loaded then the combobox selected text will be every grid row's values concatenated but when I select a new row after that then the selected text will be displayed correctly. Can you tell me why this happens?
I also want to access the combobox selected text/value on server side after postback. I added trackChanges() and commitChanges() methods like below but still the combo.ClientChanges count property is 0 e.g. after asp:button click.
Grid is grouped by two columns, so is it possible to configure combobox so that if user clicks the category row then combobox should not be closed?
<rad:RadCodeBlock ID="codeBlock" runat="server"> |
<script type="text/javascript"> |
function onRowSelected(sender, args) |
{ |
var selectedText = args.getDataKeyValue("TypeName"); |
var selectedValue = args.getDataKeyValue("ID"); |
var combo = $find("rcb"); |
if (selectedValue.length > 0) |
{ |
combo.trackChanges(); |
combo.set_text(selectedText); |
combo.set_value(selectedValue); |
combo.commitChanges(); |
combo.hideDropDown(); |
} |
} |
</script> |
</rad:RadCodeBlock> |
<rad:RadComboBox ID="rcb" runat="server" Width="400px"> |
<Items> |
<rad:RadComboBoxItem Selected="true" /> |
</Items> |
<ItemTemplate> |
<rad:RadGrid ID="rgRiskClasses" |
runat="server" |
Skin="Web20" |
OnItemCommand="rgRiskClasses_ItemCommand"> |
<MasterTableView AutoGenerateColumns="false" |
GroupLoadMode="Client" |
GroupsDefaultExpanded="true" |
ClientDataKeyNames="ID,TypeName"> |
<Columns> |
<rad:GridBoundColumn DataField="id"></rad:GridBoundColumn> |
<rad:GridBoundColumn DataField="TypeName"></rad:GridBoundColumn> |
</Columns> |
<GroupByExpressions> |
<rad:GridGroupByExpression> |
<GroupByFields> |
<rad:GridGroupByField FieldName="CategoryName" /> |
</GroupByFields> |
<SelectFields> |
<rad:GridGroupByField FieldName="CategoryName" /> |
</SelectFields> |
</rad:GridGroupByExpression> |
<rad:GridGroupByExpression> |
<GroupByFields> |
<rad:GridGroupByField FieldName="ClassName" /> |
</GroupByFields> |
<SelectFields> |
<rad:GridGroupByField FieldName="ClassName" /> |
</SelectFields> |
</rad:GridGroupByExpression> |
</GroupByExpressions> |
</MasterTableView> |
<ClientSettings AllowGroupExpandCollapse="false"> |
<Selecting AllowRowSelect="True" /> |
<ClientEvents OnRowSelected="onRowSelected" /> |
</ClientSettings> |
</rad:RadGrid> |
</ItemTemplate> |
</rad:RadComboBox> |
Thanks,
Pete