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

[Solved] Detail Table, (Late Bound) Insert Mode

4 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neal
Top achievements
Rank 1
Neal asked on 27 May 2009, 09:30 AM
Hi All,

The problem.
When i click on the Insert of the Detail table, it does not go into "Insert Mode", ie no New Grid Row is provided (inline mode) to capture data into.
Is there a requirement I'm missing??

Scenario:
  • I am not using the <ParentTableRelation> . (I mention it because I don't know if this could cause the issue).
  • The Insert/refresh are customised (link button and Image) by use of the CommandItemTemplate.
  • DataBinding
  • occurs in the DetailTableDataBind event.(MainGrid uses OnNeedDataSource).
  • The ItemCommand determines a few Parameters which are required (just hiding or getting certain keys).

    In the insert command (updt+del, similarly)
    I differentiate between views/tables as per examples, eg if ("Detail1".Equals(e.Item.OwnerTableView.Name))....etc

Thanks
Neal

 

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 29 May 2009, 03:28 PM
Hello Neal,

May I suggest you review this online demo devoted on the same matter. Note also that you need to use either declarative relations or the programmatic one.

If the problem still persists could you describe what the difference in the implementation between the demo and your scenario are?

Best wishes,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Neal
Top achievements
Rank 1
answered on 02 Jun 2009, 07:25 AM
Thanks Georgi,
I found the problem.

I was not checking for,  if the item was or was not a  InsertItem (in the Grids ItemDataBound event)

 

i.e.    ..... if (e.Item is GridDataInsertItem)

and subsequent code for 

 

e.Item

is GridDataItem && e.Item is GridEditableItem   was executed,.....end denying the put into edit/insert mode.


So,..problem solved 

Neal

 

0
Fabio Rocha de Pinho
Top achievements
Rank 1
answered on 11 Aug 2009, 09:39 AM
Hi there, I have the same scenario I guess.

I'm having the following problem.

protected void RadGridSpecializations_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;

            ProductSpecialization ps = (ProductSpecialization)dataItem.DataItem;

           if (ps != null)
            {
                e.DetailTableView.DataSource = ps.AttributesValues;
            }
        }

executes good when the page is intialiazed or when the Parent Grid Item is edited or when the detail table item is edited, but when I click the add new record button on the detail table,  (ProductSpecialization)dataItem.DataItem; .. the DataItem is null, hence ps is also null, and ultimately, nothing happens, no "insert view"..

Im stuck on this for hours,

any thoughts?

Thanks

Fabio


0
Georgi Krustev
Telerik team
answered on 12 Aug 2009, 03:59 PM
Hello Fabio,

Could you try to set DataKeyName to the detail table and retrieve it in the DetailTableDataBind event handler? You can review the suggested approach in this online demo.

Kind regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Neal
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Neal
Top achievements
Rank 1
Fabio Rocha de Pinho
Top achievements
Rank 1
Share this question
or