rickarde Posted September 13, 2004 Posted September 13, 2004 Hi! I'm wondering in which order things occur when: - clicking different rows in a datagrid - moving the "selected" row in a datagrid I guess it's something like this: keyDown/mouseDown currentCellChanged keyUp/mouseUp The thing is, I'm actually curious to find out exactly where a row gets selected, not having implemented any extended features in the scenario. I'm into creating a datagrid which rows gets fully selected, and not just the text in the text boxes. I'm almost there, and the answer to this question will make me through... /Rickard Quote
Gladimir Posted September 13, 2004 Posted September 13, 2004 The thing is' date=' I'm actually curious to find out [b']exactly where a row gets selected[/b], not having implemented any extended features in the scenario. I'm into creating a datagrid which rows gets fully selected, and not just the text in the text boxes. I'm almost there, and the answer to this question will make me through... I think you can just use the DataGrid.Select method in the CurrentCellChanged event. For example: [color=Blue]private void[/color] dataGrid1_CurrentCellChanged([color=Blue]object[/color] sender, System.EventArgs e) { [color=Blue]int[/color] rowIndex = dataGrid1.CurrentRowIndex; dataGrid1.Select(rowIndex); } Quote Never ascribe to malice that which is adequately explained by incompetence. - Napoleon Bonaparte
rickarde Posted September 14, 2004 Author Posted September 14, 2004 Thanx for your reply but... I think you can just use the DataGrid.Select method in the CurrentCellChanged event. For example: [color=Blue]private void[/color] dataGrid1_CurrentCellChanged([color=Blue]object[/color] sender, System.EventArgs e) { [color=Blue]int[/color] rowIndex = dataGrid1.CurrentRowIndex; dataGrid1.Select(rowIndex); } I've played with this for a while and one thing I've come up to is to remove all editable controls in the datagrid (not the scrollbars though) and this makes the entire row selected (since I only use grid to show data, not to enter data). But my task right now is to make the grid work like a standard window list - e.g. MS Outlook "message list"... This means I have to handle control/shift click, using arrows (with shift/controol also) and combinations of them... /Rickard 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.