Protected Sub OnAjaxUpdate(sender As Object, args As ToolTipUpdateEventArgs) Me.UpdateToolTip(args.Value, args.UpdatePanel) End SubPrivate Sub UpdateToolTip(elementID As String, panel As UpdatePanel) Dim ctrl As Control = Page.LoadControl("../Class_Details.ascx") Session("center_id") = elementID panel.ContentTemplateContainer.Controls.Add(ctrl) End SubI am using DataSet as DataSource for RadGrid. I can apply DataSource either through NeedDataSource or through directly datasource property of radgrid. I could not use DataSource control for binding. I went through all examples but could not find one which does not use DataSource control or any example with DataSet.
Edit Scenario:
Records Insert / Update needs to be in-place and all rows are editable from start, User have option of clicking "Save" button to save all changes.
Insert Scenario:
For insert operation, when user clicks "Add New" button. New row will be added at bottom and user can add new record in that. Then clicking on "Save" button will save new record along with any changes made in existing records.
Current Issues:
# DataSource is not retained after post-back from "Save" or "Add New" button and RadGrids shows empty. Any control with in RadGrid, like rows and columns which are rendered in page are also empty.
# For Insert Scenario I tried adding empty row in DataTable and then did binding. But above issue occurs and not data is retained from end user.
Mentioned scenario should be well with-in the capabilities of RadGrid control. Please advise on implementation details.
Hello,
I have a RadGrid with 4 template columns.
1. ASP:TextBox
2. RadEditor
3. ASP:LinkButton (ADD)
4. ASP:LinkButton. (DELETE)
When we click on "ADD" button we are adding a new row next to the selected row. Same way we are deleting the selected row on click of "DELETE" button. This we are doing in postback by rebinding the RadGrid. We need to avoid the postback and Add/Delete rows dynamically in javascript. Please provide the solution. Please find herewith the sample code that we are doing in code behind.
FYI: we are using net framework 4.0 and the Telerik.Web.UI.dll version is v. 2011.2.915.40
I am not able to add the code here.
| <paragraph name="<code>Code</code>" value="<code>" /> |
| <paragraph name="<p class='tipp'>Tipp<</p>" value="<p class='tipp'>" /> |
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" EnableAJAX="True" GridLines="None" OnRowDataBound="NamesGridView_RowDataBound" PageSize="14" DataKeyNames="OrderId" ShowGroupPanel="True" CellSpacing="0"> <GroupingSettings ShowUnGroupButton="True" /> <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True"><Selecting AllowRowSelect="True"></Selecting> <ClientEvents OnRowMouseOver="RowMouseOver"></ClientEvents> </ClientSettings> <MasterTableView CommandItemDisplay="Top" ClientDataKeyNames="OrderID, Text" DataKeyNames="OrderID"><CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings> <RowIndicatorColumn Visible="False"> <HeaderStyle Width="20px" /> </RowIndicatorColumn> <ExpandCollapseColumn Resizable="False" Visible="False"> <HeaderStyle Width="20px" /> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="TemplateEditColumn"> <ItemTemplate> <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink> </ItemTemplate> <FooterStyle Width="32px" /> <HeaderStyle Width="32px" /> <ItemStyle Width="32px" /> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="OrderId" GroupByExpression="OrderID" HeaderText="Order Ref" SortExpression="OrderId" UniqueName="OrderId" Visible="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="OrderNum" GroupByExpression="OrderNum" HeaderText="Order Number" SortExpression="OrderNum" UniqueName="OrderNum" Visible="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ProjectRef" HeaderText="Project" UniqueName="ProjectRef" SortExpression="ProjectRef" GroupByExpression="ProjectRef"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Location" HeaderText="Location" UniqueName="Location" SortExpression="Location" GroupByExpression="Location"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CostCentre" HeaderText="Cost Centre" UniqueName="CostCentre" SortExpression="CostCentre" GroupByExpression="CostCentre"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="AccountCode" HeaderText="Account Code" UniqueName="AccountCode" SortExpression="AccountCode" GroupByExpression="AccountCode"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="activityRef" HeaderText="Order Activity" UniqueName="activityRef" SortExpression="activityRef" GroupByExpression="activityRef"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CategoryRef" HeaderText="Type of Work" UniqueName="CategoryRef" SortExpression="CategoryRef" GroupByExpression="CategoryRef"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Order Date" HeaderText="Order Date" UniqueName="OrderDate" SortExpression="Order Date" GroupByExpression="Order Date"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Plan Date" HeaderText="Target Complete" UniqueName="TargetComplete" SortExpression="Plan Date" GroupByExpression="Plan Date"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Actual Date" HeaderText="Actual Complete" UniqueName="ActualComplete" SortExpression="Actual Date" GroupByExpression="Actual Date"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Amount" HeaderText="Estimated Cost" UniqueName="EstimatedCost" SortExpression="Amount" GroupByExpression="Amount"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ServiceProvider" HeaderText="Service Provider" UniqueName="ServiceProvider" SortExpression="ServiceProvider" GroupByExpression="ServiceProvider" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Text" HeaderText="Text" UniqueName="Text" Display="false"> </telerik:GridBoundColumn> </Columns><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings> <CommandItemTemplate> <table style="width: 100%;"> <tr> <td style="width: 50%;"> <a href="#" onclick="return ShowInsertForm();"> <img alt="Insert" border="0" height="20" src="App_Images/AddRecord.gif" width="20" /> Add New Record</a> </td> <td align="right" style="width: 50%"> <asp:CheckBox ID="chkArchived" runat="server" AutoPostBack="True" OnCheckedChanged="chkShowArchived_CheckChanged" Text="Show Archived" Width="163px" /> </td> <td align="right" style="width: 50%"> <asp:CheckBox ID="chkComplete" runat="server" AutoPostBack="True" OnCheckedChanged="chkShowComplete_CheckChanged" Text="Show Completed" Width="163px" /> </td> </tr> </table> </CommandItemTemplate> </MasterTableView> <GroupPanel Visible="True"> </GroupPanel> <ClientSettings AllowDragToGroup="True" Selecting-AllowRowSelect="true"> </ClientSettings> <PagerStyle Mode="NextPrevNumericAndAdvanced" /><FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid> <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Animation="None" Behaviors="Default" InitialBehaviors="None" Left="" Top="" ReloadOnShow="True" VisibleStatusbar="false"> </telerik:RadWindowManager> </div> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadSlider1" /> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> </form></body></html>