We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Determining Selected columns?

Thread ID:

Created:

Updated:

Platform:

Replies:

6449 Aug 13,2003 05:51 AM Aug 13,2003 10:21 AM Windows Forms 4
loading
Tags: GridControl
Tim Jackson
Asked On August 13, 2003 05:51 AM

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

Martin
Replied On August 13, 2003 07:01 AM

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

Tim Jackson
Replied On August 13, 2003 08:53 AM

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 >

Administrator [Syncfusion]
Replied On August 13, 2003 09:20 AM

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

Tim Jackson
Replied On August 13, 2003 10:21 AM

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
> 
>

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;