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

EditFormSettings inside radgrid

1 Answer 240 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 18 Aug 2011, 10:18 AM

I have EditFormSettings inside the radgrid how i find in pageload and RadGrid2_ItemDataBound,
Reply soon
<EditFormSettings CaptionFormatString="Create" EditFormType="Template" PopUpSettings-Width="600px">
                  <EditColumn UniqueName="EditCommandColumn1">
                  </EditColumn>
                  <FormTemplate>
                      <div style="margin-left: 3%; margin-right: 3%">
                          <table width="100%">
                              <tr>
                                  <td style="height: 75px; width: 75%;">
                                      <table style="float: right;">
                                          <tr>
                                              <td>
                                                  <asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*" Width="1px"></asp:Label>
                                                  <asp:Label ID="Label2" Text="Mandatory Field(s)" runat="server"></asp:Label>
                                              </td>
                                          </tr>
                                      </table>
                                      <br />
                                      <br />
                                      <fieldset>
                                          <legend style="margin-bottom: 10px">CERTIFICATION</legend>
                                          <table cellspacing="1" cellpadding="1" width="100%" border="0">
                                              <tr>
                                                  <td>
                                                      <asp:TextBox Width="200px" ID="SERVNOTF" AutoCompleteType="Disabled" runat="server"
                                                          Text='<%# Bind("SERVNOTF") %>' Visible="false"></asp:TextBox>
                                                  </td>
                                              </tr>
                                              <tr>
                                                  <td>
                                                      <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="*" Width="1px"></asp:Label>
                                                      Certification No.
                                                  </td>
                                                  <td>
                                                      <asp:TextBox Width="150px" ID="PROJTITL" AutoCompleteType="Disabled" runat="server"
                                                          Text='<%# Bind("PROJTITL") %>'></asp:TextBox>
                                                  </td>
                                                  <td>
                                                      <asp:Label ID="Label4" runat="server" Text="Certification Date  "></asp:Label>
                                                  </td>
                                                  <td>
                                                      <telerik:RadDatePicker ID="RadDatePicker1" AutoCompleteType="Disabled" runat="server"
                                                          DbSelectedDate='<%# Bind("SUBMDATE") %>'>
                                                      </telerik:RadDatePicker>
                                                  </td>
                                              </tr>
                                              <tr>
                                                  <td>
                                                      Project Title
                                                  </td>
                                                  <td>
                                                      <asp:TextBox Width="150px" ID="TextBox1" AutoCompleteType="Disabled" runat="server"
                                                          Text='<%# Bind("PROJTITL") %>'></asp:TextBox>
                                                  </td>
                                                  <td>
                                                      Main Contractor
                                                  </td>
                                                  <td>
                                                      <asp:TextBox Width="150px" ID="TextBox2" AutoCompleteType="Disabled" runat="server"
                                                          Text='<%# Bind("PROJTITL") %>'></asp:TextBox>
                                                  </td>
                                              </tr>
                                              <tr>
                                                  <td>
                                                      Route Name
                                                  </td>
                                                  <td>
                                                      <%--<telerik:RadComboBox ID="combo_routname" runat="server" Width="150px" DataValueField="ProviderCode"
                                                          DataTextField="ProviderName">
                                                      </telerik:RadComboBox>--%>
                                                      <telerik:RadComboBox runat="server" Width="150px" ID="SERVTYPE" SelectedValue='<%# Bind("SERVTYPE") %>'
                                                          DataSource='<%# (new string[] { "Babu Street", "Club Road", "1st Cross"}) %>'>
                                                      </telerik:RadComboBox>
                                                  </td>
                                                  <td>
                                                      Total Certification Amount
                                                  </td>
                                                  <td>
                                                      <telerik:RadNumericTextBox Width="150px" ID="TextBox3" AutoCompleteType="Disabled"
                                                          runat="server" Text='<%# Bind("PROJTITL") %>'>
                                                      </telerik:RadNumericTextBox>
                                                  </td>
                                              </tr>
                                              <tr>
                                                  <td>
                                                      <table width="100%" class="ourtertable">
                                                          <tr>
                                                              <td class="pageflow" style="height: 20px">
                                                                  <asp:Label ID="Label10" runat="server" Text="SERVICE PROVIDER DETAILS:"></asp:Label>
                                                              </td>
                                                          </tr>
                                                          <tr>
                                                              <td align="center">
                                                                  <telerik:RadGrid ID="RadGrid2" runat="server" OnItemDataBound="RadGrid2_ItemDataBound"
                                                                      Width="350px" Skin="Office2007">
                                                                      <MasterTableView AutoGenerateColumns="False" IsFilterItemExpanded="false">
                                                                          <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                                                          <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                                                          </RowIndicatorColumn>
                                                                          <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                                                          </ExpandCollapseColumn>
                                                                          <Columns>
                                                                              <telerik:GridTemplateColumn HeaderText="S.No">
                                                                                  <ItemTemplate>
                                                                                      <asp:Label ID="Sno" runat="server" Text="Label" Width="35px" Style="text-align: center">
                                                                                      </asp:Label>
                                                                                  </ItemTemplate>
                                                                              </telerik:GridTemplateColumn>
                                                                              <telerik:GridTemplateColumn HeaderText="Service Type">
                                                                                  <ItemTemplate>
                                                                                      <telerik:RadTextBox ID="servicetype" runat="server" Width="110px">
                                                                                      </telerik:RadTextBox>
                                                                                  </ItemTemplate>
                                                                              </telerik:GridTemplateColumn>
                                                                              <telerik:GridTemplateColumn HeaderText="Service Provider">
                                                                                  <ItemTemplate>
                                                                                      <telerik:RadTextBox ID="serviceprod" runat="server" Width="150px">
                                                                                      </telerik:RadTextBox>
                                                                                  </ItemTemplate>
                                                                              </telerik:GridTemplateColumn>
                                                                              <telerik:GridTemplateColumn HeaderText="Submission / Rec. Date">
                                                                                  <ItemTemplate>
                                                                                      <telerik:RadDateInput ID="subrecdate" runat="server" Width="115px" DateFormat="dd/MM/yyyy">
                                                                                      </telerik:RadDateInput>
                                                                                  </ItemTemplate>
                                                                              </telerik:GridTemplateColumn>
                                                                          </Columns>
                                                                          <EditFormSettings>
                                                                              <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                                              </EditColumn>
                                                                          </EditFormSettings>
                                                                      </MasterTableView>
                                                                      <ClientSettings EnablePostBackOnRowClick="false" AllowDragToGroup="true">
                                                                          <Selecting AllowRowSelect="true" />
                                                                      </ClientSettings>
                                                                      <FilterMenu EnableImageSprites="False">
                                                                      </FilterMenu>
                                                                      <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_">
                                                                      </HeaderContextMenu>
                                                                  </telerik:RadGrid>
                                                              </td>
                                                          </tr>
                                                      </table>
                                                  </td>
                                              </tr>
                                          </table>
                                      </fieldset>
                                  </td>
                              </tr>
                          </table>
                          <table>
                              <tr>
                                  <td>
                                      <telerik:RadButton ID="Button3" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                          CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                                          Icon-PrimaryIconCssClass="rbOk">
                                      </telerik:RadButton>
                                      <telerik:RadButton ID="Button4" runat="server" Text="Cancel" CausesValidation="false"
                                          CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">
                                      </telerik:RadButton>
                                  </td>
                              </tr>
                          </table>
                      </div>
                  </FormTemplate>
                  <PopUpSettings Modal="True"></PopUpSettings>
              </EditFormSettings>



Regards,
mohamed

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Sep 2012, 11:57 AM
Hi Mohammed,

I suppose you want to access the RadGrid in FormTemplate. Instead of page load, you can access the controls in PreRender event. Here is the sample code.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
 if (e.Item is GridEditableItem && e.Item.IsInEditMode)
 {
   GridEditableItem item = (GridEditableItem)e.Item;
   RadGrid grid = (RadGrid)item.FindControl("RadGrid2");
 }
}
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
  foreach (GridDataItem item in RadGrid1.EditItems)
  {
    GridEditFormItem editItem = (GridEditFormItem)item.EditFormItem;
    RadGrid grid = (RadGrid)item.FindControl("RadGrid2");
  }
}

Thanks,
Shinu.
Tags
Grid
Asked by
mohamed
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or