Click here to Skip to main content
15,920,030 members
Home / Discussions / C#
   

C#

 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Gerry Schmitz30-Jan-21 12:29
mveGerry Schmitz30-Jan-21 12:29 
AnswerRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
Ralf Meier29-Jan-21 23:25
mveRalf Meier29-Jan-21 23:25 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
OriginalGriff29-Jan-21 23:57
mveOriginalGriff29-Jan-21 23:57 
GeneralRe: What queuing technique and GUI component should I choose for my multi-comport, receive-only terminal software? Pin
arnold_w30-Jan-21 0:40
arnold_w30-Jan-21 0:40 
AnswerRe: multi-comport receiver Pin
Luc Pattyn31-Jan-21 4:35
sitebuilderLuc Pattyn31-Jan-21 4:35 
QuestionWrite Async Method Pin
Kevin Marois27-Jan-21 6:37
professionalKevin Marois27-Jan-21 6:37 
AnswerRe: Write Async Method Pin
OriginalGriff27-Jan-21 8:07
mveOriginalGriff27-Jan-21 8:07 
GeneralRe: Write Async Method Pin
Kevin Marois27-Jan-21 8:37
professionalKevin Marois27-Jan-21 8:37 
GeneralRe: Write Async Method Pin
Victor Nijegorodov27-Jan-21 11:16
Victor Nijegorodov27-Jan-21 11:16 
GeneralRe: Write Async Method Pin
Pete O'Hanlon27-Jan-21 21:28
mvePete O'Hanlon27-Jan-21 21:28 
GeneralRe: Write Async Method Pin
Victor Nijegorodov27-Jan-21 22:35
Victor Nijegorodov27-Jan-21 22:35 
GeneralRe: Write Async Method Pin
Gerry Schmitz28-Jan-21 14:57
mveGerry Schmitz28-Jan-21 14:57 
AnswerRe: Write Async Method Pin
Richard Deeming27-Jan-21 21:46
mveRichard Deeming27-Jan-21 21:46 
GeneralRe: Write Async Method Pin
Kevin Marois28-Jan-21 6:27
professionalKevin Marois28-Jan-21 6:27 
GeneralRe: Write Async Method Pin
Kevin Marois28-Jan-21 7:53
professionalKevin Marois28-Jan-21 7:53 
GeneralRe: Write Async Method Pin
Richard Deeming28-Jan-21 22:10
mveRichard Deeming28-Jan-21 22:10 
GeneralRe: Write Async Method Pin
Kevin Marois29-Jan-21 9:12
professionalKevin Marois29-Jan-21 9:12 
GeneralRe: Write Async Method Pin
Richard Deeming31-Jan-21 22:05
mveRichard Deeming31-Jan-21 22:05 
GeneralRe: Write Async Method Pin
Kevin Marois31-Jan-21 22:36
professionalKevin Marois31-Jan-21 22:36 
GeneralRe: Write Async Method Pin
Richard Deeming1-Feb-21 0:02
mveRichard Deeming1-Feb-21 0:02 
GeneralRe: Write Async Method Pin
Kevin Marois1-Feb-21 8:36
professionalKevin Marois1-Feb-21 8:36 
GeneralRe: Write Async Method Pin
Richard Deeming1-Feb-21 21:20
mveRichard Deeming1-Feb-21 21:20 
QuestionHow to update members of a List using Linq? [Solved] Pin
Alex Dunlop26-Jan-21 23:54
Alex Dunlop26-Jan-21 23:54 
AnswerRe: How to update members of a List using Linq? Pin
OriginalGriff27-Jan-21 0:15
mveOriginalGriff27-Jan-21 0:15 
GeneralRe: How to update members of a List using Linq? Pin
Alex Dunlop27-Jan-21 2:15
Alex Dunlop27-Jan-21 2:15 
I tried to ask a simplified mode of my problem. Let's explain it. I want to delete empty rows in DevExpress Spreadsheet by code. I tried this:
C#
IWorkbook workbook = spreadsheetControl.Document;
           Worksheet worksheet = workbook.Worksheets["Sheet1"];
           CellRange range = worksheet.GetUsedRange();
           int LastRow = range.BottomRowIndex;

           List<int> emptyRows = new List<int>();
           for (int i = 0; i < LastRow+1; i++)
           {
               if (worksheet.Cells[i, 0].Value.IsEmpty == true)
               {
                   emptyRows.Add(i);
               }
           }

           Search:
           if (emptyRows.Count >= 1)
           {
               foreach (var item in emptyRows)
               {
                   worksheet.Rows[item].Delete();
                   emptyRows.RemoveAt(item);
                   goto Update;
               }
           }

           Update:
           if (emptyRows.Count >= 1)
           {
               for (int i = 0; i < emptyRows.Count; i++)
               {
                   emptyRows[i] = emptyRows[i]-1;
                   //MessageBox.Show(Convert.ToString(emptyRows[i]));
               }
               goto Search;
           }

In the code above, I try to list empty rows. Then, I delete them based on the created list of Row Indexes. The problem is that each time a row is deleted, other empty row indexes are changed (row-1). I need to find a way to subtract each item in the list by 1 in each iteration. The second solution is to select empty rows and delete them at once. I couldn't use the second way too. Because, I don't know how to do multiple selection by code. Please help me.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.