Home › Forums › WinForms controls › Xceed Grid for WinForms › Detail Grid (URGENT)
-
AuthorPosts
-
#14018 |
Guys, how can I access the value of the detail grids???
Please Help!!! Its urgent! Even the Xceed’s support does not reply…. [Moderator’s note: Of course we did not reply yet, standard support is not offered on weekends]
Help!!! Im on a deadline!
Imported from legacy forums. Posted by peyton (had 5414 views)
can you provide more details?
If you have setup a master-detail grid then have you had a look at the master-detail
example that comes xceed grid?I am guessing you populated the grid with a dataset, so you could always filter
or find the rows based on what the user has clicked.Imported from legacy forums. Posted by Soong (had 461 views)
I have populated the master/detail grid with a dataset..
It was all displayed… Now I have a button (SAVE), I want to get all the values in the master/detail grid and save them in a text file or in a database..
The problem is I don;t knwo how to get the values or strings inside the grid…
In .NET’s datagrid si through DataGrid[0,4].ToString right? How about here?
Thanks
Imported from legacy forums. Posted by peyton (had 338 views)
Hi There
I can understand your frustration now….
I tried getting the data and I was expecting that the mouse events would help me
retrieve the data. The mouse events did not respond.
But you can do the followingAdd a button to your form
and when the user clicks the button
get all the data selected data or get a single cell
using the masterDetailGrid.SelectedRows
see belowPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim text As String = String.Empty
Dim row As row
For Each row In masterDetailGrid.SelectedRows
If TypeOf row Is CellRow Then
Dim cell As cell
For Each cell In CType(row, CellRow).Cells
text += cell.Value.ToString() + vbTab
Next celltext += Environment.NewLine
End If
Next rowMsgBox(text)
End SubImported from legacy forums. Posted by Soong (had 592 views)
Do you know how to select ALL rows or get the values of ALL rows??
Imported from legacy forums. Posted by peyton (had 408 views)
replace masterDetailGrid.SelectedRows
with masterDetailGrid.DataRows
If you required the whole dataset,
would it not be faster to traverse the ADO dataset?
and dump this to a fileImported from legacy forums. Posted by Soong (had 470 views)
Can you explain it more? I dont understand… Thanks.. I appreciate your help!
Imported from legacy forums. Posted by peyton (had 346 views)
Can you write it in C# Language?
Imported from legacy forums. Posted by peyton (had 333 views)
I am not a C# programmer
but it would be something like thisprivate 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)
-
AuthorPosts
- You must be logged in to reply to this topic.