This is a migrated thread and some comments may be shown as answers.

Hierarchy of Radgrid problem

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shanker bangari
Top achievements
Rank 1
shanker bangari asked on 31 Mar 2010, 09:10 PM
Hi

this is shanker am doing project .I am using 3 level of hierarchy rad grid .My requirement is parent of parent cloumn in child grid 
I want 1 level grid cloumn in 3 level grd.

 if (e.Item.OwnerTableView.Name == "Check_payable")
                        {
                            GridDataItem editedItem1 = e.Item.OwnerTableView.ParentItem as GridDataItem;
                            CheckBox chk = editedItem1["locked"].Controls[0] as CheckBox;
                            if (chk != null)
                            {
                                if (chk.Checked == false)
                                {

                            int? faciltyid = LogonDetails.Instance.sys_lclvar_default_facility_id;
                            GridEditableItem editedItem = e.Item as GridEditableItem;
                            Dictionary<string, object> values = checkEditValues(editedItem);
                            try
                            {

                                int? fee_transaction_id = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["fee_transaction_id"].ToString().GetInteger();
                                LogonDetails det = LogonDetails.Instance;
                                string status_text = String.Empty;
                                byte demand_draft_flag = 1;
                                bool res = feetranscationmanager.sch_sproc_dml_sch_fee_transaction_dd_check_ins(fee_transaction_id, values["bank_branch"] as string, values["bank_name"] as string, values["dd_check_number"] as string, Convert.ToByte(values["favour_of_id"]) as byte?,
                                values["check_date"] as DateTime?, values["check_expiry_date"] as DateTime?, demand_draft_flag, values["Discription"] as string, out status_text);
                                if (res)
                                {
                                    DisplayMessage(false, "Record inserted");
                                }
                                else
                                {

                                    DisplayMessage(true, "Can't insert Record. Reason: " + status_text);
                                }
                            }
                            catch (Exception ex)
                            {

                                DisplayMessage(true, "Record cannot be inserted. Reason: " + ex.Message);
                            }
                        }
                                else
                                {

                                    DisplayMessage(true, "Receipt Locked");
                                }
                    }

 GridDataItem editedItem1 = e.Item.OwnerTableView.ParentItem as GridDataItem;
                            CheckBox chk = editedItem1["locked"].Controls[0] as CheckBox;
                            if (chk != null)
                            {
                                if (chk.Checked == false)
                                {
i want this check box
 this check box column in main grid means parent grid Please it's very argent 

how to solve that please give me solutions 
thanks and regards 
shanker.B

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Apr 2010, 12:42 PM

Hi,

I guess you are using GridTemplateColumn with CheckBox in the MasterTableView. You can get reference to this checkbox by accessing the corresponding mastertableview item. For getting the parent table's griddataitem use the ParentItem property as shown below.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "detail3"
    { 
      GridDataItem Level2Item = (e.Item.OwnerTableView.ParentItem as GridDataItem); 
      GridDataItem Level1Item = (ItemLevel2.OwnerTableView.ParentItem as GridDataItem); 
      CheckBox chk = Level1Item.FindControl("chk1"as CheckBox; 
       
    } 


-Princy
Tags
Grid
Asked by
shanker bangari
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or