Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:11:03+00:00 2026-05-26T01:11:03+00:00

I’m using the Infragistics UltraWinGrid to present some data. I need some Excel copy/paste

  • 0

I’m using the Infragistics UltraWinGrid to present some data. I need some Excel copy/paste functionality. That’s the easy bit.

  1. What I want to do is determine the shape of the selection, and ensure it’s a rectangle of adjacent cells. If it’s not, an error is to be shown (as pasting said data will just lead to errors).

  2. I then need to detect all the boundary edge cells so I can put a “you’ve copied this” border around the cells, ala Excel.

I’m hoping to achieve this by comparing a list of Point structures or something along those lines.

To illustrate the problem better, here are some pictures:

Working image

1. This is fine, see the edge cells (duh)

Fail image]

2. This won’t work, I’ve tried to copy too much, show an error

Another fail image

3. The user hasn’t learnt by now that this just won’t work. You can even see where I’ve copied the “wrong” cell out of sheer lazyness.

I’ve got a Dictionary of Points and Cells, ready to work with. Any ideas? C#/VB is fine.

UPDATE:
This might help?

Taking the second diagram:

0,0 1,0 2,0
0,1 1,1 2,1
0,2 1,2 2,2
0,3 1,3 2,3
    1,4     <<< wrong

Thanks, Tom

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:11:04+00:00Added an answer on May 26, 2026 at 1:11 am

    Ok I’ve had a good think about this and GertArnold has pointed me in the right direction, simply by saying “range of cells with a hole in it allowed?”

    This is what happens when you spend 6 months not coding or problem solving, due to massive paperwork and auditing requirements, you forget how to even begin a simple algorithm.

    It’s so easy it hurts. Firstly I get the cells from the datasheet and reformat them so they’re based at zero (as opposed to their actual position on the grid). I do this by simply negating the value of the cell at {0,0} and applying this to all the cells.

    To calculate the gaps, do this:

    Private Function HasGapsInCells(points As List(Of CellPoint)) As Boolean
    
        Dim colCount As Integer = points.GroupBy(Function(x) x.Column).Count()
        Dim rowCount As Integer = points.GroupBy(Function(x) x.Row).Count()
    
        For row As Integer = 0 To rowCount - 1
            Dim rowL As Integer = row
            For col As Integer = 0 To colCount - 1
                Dim colL As Integer = col
                If Not points.Exists(Function(x) x.Row = rowL And x.Column = colL) Then
                    Return True '-- There are gaps'
                End If
            Next
        Next
    
        Return False
    
    End Function
    

    So easy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I have thousands of HTML files to process using Groovy/Java and I need to
I need a function that will clean a strings' special characters. I do NOT
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.