Hi, I wonder if someone can point me in the right direction..
I have a webcombo dropdown which I am using to display a grid, I have Type Ahead set to extended and all works well. My issue is as follows, I am using this webcombo to select a particular client and wanted to populate other controls on the same page dependant on which client is selected. My problem comes on how to select the client I am currently highlighted on. I didn;t want a button next to the webcombo to select it and post back, so was hoping that I could either use the enter key to select the client that is currently highlighted, or the mouse click on the grid to post back to the server and populate accordingly.
What is the best/easiest way of doing this?
Hope it all makes sense
Many thanks
Richard
Great minds think alike (Well I like to think I have a great mind) I had implemented the following js (at the end of the message). I would like some comment on whether the window.location is needed to redirect back to the server OR is there another way? Also when I select the enter key the whole page refreshes (much like its submitting the main asp.net form).. I have seen this before on other projects but cant think as to why. ON an enter click I see all my alerts but the window URL does not contain GET parameters I pass so I presume there is something else that is posting back the same page and not honouring my window.location code in EditKeyDown. SO at the moment I just have the enter key issue.
Any thoughts would be appreciated as I am nearly there :)
Regards
<script id="igClientScript" type="text/javascript"><!--function WebCombo1_BeforeCloseUp(webComboId){ //Add code to handle your event here. var combo = igcmbo_getComboById(webComboId); if (combo.getDataValue() != null) { window.location ="Test.aspx?displayed=" + combo.getDisplayValue() + "&id="+combo.getDataValue(); }}function WebCombo1_EditKeyDown(webComboId,newValue,keyCode){ if (keyCode == 13) { alert(keyCode); //Add code to handle your event here. var combo = igcmbo_getComboById(webComboId); if (combo.getDataValue() != null) { alert("displayed: "+combo.getDisplayValue()); alert("value: "+combo.getDataValue()); window.location ="Test.aspx?displayed=" + combo.getDisplayValue() + "&id="+combo.getDataValue(); } }}// -->
In this case you'll want to NOT connect the selectedrowchange event, and instead have a separate submit button which is used to trigger your update. You can use the client-side BeforeCloseUp event which will fire after the user clicked on a value, hit the enter key, or clicked outside of the combo - or you can use the EditKeyDown, and look for an enter key press.
-Tony
I have the same problem, the only difference is that I want to select the row typing in the webcombo, using an Editable WebCombo. The SelectedRowChanged event is fired after press the first key, I want to use the enter key to fire the event, or click outside the webcombo.
So I think is the same problem of Richard
Thank in advance
Johni Ecco
Hi Tony
Many thanks for your reply, I had tried the onrowchange server event before but this is fired as the name suggests on every row change. Rather I would like to navigate the record set with arrow keys until I select the record I want, then press carriage return to fire the event. (I also would like to use the mouse to click as well which works at the moment obviously) I wonder if I can cancel postbacks on the client side (will check) if the key press is not carriage return?
If you have any further pointer would be grateful
You'll want to add an event handler for the selectedrowchange event of the webcombo. I think the behavior you're looking for is demontrated in the AgentManagement sample included with the product. Check out this link for the online version of that app. Click in the textbox and type in "ad" and then select an agent from the list. https://ko.infragistics.com/samples/aspnet/data-grid/application-styling