Click here to Skip to main content
15,920,111 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: how to deploy 3-tire architecture(Windows applicaion) Pin
chiranjeevi20079-Jul-08 20:58
chiranjeevi20079-Jul-08 20:58 
QuestionHow to call windows application with parameters using javascript in mozilla Pin
Member 38720758-Jul-08 20:42
Member 38720758-Jul-08 20:42 
AnswerRe: How to call windows application with parameters using javascript in mozilla Pin
Christian Graus9-Jul-08 7:42
protectorChristian Graus9-Jul-08 7:42 
QuestionEditing a record in DataGridView & updating the same in database Pin
aspnet2.developer8-Jul-08 18:08
aspnet2.developer8-Jul-08 18:08 
AnswerRe: Editing a record in DataGridView & updating the same in database Pin
John_Adams8-Jul-08 22:03
John_Adams8-Jul-08 22:03 
QuestionVideo encoding problem Pin
balaji_vbr8-Jul-08 5:58
balaji_vbr8-Jul-08 5:58 
AnswerRe: Video encoding problem Pin
Christian Graus8-Jul-08 6:05
protectorChristian Graus8-Jul-08 6:05 
QuestionDeleting Multiple checked rows from DataGridView with DataGridViewCheckboxColumn Pin
aspnet2.developer7-Jul-08 22:20
aspnet2.developer7-Jul-08 22:20 
Hi,

I am currently working on a demo winforms project which has DataGridView control. I have hardcoded the data (using string arrays) & populated in the DataGridView control.

The DataGridView has first column that contains checkbox.

For deleting, I have taken button control & user needs to check the checkboxes to select the rows & then press delete button.

I have found that when first two rows are selected & then delete button is pressed, only first row gets deleted. Also, I am not able to delete any two consecutive rows properly.

I think when a row is deleted, the index of the remaining rows gets changed & this seems to be the problem. But I am not able to find any solution for the same.

Can any one help me for the same? The code for delete button click is as follows:
<code> private void btnDelete_Click(object sender, EventArgs e)
{
int rowCount = 0;
for (int counter = 0; counter &lt; dgDemoGrid.Rows.Count; counter++)
{
if ((bool)dgDemoGrid.Rows[counter].Cells["colSelect"].FormattedValue)
{
rowCount++;
}
}

if (rowCount &gt; 0)
{
DialogResult response = MessageBox.Show("Are you sure you want to delete selected row(s)?",
"Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2);
if (response == DialogResult.Yes)
{
for (int counter = 0; counter &lt; dgDemoGrid.Rows.Count; counter++)
{
if ((bool)dgDemoGrid.Rows[counter].Cells["colSelect"].FormattedValue)
{
dgDemoGrid.Rows.Remove(dgDemoGrid.Rows[counter]);
}
}
}
}
else
{
MessageBox.Show("Please select row(s) to delete", "Delete Row(s)", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
</code>

HR
AnswerRe: Deleting Multiple checked rows from DataGridView with DataGridViewCheckboxColumn Pin
Ashfield7-Jul-08 23:50
Ashfield7-Jul-08 23:50 
QuestionHow to close the parentwindow without closing child window in windows applications Pin
Member 38720757-Jul-08 20:50
Member 38720757-Jul-08 20:50 
AnswerRe: How to close the parentwindow without closing child window in windows applications Pin
N a v a n e e t h7-Jul-08 23:04
N a v a n e e t h7-Jul-08 23:04 
QuestionIntegrate desktop application with browser??? Pin
Technobizz7-Jul-08 17:53
Technobizz7-Jul-08 17:53 
AnswerRe: Integrate desktop application with browser??? Pin
N a v a n e e t h7-Jul-08 23:06
N a v a n e e t h7-Jul-08 23:06 
QuestionPopulating a treeview on bases of selected node Pin
sam128747-Jul-08 8:14
sam128747-Jul-08 8:14 
QuestionDatabound column doesn't see inherited interface properties Pin
Joby17-Jul-08 6:08
Joby17-Jul-08 6:08 
AnswerRe: Databound column doesn't see inherited interface properties Pin
darkelv7-Jul-08 6:18
darkelv7-Jul-08 6:18 
GeneralRe: Databound column doesn't see inherited interface properties Pin
Joby17-Jul-08 7:50
Joby17-Jul-08 7:50 
GeneralRe: Databound column doesn't see inherited interface properties Pin
Paul Fuller23-Jul-08 9:31
Paul Fuller23-Jul-08 9:31 
GeneralRe: Databound column doesn't see inherited interface properties Pin
Joby124-Jul-08 4:21
Joby124-Jul-08 4:21 
AnswerRe: Databound column doesn't see inherited interface properties Pin
Paul Fuller24-Jul-08 6:15
Paul Fuller24-Jul-08 6:15 
QuestionData-bound DataGridView adds bogus empty row Pin
JustinInGwinnett7-Jul-08 2:47
JustinInGwinnett7-Jul-08 2:47 
Questionhow to stop the UPLOADING a file, or SAVING a file in middle by clicking cancel event. Pin
balaji_vbr6-Jul-08 18:38
balaji_vbr6-Jul-08 18:38 
AnswerRe: how to stop the UPLOADING a file, or SAVING a file in middle by clicking cancel event. Pin
Christian Graus6-Jul-08 18:56
protectorChristian Graus6-Jul-08 18:56 
AnswerRe: how to stop the UPLOADING a file, or SAVING a file in middle by clicking cancel event. Pin
N a v a n e e t h6-Jul-08 19:13
N a v a n e e t h6-Jul-08 19:13 
QuestionCustom DataBinding Question [modified] Pin
David Henry6-Jul-08 10:01
David Henry6-Jul-08 10:01 

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.