Can anyone help me out with the below issue,
I have a Ultrawingrid showing up records where each record is collapsable and have child records to it as shown below.
Here, I need to delete a column PatientNumber in the Child record.I have set the Hidden property to true for that column and also removed the column, even then the value is binding to the child datatable.
Please, check below code, underlined the code for more info.Do suggest me how can I resolve this issue.
dsPatientSearch = new DataSet();
dtPatienDetails = EligibilityDataAccess.GetPatientDetails(patientNumber,patientName,patientSsn,patientDob,shortCut,iCode,claimNumber);
dtPatienDetails.TableName = "PatientDetails";
dtClaimDetails = CreateClaimDetailsTable();
dtClaimDetails.TableName = "ClaimDetails";
DataTable dtGetClaimDetails = null;
foreach (DataRow dr in dtPatienDetails.Rows)
{
foreach(DataRow drClaimDetails in EligibilityDataAccess.GetClaimDetails(Convert.ToInt32(dr[0])).Rows)
dtClaimDetails.Rows.Add(drClaimDetails.ItemArray);
}
dsPatientSearch.Tables.Add(dtPatienDetails.Copy());
dsPatientSearch.Tables.Add(dtClaimDetails.Copy());
// Here dsPatientSearch.Tables[0].Columns[0] is the primary to key to the Parent band and dsPatientSearch.Tables[1].Columns[5] is the foreign key to the child band.
dsPatientSearch.Relations.Add("patientClaimRelation",dsPatientSearch.Tables[0].Columns[0],
dsPatientSearch.Tables[1].Columns[5]);
ugMain.DataSource = dsPatientSearch;
Hi,
The WinGrid binds to the DataSource you give it. So if the column exists in the data source, then grid will create a column for that field. There is no way around this, the column cannot be remove from the grid.
You can hide the column, but it will always exist in the grid if it exists in your data source.
Hello Jim03,
I`m not sure what do you mean with " I need to delete a column PatientNumber in the Child record", because the mentioned column is include into your Relation between both tables (Main and child tables). If you delete (remove) this column, then you are not able to used the relation between both tables, so you are not able to represent hierarchical data in your UltraGrid.
Please let me know if you think that I misunderstood your scenario or question.
Regards