or
<telerik:RadGrid ID="rgCompanies" runat="server"<telerik:RadGrid ID="rgProducts" runat="server" AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" AllowAutomaticDeletes="True" AllowSorting="true" DataSourceID="Products"> <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductId" CommandItemDisplay="Top" > <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" ShowSortIcon="false"> <HeaderStyle ForeColor="DimGray" Width="20px" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ConfirmText="Dieses Produkt wirklich löschen?" ConfirmDialogType="RadWindow" ConfirmTitle="Löschen" ButtonType="ImageButton" CommandName="Delete" /> <telerik:GridBoundColumn DataField="ProductId" HeaderText="Nr." SortExpression="ProductId" UniqueName="ProductId" Visible="true" ReadOnly="true" MaxLength="5"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Grammage" HeaderText="Grammatur" SortExpression="Grammage" UniqueName="Grammage1" Visible="true" ReadOnly="false" DataFormatString="{0} g/m²"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Width" HeaderText="Breite" SortExpression="Width" UniqueName="Width" Visible="true" ReadOnly="false" DataFormatString="{0} cm"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Height" HeaderText="Höhe" SortExpression=".Height" UniqueName="Height" Visible="true" ReadOnly="true" DataFormatString="{0} cm"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="NumberOfPages" HeaderText="Umfang" SortExpression="NumberOfPages" UniqueName="NumberOfPages" Visible="true" ReadOnly="true" DataFormatString="{0} Seiten"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PrintType1.PrintTypeName" HeaderText="Drucktyp" SortExpression="PrintType1.PrintTypeName" UniqueName="PrintType1.PrintTypeName" Visible="true" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Refinement1.RefinementName" HeaderText="Veredelung" SortExpression="Refinement1.RefinementName" UniqueName="Refinement1.RefinementName" Visible="true" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PaperType1.PaperTypeName" HeaderText="Papersorte" SortExpression="PaperType1.PaperTypeName" UniqueName="PaperType1.PaperTypeName" Visible="true" ReadOnly="true"> </telerik:GridBoundColumn> </Columns> <EditFormSettings EditFormType="Template"> <FormTemplate> <asp:TextBox ID="tbGrammage" runat="server" Text='<%# Bind("Grammage") %>'> </asp:TextBox> <asp:TextBox ID="tbWidth" runat="server" Text='<%# Bind("Width") %>'> </asp:TextBox> <asp:TextBox ID="tbHeight" runat="server" Text='<%# Bind("Height") %>'> </asp:TextBox> <asp:TextBox ID="tbNumberOfPages" runat="server" Text='<%# Bind("NumberOfPages") %>'> </asp:TextBox> <asp:DropDownList ID="ddlPrintType" runat="server" SelectedValue='<%# Bind("PrintType") %>' AppendDataBoundItems="true" DataSourceID="PrintTypes" DataValueField="PrintTypeId" DataTextField="PrintTypeName"> </asp:DropDownList> <asp:DropDownList ID="ddlPaperType" runat="server" SelectedValue='<%# Bind("PaperType") %>' AppendDataBoundItems="true" DataSourceID="PaperTypes" DataValueField="PaperTypeId" DataTextField="PaperTypeName"> </asp:DropDownList> <asp:DropDownList ID="ddlRefinement" runat="server" SelectedValue='<%# Bind("Refinement") %>' AppendDataBoundItems="true" DataSourceID="Refinements" DataValueField="RefinementId" DataTextField="RefinementName"> </asp:DropDownList> <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button> <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button> </FormTemplate> </EditFormSettings> </MasterTableView> <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true"> <Selecting AllowRowSelect="true"></Selecting> </ClientSettings> </telerik:RadGrid><asp:EntityDataSource ID="Companies" runat="server" ConnectionString="name=PortalEntities" DefaultContainerName="PortalEntities" EnableFlattening="False" EntitySetName="Companies" EntityTypeFilter="Company" EnableInsert="False" EnableDelete="False" EnableUpdate="False"> </asp:EntityDataSource> <asp:EntityDataSource ID="Refinements" runat="server" ConnectionString="name=PortalEntities" DefaultContainerName="PortalEntities" EnableFlattening="False" EntitySetName="Refinements" EntityTypeFilter="Refinement" EnableInsert="False" EnableDelete="False" EnableUpdate="False"> </asp:EntityDataSource> <asp:EntityDataSource ID="PaperTypes" runat="server" ConnectionString="name=PortalEntities" DefaultContainerName="PortalEntities" EnableFlattening="False" EntitySetName="PaperTypes" EntityTypeFilter="PaperType" EnableInsert="False" EnableDelete="False" EnableUpdate="False"> </asp:EntityDataSource> <asp:EntityDataSource ID="PrintTypes" runat="server" ConnectionString="name=PortalEntities" DefaultContainerName="PortalEntities" EnableFlattening="False" EntitySetName="PrintTypes" EntityTypeFilter="PrintType" EnableInsert="False" EnableDelete="False" EnableUpdate="False"> </asp:EntityDataSource> <asp:EntityDataSource ID="Products" runat="server" ConnectionString="name=PortalEntities" DefaultContainerName="PortalEntities" EnableFlattening="false" EntitySetName="Products" EntityTypeFilter="Product" EnableInsert="true" EnableDelete="true" EnableUpdate="true" Where="it.CompanyId = @CompanyId" Include="PrintType1, Refinement1, PaperType1"> <WhereParameters> <asp:ControlParameter ControlID="rgCompanies" DefaultValue="1" Name="CompanyId" PropertyName="SelectedValue" Type="int64" /> </WhereParameters> </asp:EntityDataSource><script type="text/javascript"> function setToolTip() { var RadTextBox = $find("<%= RadTextBox1.ClientID %>"); // Get the textbox client object RadTextBox._textBoxElement.title = "Changed Tooltip"; } </script>function ShowEditForm(id, boxid, rowIndex, authToken, apiKey) {
var grid = $find("<%= radgrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
var url = 'EditReportPage.aspx?id=' + id + '&boxid=' + boxid + '&authtoken=' + authToken + '&apikey=' + apiKey;
var wnd = window.radopen(url, "EditReportDueDateData");
wnd.setSize(550, 300);
wnd.set_visibleStatusbar(false);
wnd.center();
return false;
}