thomas10001 Posted July 23, 2003 Posted July 23, 2003 I need to catch the KeyUp event in my column which is in a DataGrid. I am only able to catch the KeyPress event or TextChanged event which I have successfully attached to each of my columns (DataGridTextBox.TextBox) in the DataGrid. What can be wrong with catching KeyUp? Is it something that catches this event instead of my target? Quote
karimgarza Posted July 24, 2003 Posted July 24, 2003 thomas, To handle keyboard events only at the form level and not allow other controls to receive keyboard events, set the KeyPressEventArgs.Handled property in your form's KeyPress event-handling method to true. Certain keys, such as the TAB, RETURN, ESCAPE, and arrow keys are handled by controls automatically. In order to have these keys raise the KeyDown event, you must override the IsInputKey method in each control on your form. The code for the override of the IsInputKey would need to determine if one of the special keys is pressed and return a value of true. checkout the following link http://www.codeproject.com/cs/miscctrl/dotnetcolorpicker.asp search for how to override the IsInputKey Quote You're either a one or a zero. Alive or dead.
thomas10001 Posted July 25, 2003 Author Posted July 25, 2003 I am able to catch KeyDown too. But cant catch KeyUp for some reason. Quote
Susana Posted July 31, 2003 Posted July 31, 2003 Good day Thomas10001, How do you catch the itemchange of a column in the datagrid? The scenario is I have a dropdownlistbox column and beside it is a textbox whose value is dependent on the selected value in the dropdownlistbox. These two fields are contained in a datagrid. Could you help me? You said on your first thread that you are able to catch the TextChanged event. This might help me in my problem. Could you give me a sample code for this? Thanks. :) Quote
thomas10001 Posted July 31, 2003 Author Posted July 31, 2003 Sorry I dont have the code available at this computer. But its easy to do if you do it in the design mode. Select your listbox and click on the events button in the property window. Then find the TextChanged event and enter a name for the method that (will be created) called when TextChanged occurs. Quote
Susana Posted August 18, 2003 Posted August 18, 2003 Thanks. But my project is in Net so I didn't find the events button in th property window. But what I did was to make a public sub event: example uf_changed() and called it in the html code like this: <asp:DropDownList id="ddlrano" tabIndex="2" runat="server" Width="80px" AutoPostBack="True" OnSelectedIndexChanged="uf_changed"></asp:DropDownList> This now works. Thanks. :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.