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

[Solved] inserting in hierarchial grid

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mydatafactory
Top achievements
Rank 1
Mydatafactory asked on 23 Jun 2008, 12:41 PM
I try to get the insert in an hierarchial grid working and found a piece of code which 'reads' a control in the editform. However, it doesn't read GridNumericColumn and GridDateTimeColumn. How can I read the values of those controls?

Piece of code:
Dim TaskDescription As String = (TryCast(insertedItem("TaskDescription").Controls(0), TextBox)).Text

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Jun 2008, 06:04 AM
Hi,

Try the following code snippet to access the control from a GridDateTimeColumn when it is in edit mode.

ASPX:
  <telerik:GridDateTimeColumn DataField="ValidTo" DataType="System.DateTime"  PickerType="DatePicker"  HeaderText="ValidTo"  UniqueName="ValidTo" > 
                    </telerik:GridDateTimeColumn> 

CS:
 protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
       if((e.Item is GridEditFormInsertItem)&&(e.Item.OwnerTableView.IsItemInserted))  
        {  
            GridEditFormInsertItem edititem = (GridEditFormInsertItem)e.Item;  
            RadDatePicker datepkr = (RadDatePicker)edititem["ValidTo"].Controls[0];  
        }  
   } 

Thanks
Princy.
Tags
Grid
Asked by
Mydatafactory
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or