Home Forums WinForms controls Xceed Grid for WinForms Detail Grid (URGENT) Reply To: Detail Grid (URGENT)

User (Old forums)
Member
Post count: 23064

I am not a C# programmer
but it would be something like this

private void Button1_Click(object sender, System.EventArgs e)
{
string text = string.Empty;
foreach (row thisrow in masterDetailGrid.datarows) {
if (thisrow is CellRow) {
foreach (cell thiscell in ((CellRow)(thisrow)).Cells) {
text += thiscell.Value.ToString() + vbTab;
}
text += Environment.NewLine;
}
}
MsgBox(text);
}

OR

DataSet ds;
string sOut = “”;
foreach (System.Data.DataTable dt in ds.Tables) {
foreach (System.Data.DataRow row in dt.Rows) {
for (int i = 0; i <= dt.Columns.Count – 1; i++) {
sOut += row.Item(i) + “,”;
}
sOut += vbCrLf;
}
}

Imported from legacy forums. Posted by Soong (had 6628 views)