I have followed numerous tutorials and example and I have several problems with my simple example below.
1. Paging controls don't show
2. The OnInsertCommand gets called and my code actually inserts a record using a class I have created for that purpose.
3. The grid populates with my IEnumerable<myclass> data returned.
4.The Insert Record row shows at the top after clicking on "Add New Record" link; but does not go away after the record inserts!
5. The grid does not refresh after inserting a new record.
What am I doing wrong?
<
telerik:RadAjaxManager
ID
=
"radAjaxManager"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"radAjaxManager"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"radGridAchievements"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadGrid
ID
=
"radGridAchievements"
runat
=
"server"
AutoGenerateColumns
=
"false"
DataSourceID
=
"odsAchievements"
AllowAutomaticInserts
=
"true"
PageSize
=
"5"
AllowPaging
=
"true"
OnInsertCommand
=
"radGridAchievements_InsertCommand"
OnItemInserted
=
"radGridAchievements_OnItemInserted"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
MasterTableView
DataKeyNames
=
"Id"
DataSourceID
=
"odsAchievements"
EditMode
=
"InPlace"
CommandItemDisplay
=
"TopAndBottom"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"LinkButton"
/>
<
telerik:GridTemplateColumn
DataField
=
"Title"
HeaderText
=
"Title"
>
<
ItemTemplate
>
<%# Eval("Title") %>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
telerik:RadTextBox
ID
=
"txtTitleInsert"
runat
=
"server"
/>
</
InsertItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"Description"
HeaderText
=
"Description"
>
<
ItemTemplate
>
<%# Eval("Description") %>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
telerik:RadTextBox
ID
=
"txtDescriptionInsert"
runat
=
"server"
/>
</
InsertItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
>
<
KeyboardNavigationSettings
AllowSubmitOnEnter
=
"true"
/>
<
ClientEvents
OnGridCreated
=
"OnAchievementGridCreated"
/>
</
ClientSettings
>
<
ValidationSettings
EnableValidation
=
"true"
CommandsToValidate
=
"PerformInsert, Update"
/>
</
telerik:RadGrid
>
<
asp:ObjectDataSource
ID
=
"odsAchievements"
runat
=
"server"
TypeName
=
"GamesPlatform.External.Web.App.AchievementManager"
SelectMethod
=
"GetAchievements"
OnObjectCreating
=
"odsAchievements_ObjectCreating"
OnObjectDisposing
=
"odsAchievements_ObjectDisposing"
/>