Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
AnswerRe: Arabic Pin
Mohammad Dayyan26-Jul-09 19:47
Mohammad Dayyan26-Jul-09 19:47 
Questioncode 4 random number without repeating number in a row . Pin
OLUMADE26-Jul-09 11:48
OLUMADE26-Jul-09 11:48 
AnswerRe: code 4 random number without repeating number in a row . Pin
Christian Graus26-Jul-09 12:11
protectorChristian Graus26-Jul-09 12:11 
AnswerRe: code 4 random number without repeating number in a row . [modified] Pin
PIEBALDconsult26-Jul-09 12:42
mvePIEBALDconsult26-Jul-09 12:42 
QuestionUnicode Pin
hadad26-Jul-09 4:03
hadad26-Jul-09 4:03 
AnswerRe: Unicode Pin
Manas Bhardwaj26-Jul-09 4:16
professionalManas Bhardwaj26-Jul-09 4:16 
AnswerRe: Unicode Pin
harold aptroot26-Jul-09 4:48
harold aptroot26-Jul-09 4:48 
QuestionC# datagridview display Question Pin
spankyleo12326-Jul-09 3:26
spankyleo12326-Jul-09 3:26 
My Question,

I have designed FORM1 with a datagridview dgvForm1 and am populating data into it using LINQ queries. The data is populating fine into the dgvForm1.

I have a checkbox column in the dgvForm1 to select the checked rows.

I have a button in FORM1 called DISPLAY.

I have FORM2 with datagridview dgvForm2.


All I want to do is ...allow the user to select the required rows from dgvForm1 using checkboxs. After selecting, the user clicks on the DISPLAY which will show FORM2 . I want to display the selected rows from dgvForm1 in the datagridview(dgvForm2) of FORM2.

Am using C# with VS 2008 , this my code for reading the checked value of rows,,,, I have defined a constructor in Form2 to take in string values. Then in form2 initialization am assigning the string value to datagridview2 in form 2.. Am not sure if its correct to do so ..... but am not getting the required result.i.e my datagrid2 is not getting populate with the checked rows from datagrid1. please suggest solutions,,,thanks


string<br />
<br />
data = string.Empty;<br />
//data = this<br />
foreach (DataGridViewRow row in dataGridView1.Rows<br />
{<br />
if (row.Cells[SelectColumnIndex].Value != null &&<br />
Convert.ToBoolean(row.Cells[SelectColumnIndex].Value) == true)<br />
{<br />
foreach (DataGridViewCell cell in row.Cells)<br />
{<br />
if (cell.OwningColumn.Index != SelectColumnIndex)<br />
{<br />
data += (cell.Value + ","); <br />
}<br />
}<br />
data += "\n";<br />
}<br />
}<br />
Form2 fm = new Form2(data);<br />
fm.Show();<br />
<br />
}<br />
<br />
<br />
public Form2(String data) <br />
<br />
{<br />
<br />
InitializeComponent();<br />
<br />
this.dgv1Fm2.DataSource = data; <br />
<br />
 <br />
<br />
 <br />
<br />
}<br />
<br />

AnswerRe: C# datagridview display Question Pin
Henry Minute26-Jul-09 3:45
Henry Minute26-Jul-09 3:45 
GeneralRe: C# datagridview display Question Pin
spankyleo12326-Jul-09 4:29
spankyleo12326-Jul-09 4:29 
GeneralRe: C# datagridview display Question Pin
Henry Minute26-Jul-09 4:46
Henry Minute26-Jul-09 4:46 
QuestionTaking screenshots from DirectX Games Pin
SimpleData26-Jul-09 2:55
SimpleData26-Jul-09 2:55 
QuestionInsert Obejct to sorted list Pin
bonzaiholding26-Jul-09 2:44
bonzaiholding26-Jul-09 2:44 
AnswerRe: Insert Obejct to sorted list [modified] Pin
PIEBALDconsult26-Jul-09 4:39
mvePIEBALDconsult26-Jul-09 4:39 
GeneralRe: Insert Obejct to sorted list Pin
bonzaiholding26-Jul-09 6:15
bonzaiholding26-Jul-09 6:15 
GeneralRe: Insert Obejct to sorted list Pin
PIEBALDconsult26-Jul-09 6:26
mvePIEBALDconsult26-Jul-09 6:26 
GeneralRe: Insert Obejct to sorted list [modified] Pin
bonzaiholding26-Jul-09 6:31
bonzaiholding26-Jul-09 6:31 
GeneralRe: Insert Obejct to sorted list Pin
PIEBALDconsult26-Jul-09 6:51
mvePIEBALDconsult26-Jul-09 6:51 
GeneralRe: Insert Obejct to sorted list Pin
bonzaiholding26-Jul-09 20:39
bonzaiholding26-Jul-09 20:39 
GeneralRe: Insert Obejct to sorted list Pin
Luc Pattyn26-Jul-09 11:32
sitebuilderLuc Pattyn26-Jul-09 11:32 
GeneralRe: Insert Obejct to sorted list Pin
PIEBALDconsult26-Jul-09 14:49
mvePIEBALDconsult26-Jul-09 14:49 
AnswerRe: Insert Obejct to sorted list Pin
Martijn Boeker26-Jul-09 21:55
Martijn Boeker26-Jul-09 21:55 
GeneralRe: Insert Obejct to sorted list Pin
bonzaiholding26-Jul-09 22:40
bonzaiholding26-Jul-09 22:40 
GeneralRe: Insert Obejct to sorted list Pin
Martijn Boeker27-Jul-09 9:19
Martijn Boeker27-Jul-09 9:19 
Generalreality check Pin
Luc Pattyn27-Jul-09 10:47
sitebuilderLuc Pattyn27-Jul-09 10:47 

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.