Select All

Posts   
 
    
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 13-Jun-2004 15:42:11   

In a number of places a list of catalog objects are presented to the user. The selection check boxes are all check and there is a button to toggle selected rows.

Since my database has tons of items I'm not going to use I first have to select all the items (It seems the grid may not always display the first row, so I have to make sure I am at the top of the grid) select the first row on the screen go to the bottom of the grid and shift click on the last row, the press the toggle button.

Could you add select all, deselect all, and reverse select tion buttons (and key shortcuts)?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 14-Jun-2004 09:07:34   

It's not an action you're going to repeat a lot of times I think. In the GUI, cntrl-A is the keycombination you can use to select all.

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 14-Jun-2004 14:02:07   

Thanks, I was missing the select all. That should meet my needs.

mdisbrow
User
Posts: 31
Joined: 22-Jun-2004
# Posted on: 30-Jun-2004 15:44:03   

In the latest version of the designer... Ctrl+A no longer works to select all entries in the grid... is there a way to select all of the rows in the grids?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 30-Jun-2004 18:51:51   

mdisbrow wrote:

In the latest version of the designer... Ctrl+A no longer works to select all entries in the grid... is there a way to select all of the rows in the grids?

Select the first row, press shift and select the bottom row. All rows are now selected. Cntrl-A is not available, as infragistics grids do not support that and I couldn't work around it with a reliable routine.

Frans Bouma | Lead developer LLBLGen Pro
jtgooding
User
Posts: 126
Joined: 26-Apr-2004
# Posted on: 10-Aug-2004 17:27:17   

I know this is probably minor in the grand scheme of things but this is the number one moaning item I get at work about the designer =/

Can you either:

1) Default to not selecting everything, selecting everything might be convienent for someone with 10 tables and 20 stored procs, but our smaller databases have 1500 tables and many more thousand stored procs, views, etc.

2) Here is some sample code to do select all, its written in VB.NET only because its what the samples from Infragistics came in with their trial version and I'm to lazy to rewrite it /grin. I can't find an instance where this doesn't work, we reviewed Infragistics as well when we decided to move off ComponentOne and found their feature set to be lacking as well.

Private Sub UltraGrid1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles UltraGrid1.KeyPress
    If e.KeyChar = Chr(1) Then
        SelectAll()
    End If
End Sub

' obviously this could be called from a button but I bound it to CTRL-A for the grid alone
' in a full featured app i would pass in the grid to make this re-usable instead of hard coding
Private Sub SelectAll()
    Dim intRow As Integer
    Dim gridRow As Infragistics.Win.UltraWinGrid.UltraGridRow

    ' Clear any current selections
    UltraGrid1.Selected.Rows.Clear()
    ' loop through and select all elements only for top level band
    For intRow = 0 To UltraGrid1.Rows.Count - 1
        gridRow = UltraGrid1.Rows(intRow)
        If gridRow.Band.Index = 0 Then
            gridRow.Selected = True
        End If
    Next intRow
End Sub
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 11-Aug-2004 09:29:40   

jtgooding wrote:

I know this is probably minor in the grand scheme of things but this is the number one moaning item I get at work about the designer =/

Can you either:

1) Default to not selecting everything, selecting everything might be convienent for someone with 10 tables and 20 stored procs, but our smaller databases have 1500 tables and many more thousand stored procs, views, etc.

Hmmm, then it is indeed a burden. I'll try to fix this.

2) Here is some sample code to do select all, its written in VB.NET only because its what the samples from Infragistics came in with their trial version and I'm to lazy to rewrite it /grin. I can't find an instance where this doesn't work, we reviewed Infragistics as well when we decided to move off ComponentOne and found their feature set to be lacking as well.

Private Sub UltraGrid1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles UltraGrid1.KeyPress
    If e.KeyChar = Chr(1) Then
        SelectAll()
    End If
End Sub



' obviously this could be called from a button but I bound it to CTRL-A for the grid alone
' in a full featured app i would pass in the grid to make this re-usable instead of hard coding
Private Sub SelectAll()
    Dim intRow As Integer
    Dim gridRow As Infragistics.Win.UltraWinGrid.UltraGridRow

    ' Clear any current selections
    UltraGrid1.Selected.Rows.Clear()
    ' loop through and select all elements only for top level band
    For intRow = 0 To UltraGrid1.Rows.Count - 1
        gridRow = UltraGrid1.Rows(intRow)
        If gridRow.Band.Index = 0 Then
            gridRow.Selected = True
        End If
    Next intRow
End Sub

I tried similar code, but I couldn't get it to work properly as the focus wasn't always on the object reacting to contrl-A. I'll add buttons which will selectall/none. Btw, walking through a long list in a gridcontrol can be slow, sadly enough, according to infragistics. In the future (before end of the year) all infragistics controls will be removed btw and will be replaced by Janus Systems windows controls.

Frans Bouma | Lead developer LLBLGen Pro
jtgooding
User
Posts: 126
Joined: 26-Apr-2004
# Posted on: 11-Aug-2004 14:36:13   

Like I said its small in the grand scheme of things, people here would be happy with just the option of it not selecting everything by default, most are LLBLGen projects are 10-20 table projects but our list of tables is well over 1500, and when doing initial work on a project its fairly common to go into the same project multiple times a day to do tweaks so it becomes an annoyance.

btw your issue with focus can be solved like this...

goto your form and turn on keypreview property

in your form wire the form KeyPress event


Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
        If e.KeyChar = Chr(1) Then
            SelectAll()
            e.Handled = True ' eats the event so its not triggered for controls on the form
        End If
    End Sub

this will trap ctrl-a for the entire form, in the event you could check what control has focus and decide to honor or ignore ctrl-a for a form that had multiple places where ctrl-a should work, but on the form in question it should work since there isn't another place to use ctrl-a on the form.

Hope that helps

John Gooding

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 11-Aug-2004 15:19:47   

Thanks for the info, John. I'll try to add it as soon as possible. At the moment the last features for the runtime lib upgrade are implemented, once beta starts some fixes in the gui are scheduled (small fixes) and I'll fix this too then.

Frans Bouma | Lead developer LLBLGen Pro