Determining Selected columns?

Is there a SINGLE collection where I can get ALL the columns selected on a grid? It looks like there are objects that give me the columns from each selected range, but I cannot find just a single collection of the selected columns. Any suggestions? I am doing this in VB.NET. Thank you very much in advance. Tim

4 Replies

MA Martin August 13, 2003 11:01 AM UTC

I've done something like this in C#, what I think you need is... GridRangeInfoList colRangeInfo = gridControl.Selections.GetSelectedCols(true, false); Martin > Is there a SINGLE collection where I can > get ALL the columns selected on a grid? > It looks like there are objects that give > me the columns from each selected range, but > I cannot find just a single collection of > the selected columns. Any suggestions? > > > I am doing this in VB.NET. Thank you very > much in advance. > > Tim


TJ Tim Jackson August 13, 2003 12:53 PM UTC

When I use this method I get nothing in the returned object. No collections, no lists, bupkes. Just so I know I aint crazy what syntax are you using to get at the returned column collection? thanks again. > I've done something like this in C#, what I think you need is... > > GridRangeInfoList colRangeInfo = gridControl.Selections.GetSelectedCols(true, false); > > Martin > > > > > Is there a SINGLE collection where I can > > get ALL the columns selected on a grid? > > It looks like there are objects that give > > me the columns from each selected range, but > > I cannot find just a single collection of > > the selected columns. Any suggestions? > > > > > > I am doing this in VB.NET. Thank you very > > much in advance. > > > > Tim >


AD Administrator Syncfusion Team August 13, 2003 01:20 PM UTC

Attached is a little sample. Here is some code.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim colList As GridRangeInfoList = Me.GridControl1.Selections.GetSelectedCols(True, False)
        Dim s As String = "Colums selected:"
        If colList.Count = 0 Then
            s = s + "none"
        Else
            Dim range As GridRangeInfo
            For Each range In colList
                Dim j As Integer
                For j = range.Left To range.Right
                    s = s + "  " + j.ToString()
                Next
            Next
        End If
        Me.Label1.Text = s
    End Sub


TJ Tim Jackson August 13, 2003 02:21 PM UTC

Thank you! I will look at this. I think part of my problem is that since I have AllowSelection to be Any I have to look at the selection type. I thought I was selecting columns but upon forther inspection the selectiontype being returned is 'cell' and not 'column' hrmph. NOTHING is simple. :) Tim > Attached is a little sample. Here is some code. > >
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
>         Dim colList As GridRangeInfoList = Me.GridControl1.Selections.GetSelectedCols(True, False)
>         Dim s As String = "Colums selected:"
>         If colList.Count = 0 Then
>             s = s + "none"
>         Else
>             Dim range As GridRangeInfo
>             For Each range In colList
>                 Dim j As Integer
>                 For j = range.Left To range.Right
>                     s = s + "  " + j.ToString()
>                 Next
>             Next
>         End If
>         Me.Label1.Text = s
>     End Sub
> 
>

Loader.
Up arrow icon