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

Open Insert Popup for grid without Automatic Inserts

3 Answers 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kory
Top achievements
Rank 1
Kory asked on 14 May 2010, 04:45 AM
I have a grid that I am binding manually using the NeedsDataSource event, rather than using a DataSourceControl.

I am using EditMode="Popup", EditFormType="Template".

The template is working great for editing rows.

I am having trouble figuring out how to get the insert to work. When I click on the "Add New Record" link at the top of the grid, nothing is happening. It acts like it is making a callback, and the OnInsertCommand event is firing, but the popup does not open.

Is there a way to get this to work without using a DataSourceControl and Automatic Inserts?

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 14 May 2010, 08:20 AM
Hi Kory,

This behavior is not expected for the grid's edit form as evidenced by our online example:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx
Please check it out and let me know if it helps to resolve the problem.

If the issue persists I'd suggest that you open a formal support ticket and attach your project for inspection and debugging.

Greetings,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kory
Top achievements
Rank 1
answered on 15 May 2010, 03:24 PM
I figured out what I was doing wrong. It was a number of things actually.

First, in the ItemDataBound event, when binding values to controls in the EditForm, it was not enough to check to see if IsInEditMode is true. I also needed to make sure that IsItemInserted is false so that it does not try to access a DataItem for an Insert.

Second, I had a RadDatePicker in the EditForm template, and I was using an inline code block to bind a SelectedDate. I had to remove this and instead I needed to bind the SelectedDate in the ItemDataBound event. I don't understand why it is works to bind a textbox in the EditForm template using inline code blocks, but not with a RadDatePicker (at least where inserts are concerned; it works fine for edits).
0
Pavlina
Telerik team
answered on 17 May 2010, 09:31 AM
Hi Kory,

I am glad that you could solve the problem on your own. In case you need assistance or you have further questions, do not hesitate to contact us again. 

Greetings,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Kory
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Kory
Top achievements
Rank 1
Share this question
or