This is a migrated thread and some comments may be shown as answers.
Edit form in hierarchy grid
0 Answers 4 Views
This is a migrated thread and some comments may be shown as answers.
Suzan
Top achievements
Rank 1
Suzan asked on 06 Oct 2017, 09:44 AM

I am using a User Control form to edit the rows in the second level of my hierarchy grid

 

Here is my grid definition

<telerik:radgrid runat="server" id="RadGridUCASRefs" showfooter="false" width="100%" enableajax="true" showstatusbar="true" allowautomaticinserts="false"
onitemcommand="RadGridUCASRefs_ItemCommand" onupdatecommand="RadGridUCASRefs_UpdateCommand" onitemcreated="RadGridUCASRefs_ItemCreated"
allowaddingrecords="false" autogeneratecolumns="false" allowsorting="false" allowpagesizeselection="False" onitemdatabound="OnItemDataBoundHandler" allowautomaticupdates="false"
allowpaging="True" skin="Bootstrap" pagesize="25" onneeddatasource="RadGridUCASRefs_NeedDataSource" onprerender="RadGridUCASRefs_PreRender" cssclass="table table-striped">
<MasterTableView AutoGenerateColumns="false" DataKeyNames="Student_reference" TableLayout="Auto" EditMode="EditForms" CommandItemDisplay="Top" RetainExpandStateOnRebind="false" HierarchyLoadMode="ServerBind" EnableHierarchyExpandAll="true" HierarchyDefaultExpanded="false">
<DetailTables>
<telerik:GridTableView AutoGenerateColumns="false" allowaddingrecords="false" DataKeyNames="Student_id,course_id,qualcode" Width="100%" EnableHierarchyExpandAll="true" CommandItemDisplay="None" EditMode="EditForms" name="GridRefs">
<Columns>
<telerik:GridEditCommandColumn HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle" UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="Student_id" HeaderText="Student ID" UniqueName="Student_id" runat="server" Display="false" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="qualcode" HeaderText="Subject Code" UniqueName="qualcode" Display="true" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="course_id" HeaderText="Class" UniqueName="course_id" Display="true" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="subject_name" HeaderText="Subject" UniqueName="subject_name" Display="true" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="grade" HeaderText="Name" UniqueName="grade" Display="False" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="complete_flag" UniqueName="complete" Display="false">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Complete" UniqueName="UCASComplete" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true">
<ItemTemplate>
<asp:LinkButton id="btnComplete" runat="server"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridBoundColumn DataField="Student_reference" HeaderText="Student ID" UniqueName="Student_reference" runat="server" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true">
</telerik:GridBoundColumn>
<telerik:GridCalculatedColumn DataFields="p_surname,p_forenames" HeaderText="Name" Expression='{1} + " " + {0}' UniqueName="student_name" Display="True" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">
</telerik:GridCalculatedColumn>
<telerik:GridBoundColumn DataField="p_surname" HeaderText="Name" UniqueName="p_surname" Display="False" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="p_forenames" HeaderText="Name" UniqueName="p_forenames" Display="False" HeaderStyle-BackColor="#428bca" HeaderStyle-ForeColor="White" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings UserControlName="~\Private\Components\Teaching\Teaching_Plan\Class_List\UCASReview.ascx" EditFormType="WebUserControl">
<EditColumn UniqueName="EditCommandColumn">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="True" />
</ClientSettings>
<SelectedItemStyle BackColor="Gray" BorderColor="Blue" BorderStyle="Dashed" BorderWidth="1px" />
</telerik:radgrid>

How do I set and get the data in the edit form for updating?

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Suzan
Top achievements
Rank 1
Share this question
or