<telerik:RadGrid ID="rgCesWeeklyLogs" runat="server" AutoGenerateColumns="False" GridLines="None" Skin="Windows7" AllowPaging="true" AllowSorting="true" onneeddatasource="rgCesWeeklyLogs_NeedDataSource" onupdatecommand="rgCesWeeklyLogs_UpdateCommand" ondatabound="rgCesWeeklyLogs_DataBound"> <MasterTableView CommandItemDisplay="None" DataKeyNames="Id"> <CommandItemSettings ExportToPdfText="Export to Pdf" /> <Columns> <telerik:GridTemplateColumn UniqueName="EditLog"> <ItemTemplate> <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/Images/edit-icon.jpg" CommandName="Edit" ToolTip="Edit Record" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="ActivityDate" ReadOnly="true" DataFormatString="{0:d}" /> <telerik:GridBoundColumn DataField="DayOfWeek" ReadOnly="true" HeaderText="Day of Week" /> <telerik:GridBoundColumn DataField="Activity" HeaderText="Planned Activity" ColumnEditorID="GridHTMLEditorColumnEditor1" /> <telerik:GridBoundColumn DataField="Outcome" HeaderText="Outcome" ColumnEditorID="ActivityEditor" /> <telerik:GridBoundColumn DataField="LastUpdated" HeaderText="Last Updated" ReadOnly="true" /> </Columns> </MasterTableView></telerik:RadGrid><telerik:GridTextBoxColumnEditor ID="ActivityEditor" TextBoxMode="MultiLine" TextBoxStyle-Width="500px" TextBoxStyle-Height="200px" runat="server" /><br /><telerik:GridHTMLEditorColumnEditor ID="GridHTMLEditorColumnEditor1" runat="server"></telerik:GridHTMLEditorColumnEditor>
Hi,
I’ve been working on a Custom Radgrid and Radtoolbar control which works very well. At the moment the javascript used is still in the design view of the page and want to include this in my control dll. I’ve looked around the site and can’t find any examples of how to go about doing this.
How would I go about including the below in my code:
function RowClick(sender, eventArgs) {
if (editedRow != null && hasChanges) {
if (confirm("Update changes?")) {
hasChanges = false;
$find("<%=gvGrid.MasterTableView.ClientID %>").updateItem(editedRow);
}
else {
hasChanges = false;
}
}
}
Also how would I change it so gvGrid is dynamic so I can have different names for my grids etc.
Any pointers in the right direction would be great.
Thanks
<cc1:TabContainer ID="tcObjects" CssClass="ajaxtab" runat="server"> <cc1:TabPanel ID="tpSearchResults" runat="server" TabIndex="0" Visible="false" CssClass="css_div_gridpanel"> <ContentTemplate> <div class="css_div_control"> <div class="css_div_titlebar"> <div style="float:left; height: 24px; width: 24px; margin: 2px;"> <asp:Image ID="imgSearchResults" runat="server" Width="24px" Height="24px" /> </div> <div class="css_div_title"> <span class="css_title_lbl"> <asp:Label ID="lblSearchResults" runat="server"></asp:Label> </span> </div> <asp:Panel ID="pSearchResults" CssClass="css_div_actions" runat="server"> <asp:LinkButton ID="btnAttach" OnClick="AttachObjects" runat="server"> <div class="css_action_item_enabled" style="float: right;"> <div class="css_action_item_icon_add"> </div> <span class="css_action_link"> <asp:Label runat="server" ID="lblAttach"></asp:Label> </span> </div> </asp:LinkButton> </asp:Panel> </div> <div class="css_div_datacontrol_content"> <div class="css_div_datacontrol_data"> <asp:Panel ID="GridPanel" runat="server" CssClass="css_div_gridpanel"> <telerik:RadGrid ID="rgSearchResults" OnNeedDataSource="rgSearchResults_NeedDataSource" AutoGenerateColumns="true" HeaderStyle-Wrap="false" AllowMultiRowSelection="true" GridLines="None" Skin="Sunset" EnableViewState="true" EnableEmbeddedScripts="false" EnableEmbeddedSkins="false" AllowSorting="true" EnableEmbeddedBaseStylesheet="false" RegisterWithScriptManager="false" AllowFilteringByColumn="true" runat="server"> <MasterTableView Width="100%"></MasterTableView> <GroupingSettings CaseSensitive="false" /> <HeaderStyle Width="150px" /> <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true" Resizing-AllowRowResize="false" ColumnsReorderMethod="Reorder" Resizing-AllowColumnResize="true" Resizing-ResizeGridOnColumnResize="true" Resizing-EnableRealTimeResize="true" Scrolling-AllowScroll="true"> <Scrolling UseStaticHeaders="true" AllowScroll="true" /> <Selecting AllowRowSelect="true" /> <ClientEvents OnGridCreated="GridCreated" /> </ClientSettings> </telerik:RadGrid> </asp:Panel> </div> </div> </div> </ContentTemplate> </cc1:TabPanel></cc1:TabContainer>function GridCreated(sender, args) { var grid = sender; var masterTable = sender.get_masterTableView(); masterTable.selectAllItems(true);}GridClientSelectColumn column = new GridClientSelectColumn();this.rgSearchResults.Columns.Add(column);column.Reorderable = false;column.Resizable = false;column.ItemStyle.Width = Unit.Pixel(30);column.HeaderStyle.Width = Unit.Pixel(30);this.rgSearchResults.DataSource = table;this.rgSearchResults.DataBind();