Home Forums WinForms controls Xceed Grid for WinForms Detail Grid (URGENT)

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #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)

    User (Old forums)
    Member
    Post count: 23064

    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)

    User (Old forums)
    Member
    Post count: 23064

    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)

    User (Old forums)
    Member
    Post count: 23064

    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 following

    Add 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 below

    Private 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 cell

    text += Environment.NewLine
    End If
    Next row

    MsgBox(text)
    End Sub

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

    User (Old forums)
    Member
    Post count: 23064

    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)

    User (Old forums)
    Member
    Post count: 23064

    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 file

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

    User (Old forums)
    Member
    Post count: 23064

    Can you explain it more? I dont understand… Thanks.. I appreciate your help!

    Imported from legacy forums. Posted by peyton (had 346 views)

    User (Old forums)
    Member
    Post count: 23064

    Can you write it in C# Language?

    Imported from legacy forums. Posted by peyton (had 333 views)

    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)

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.