Click here to Skip to main content
14,768,146 members
Home » Discussions » C#
   

C#

 
GeneralRe: Write Async Method Pin
Richard Deeming31-Jan-21 23:05
mveRichard Deeming31-Jan-21 23:05 
GeneralRe: Write Async Method Pin
Kevin Marois31-Jan-21 23:36
professionalKevin Marois31-Jan-21 23:36 
GeneralRe: Write Async Method Pin
Richard Deeming1-Feb-21 1:02
mveRichard Deeming1-Feb-21 1:02 
GeneralRe: Write Async Method Pin
Kevin Marois1-Feb-21 9:36
professionalKevin Marois1-Feb-21 9:36 
GeneralRe: Write Async Method Pin
Richard Deeming1-Feb-21 22:20
mveRichard Deeming1-Feb-21 22:20 
QuestionHow to update members of a List using Linq? [Solved] Pin
Alex Dunlop27-Jan-21 0:54
MemberAlex Dunlop27-Jan-21 0:54 
AnswerRe: How to update members of a List using Linq? Pin
OriginalGriff27-Jan-21 1:15
mveOriginalGriff27-Jan-21 1:15 
GeneralRe: How to update members of a List using Linq? Pin
Alex Dunlop27-Jan-21 3:15
MemberAlex Dunlop27-Jan-21 3: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:
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.
GeneralRe: How to update members of a List using Linq? Pin
OriginalGriff27-Jan-21 3:36
mveOriginalGriff27-Jan-21 3:36 
GeneralRe: How to update members of a List using Linq? Pin
Alex Dunlop27-Jan-21 4:04
MemberAlex Dunlop27-Jan-21 4:04 
GeneralRe: How to update members of a List using Linq? Pin
Richard Deeming27-Jan-21 5:10
mveRichard Deeming27-Jan-21 5:10 
GeneralRe: How to update members of a List using Linq? Pin
Dave Kreskowiak27-Jan-21 8:06
mveDave Kreskowiak27-Jan-21 8:06 
QuestionProper event handling in docked window schema Pin
gizbernus26-Jan-21 10:16
Membergizbernus26-Jan-21 10:16 
Questionalias names for Column in Linq Pin
simpledeveloper25-Jan-21 9:28
Membersimpledeveloper25-Jan-21 9:28 
AnswerRe: alias names for Column in Linq Pin
Gerry Schmitz25-Jan-21 11:18
mveGerry Schmitz25-Jan-21 11:18 
AnswerRe: alias names for Column in Linq Pin
Richard Deeming25-Jan-21 22:38
mveRichard Deeming25-Jan-21 22:38 
Questionhow to print POS bills with a thermal printer Pin
Meax24-Jan-21 9:53
MemberMeax24-Jan-21 9:53 
AnswerRe: how to print POS bills with a thermal printer Pin
Daniel Pfeffer24-Jan-21 10:23
professionalDaniel Pfeffer24-Jan-21 10:23 
GeneralRe: how to print POS bills with a thermal printer Pin
OriginalGriff24-Jan-21 11:25
mveOriginalGriff24-Jan-21 11:25 
AnswerRe: how to print POS bills with a thermal printer Pin
OriginalGriff24-Jan-21 11:26
mveOriginalGriff24-Jan-21 11:26 
QuestionRuntime error in PivotGridControl data binding [Solved] Pin
Alex Dunlop21-Jan-21 9:48
MemberAlex Dunlop21-Jan-21 9:48 
AnswerRe: Runtime error in PivotGridControl data binding Pin
Gerry Schmitz21-Jan-21 10:02
mveGerry Schmitz21-Jan-21 10:02 
AnswerRe: Runtime error in PivotGridControl data binding Pin
Richard Deeming21-Jan-21 23:05
mveRichard Deeming21-Jan-21 23:05 
AnswerRe: Runtime error in PivotGridControl data binding Pin
OriginalGriff21-Jan-21 23:22
mveOriginalGriff21-Jan-21 23:22 
GeneralRe: Runtime error in PivotGridControl data binding Pin
Alex Dunlop21-Jan-21 23:44
MemberAlex Dunlop21-Jan-21 23:44 

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.