IDataStore.GetChild(string name, out IDataStore child) Method
.NET Standard 2.x
Provides a reference to the DataWindowChild
, which you can use to manipulate that DataStore.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
public bool GetChild(string name, out IDataStore child);
Parameters
name
System.String
A string which is the name of the column containing the DataWindowChild
.
child
DWNet.Data.IDataStore
The reference to the DataWindowChild
.
Returns
System.Boolean
Returns true
if it succeeds.
Examples
The following code example demonstrates how to get the DataWindowChild
in the specified column.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDataStoreExamples
{
public class GetChildExample
{
private readonly SchoolContext _context;
public GetChildExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example2()
{
// Instantiates a DataStore object with datawindow: d_course.
var datastore = new DataStore("d_course", _context);
datastore.Retrieve();
// The departmentid column has a DropDownDataWindow: dddw_deparment.
var department = datastore.GetChild("departmentid", out IDataStore child);
Console.WriteLine("DataWindowChild rowcount: {0}",
child.RowCount);
Console.WriteLine(
"Department ID: {0}; Department Name: {1}",
child.GetItem<int>(1, "departmentid"),
child.GetItem<string>(1, "name"));
/*This code produces the following output:
DataWindowChild rowcount: 4
Department ID: 2; Department Name: English
*/
}
}
}
Example Refer To
Model Classes: D_Course Dddw_Department
DataWindow File: d_course
Applies to
.NET Standard
2.x