The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
hi friends,
i am using grid grouping control for displaying the nested data from database and i am using checkbox on child table so i want information of parent record which have child record with checked check box in child grid on button click
plz help
ADAdministrator Syncfusion Team April 24, 2006 06:32 AM UTC
Hi,
Colud you try this code to get the parent record which have child record with checked check box in child grid .Here is a code snippet
GridTableControl tc = this.gridGroupingControl1.GetTableControl( "ParentTable");
string s = string.Empty;
string parents = string.Empty;
foreach(Record r1 in tc.Table.Records)
{
foreach(Record r in r1.NestedTables[0].ChildTable.Records)
{
object obj = r.GetValue("Check1") ;
if( obj != null && obj.ToString() != string.Empty)
{
bool checkValue = (bool)r.GetValue("Check1");
if( checkValue )
{
s += r.Info + Environment.NewLine;
if( r1 != null)
parents += r1.Info;
}
}
}
}
MessageBox.Show( "Child Record Details:"+ Environment.NewLine +s + Environment.NewLine + Environment.NewLine + "Parent Record Details:" + Environment.NewLine + parents , "Checked CheckBox Records");
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GetNestedTableValue_344224e.zip
Please let me know if you need any further assistance.
Regards,
Haneef
BRbrijeshkhareApril 24, 2006 08:56 AM UTC
>Hi,
>
>Colud you try this code to get the parent record which have child record with checked check box in child grid .Here is a code snippet
>
>GridTableControl tc = this.gridGroupingControl1.GetTableControl( "ParentTable");
>string s = string.Empty;
>string parents = string.Empty;
>foreach(Record r1 in tc.Table.Records)
>{
> foreach(Record r in r1.NestedTables[0].ChildTable.Records)
> {
> object obj = r.GetValue("Check1") ;
> if( obj != null && obj.ToString() != string.Empty)
> {
> bool checkValue = (bool)r.GetValue("Check1");
> if( checkValue )
> {
> s += r.Info + Environment.NewLine;
> if( r1 != null)
> parents += r1.Info;
> }
> }
> }
>}
>MessageBox.Show( "Child Record Details:"+ Environment.NewLine +s + Environment.NewLine + Environment.NewLine + "Parent Record Details:" + Environment.NewLine + parents , "Checked CheckBox Records");
>
>Here is a sample.
>http://www.syncfusion.com/Support/user/uploads/GetNestedTableValue_344224e.zip
>
>Please let me know if you need any further assistance.
>Regards,
>Haneef
hi Haneef
i have tried this code but there is a problem
Dim tc As GridTableControl = Me.dgPlanDuplicator.GetTableControl("User_Master") but tc contain nothing
so in this line
For Each r In tc.Table.Records
there is an error of object reference not set and remember that i do not have any checkbox on
parent table.
plz give the solution
ADAdministrator Syncfusion Team April 24, 2006 09:39 AM UTC
Hi,
GetTableControl method takes the name of the DataTable as argument. It will not accept the name of the dataset as argument.Please try this code
Dim tc As GridTableControl = Me.dgPlanDuplicator.TableControl;
Here is a modified sample in VB.Net
http://www.syncfusion.com/Support/user/uploads/VB_101a14d3.zip
Let me know if this helps.
Thanks for choosing Syncfusion Products
Regards,
Haneef
BRbrijeshkhareApril 25, 2006 09:51 AM UTC
>Hi,
>
>GetTableControl method takes the name of the DataTable as argument. It will not accept the name of the dataset as argument.Please try this code
>
>Dim tc As GridTableControl = Me.dgPlanDuplicator.TableControl;
>
>Here is a modified sample in VB.Net
>http://www.syncfusion.com/Support/user/uploads/VB_101a14d3.zip
>
>Let me know if this helps.
>
>Thanks for choosing Syncfusion Products
>Regards,
>Haneef
thanks Haneef
its working fine