PC Review


Reply
Thread Tools Rate Thread

DataGrid KeyDown and MouseDown Events and AllowSorting Property

 
 
Chuck Kosy
Guest
Posts: n/a
 
      10th Dec 2003
I'm trying to implement a lookup function via the F2 key
when pressed in data cells in selected columns of a
DataGrid. I'm also trying to implement the same lookup
function via a right-click of the mouse in a data cell of
the DataGrid.

I have KeyPreview set to True on the form. When anything
is keyed into a cell, the form's KeyDown event does not
fire nor does the DataGrid's KeyDown event fire. Is there
something I'm missing or is there a workaround that
doesn't involve a third-party data grid?

If I right-click a cell in the DataGrid, the MouseDown
event of the DataGrid does not fire. However, if I right-
click the header line, the MouseDown event does fire. Is
there something I'm missing here or is there a workaround?

I've set AllowSorting to False in the designer for the
DataGrid. In the form's Load routine, I customize the
DataGrid and again attempt to set the AllowSorting
property to False. The DataGrid still allows column
sorting when a column in the header line is left-clicked.
Is this property supposed to work or am I doing something
wrong?

Thanks.

Chuck
 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      11th Dec 2003
Hi,

1) http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q836q

2) If you added a tablestyle to your grid set the allowsorting property of
the tablestyle.

Ken
--------------------
"Chuck Kosy" <(E-Mail Removed)> wrote in message
news:1114701c3bf39$ebed62b0$(E-Mail Removed)...
> I'm trying to implement a lookup function via the F2 key
> when pressed in data cells in selected columns of a
> DataGrid. I'm also trying to implement the same lookup
> function via a right-click of the mouse in a data cell of
> the DataGrid.
>
> I have KeyPreview set to True on the form. When anything
> is keyed into a cell, the form's KeyDown event does not
> fire nor does the DataGrid's KeyDown event fire. Is there
> something I'm missing or is there a workaround that
> doesn't involve a third-party data grid?
>
> If I right-click a cell in the DataGrid, the MouseDown
> event of the DataGrid does not fire. However, if I right-
> click the header line, the MouseDown event does fire. Is
> there something I'm missing here or is there a workaround?
>
> I've set AllowSorting to False in the designer for the
> DataGrid. In the form's Load routine, I customize the
> DataGrid and again attempt to set the AllowSorting
> property to False. The DataGrid still allows column
> sorting when a column in the header line is left-clicked.
> Is this property supposed to work or am I doing something
> wrong?
>
> Thanks.
>
> Chuck



 
Reply With Quote
 
Guest
Posts: n/a
 
      16th Dec 2003
Thanks, Ken. I'll look forward to Microsoft's new
DataGrid in the next release.

Chuck

>-----Original Message-----
>Hi,
>
>1)

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q836q
>
>2) If you added a tablestyle to your grid set the

allowsorting property of
>the tablestyle.
>
>Ken
>--------------------
>"Chuck Kosy" <(E-Mail Removed)> wrote in

message
>news:1114701c3bf39$ebed62b0$(E-Mail Removed)...
>> I'm trying to implement a lookup function via the F2

key
>> when pressed in data cells in selected columns of a
>> DataGrid. I'm also trying to implement the same lookup
>> function via a right-click of the mouse in a data cell

of
>> the DataGrid.
>>
>> I have KeyPreview set to True on the form. When

anything
>> is keyed into a cell, the form's KeyDown event does not
>> fire nor does the DataGrid's KeyDown event fire. Is

there
>> something I'm missing or is there a workaround that
>> doesn't involve a third-party data grid?
>>
>> If I right-click a cell in the DataGrid, the MouseDown
>> event of the DataGrid does not fire. However, if I

right-
>> click the header line, the MouseDown event does fire.

Is
>> there something I'm missing here or is there a

workaround?
>>
>> I've set AllowSorting to False in the designer for the
>> DataGrid. In the form's Load routine, I customize the
>> DataGrid and again attempt to set the AllowSorting
>> property to False. The DataGrid still allows column
>> sorting when a column in the header line is left-

clicked.
>> Is this property supposed to work or am I doing

something
>> wrong?
>>
>> Thanks.
>>
>> Chuck

>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid AllowSorting property Carl Tribble Microsoft VB .NET 2 9th Oct 2004 09:37 PM
MouseDown and Keydown Atchoum Microsoft VB .NET 0 26th Sep 2004 05:24 PM
AllowSorting in datagrid Jason Microsoft ADO .NET 3 8th Sep 2004 10:28 PM
Keyup, KeyDown, and KeyPress events for a datagrid do not work. URGENT!!!! Chris Calhoun Microsoft C# .NET 2 10th Oct 2003 10:21 PM
DataGrid.AllowSorting Maurizio BELLANTONE Microsoft VB .NET 3 6th Sep 2003 06:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 AM.