Edit form in hierarchy grid

1 posts, 0 answers
  1. Suzan
    Suzan avatar
    17 posts
    Member since:
    Feb 2011

    Posted 06 Oct 2017 Link to this post

    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?

     

Back to Top