Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
234 views
Hi, actually I have the code below working fine, but when I put the RadEditor inside an UpdatePanel to make it asynchronous, the code-behind dont get the RadEditor content value. Is it possible to pass the value inside an UpdatePanel, how? thanks


<telerik:RadEditor ID="reComment" runat="server" EditModes="Design" ToolbarMode="ShowOnFocus" ToolsWidth="170px" Width="412px" Height="72px">
 
                    <Tools>
                        <telerik:EditorToolGroup>
                            <telerik:EditorTool Name="Bold" />
                            <telerik:EditorTool Name="Italic" />
                            <telerik:EditorTool Name="StrikeThrough" />
                            <telerik:EditorTool Name="Underline" />
                            <telerik:EditorTool Name="InsertUnorderedList" />
                            <telerik:EditorTool Name="InsertOrderedList" />
                        </telerik:EditorToolGroup>
                    </Tools>
                </telerik:RadEditor>
                <input id="inpHide" name="inpHide" type="hidden" runat="server" />
                <span class="exp-bout-comm">
                    <asp:Button ID="btSubmit" runat="server" Text="Valider" OnClick="btSubmit_Click" /></span>


if (!IsPostBack)
{
    base.OnLoad(e);
    GetExistingComments();
 
    if (ScriptManager.GetCurrent(Page) == null)
    {
        ScriptManager sMgr = new ScriptManager();
        Page.Form.Controls.AddAt(0, sMgr);
    }
 
    btSubmit.Click += new EventHandler(btSubmit_Click);
 
    if (reComment == null)
    {
        reComment = this.FindControl("reComment") as RadEditor;
    }
 
    string content = reComment.Content;
}


Des
Top achievements
Rank 2
 answered on 20 Aug 2018
2 answers
100 views

Hello,

(Looking for a dynamic solution, not a hard-coded one...)

What is the best way for formatted text (content) keywords that are being previewed in the RadEditor able to pop a Tooltip when clicked?

Ideally, a row in a SQL table would describe all the Tooltip keywords and properties... possibly some Find/Replace process could update the content document by encapsulating the keyword with hyperlink tags and update - saved separately in SQL to be future selected (that is, when I'm given a document never seen before, I run a  process that tags any keywords already defined in my SQL table - which prepares the document for deployment ...) Then at runtime of RadEditor preview the tag'd words run the SQL lookup when clicked and pop this dynamic Tooltip... not sure if a custom tag is possible...Tooltip must be dynamic and not hard coded (as this allows the tag'd document to drive the process effortlessly).

I'm sure this is something that has been done before - so only inquiring such that I am not re-inventing the wheel (not asking for anyone to do the work for me, just seeking some advice).

If there is a code example somewhere that I could be directed to and/or some best practices shared, that would be great.

Chuck

 

 

Chuck
Top achievements
Rank 1
 answered on 17 Aug 2018
5 answers
176 views

Hello Team,

 

How do we capture cell double click event in telerik:RadPivotGrid.

My code looks like this:

 <telerik:RadPivotGrid ID="RadPivotGrid1" runat="server"  TotalsSettings-RowsSubTotalsPosition="None" TotalsSettings-ColumnsSubTotalsPosition="None" AllowSorting="true" PageSize="20"
            EnableConfigurationPanel="true" ConfigurationPanelSettings-Position="Left" Width="600px"
            ShowFilterHeaderZone="false" AllowPaging="true" Skin="Metro" OnCellDataBound="RadPivotGrid1_CellDataBound" 
            OnNeedDataSource="RadPivotGrid1_NeedDataSource"
             >
            <Fields>
                 <telerik:PivotGridRowField DataField="Description"></telerik:PivotGridRowField>
                <telerik:PivotGridRowField DataField="Category"></telerik:PivotGridRowField>
                <telerik:PivotGridColumnField DataField="EndDate" ></telerik:PivotGridColumnField>                
                <telerik:PivotGridAggregateField DataField="Amount" DataFormatString="{0:C}"></telerik:PivotGridAggregateField>
             </Fields>
        </telerik:RadPivotGrid>

 

Looking to hear from you.

 

Thanks,

Mohan Pal

 

 

 

Vessy
Telerik team
 answered on 17 Aug 2018
3 answers
185 views

Hello Team,

Like a rad grid has feature of client side data binding. How do we achieve same feature in rad pivot grid.

  var gridView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
  gridView.set_dataSource(result);
  gridView.dataBind();

My expectation is, user clicks a button, call gets redirected to JS file, which in turn save some data to database. now newly saved records to be displayed on pivot grid without making any server side call. 

we can have client side code which calls the API, pulls the data and bind it to pivot grid at client side like rad grid does.

 

Thanks,

Mohan Pal

 

 

Marin Bratanov
Telerik team
 answered on 17 Aug 2018
1 answer
111 views

Hi,

I have the following layout structure.

    <telerik:RadPageLayout ID="rplReportsPage" runat="server" GridType="Fluid">
      <rows>
        <telerik:LayoutRow  HtmlTag="Div" WrapperHtmlTag="Div">
              <Columns>
                <telerik:LayoutColumn Span="12">
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
                    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1">
                        <div id="dataDiv" runat="server"></div>
                    </telerik:RadAjaxPanel>
                </telerik:LayoutColumn>
            </Columns>
        </telerik:LayoutRow>
    </rows>
    </telerik:RadPageLayout> 

Following code in the backend (This is only a part of the backend code )

 

  LayoutColumn rLayoutColumn = new LayoutColumn();
  RadListView listView = DefineListViewStructure(parentItemCount, gridHeaderText);
  listView.DataSource = dt;
  listView.DataBind();

   rLayoutColumn.Controls.Add(listView);   
   dataDiv.Controls.Add(rLayoutColumn);

 

Code generates a view like in the attached file. I want to get rid of the highlighted space in the column and place the boxes right below each other. How can I do that?

 

 

 

 

Rumen
Telerik team
 answered on 16 Aug 2018
7 answers
539 views

Hi,

Currently, I have a rad grid which populates search results using client side binding (Select Method). However, I need to update this rad grid now to add new column to it which allows users to select values from a drop down and then save the selected value. I have been trying to use the same client side binding on this grid with the new GridTemplateColumn with a RadComboBox in it, but the issue is that it disappears on pagination and I cannot use NeedDataSource to render the server side RadCombobox as this is a search page and I do not want it to post back for the search results to display each time.

 

Can anyone please help me on how to achieve using a GridTemplateColumn with client side binding?

 

Thanks!

Eyup
Telerik team
 answered on 16 Aug 2018
6 answers
1.2K+ views
Hi! I'm new to ASP and the web in general so bear with me.

I need to add multiple footer rows to my RadGrid instance ; for the moment, however, I just want to add second one. I have currently a single footer row and it's working and displaying perfectly, for the record.

I found the following relevant question on these  forums and tried implemeting it but it's not working : the code gets executed, and the new FooterItem gets added to the Controls but that second row just doesn't appear. I need to find out why and I'd be grateful if anyone could help me fix that problem.

ASP grid code

<div id="OrderMainContent">
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1" />
            <telerik:AjaxSetting AjaxControlID="txtQuantity">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadInputManager ID="RadInputManager1" runat="server">
        <telerik:NumericTextBoxSetting BehaviorID="NumericBehavior1" Type="Number" DecimalDigits="0">
            <TargetControls>
                <telerik:TargetInput ControlID="RadGrid1" />
            </TargetControls>
        </telerik:NumericTextBoxSetting>
    </telerik:RadInputManager>
    <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Sunset" AllowSorting="True" AutoGenerateColumns="False"
        GridLines="None" ShowFooter="True" OnItemDataBound="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender">
        <MasterTableView DataKeyNames="ProductID" TableLayout="Fixed">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn UniqueName="colProduct" HeaderText="<%$ Resources: SiteLabels, ProductOrderForm.lblProduct %>"
                    HeaderStyle-HorizontalAlign="Center" DataField="ProdDesc">
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="colQuantity" HeaderText="<%$ Resources: SiteLabels, ProductOrderForm.lblQuantity %>"
                    HeaderStyle-HorizontalAlign="Center" DataField="OrderQty" ColumnEditorID="txtQuantity">
                    <HeaderStyle Width="90" />
                    <ItemStyle Width="90px" />
                    <ItemTemplate>
                        <asp:TextBox ID="txtQuantity" runat="server" Width="50px" OnTextChanged="txtQuantity_TextChanged"
                            AutoPostBack="true">
                        </asp:TextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="colPrice" HeaderText="<%$ Resources: SiteLabels, ProductOrderForm.lblBasePrice %>"
                    HeaderStyle-HorizontalAlign="Center" DataField="ProdUnitPrice">
                    <HeaderStyle Width="80px" />
                    <ItemStyle Width="80px" />
                    <ItemTemplate>
                        <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("ProdUnitPrice") %>' />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn UniqueName="colNotes" HeaderText="<%$ Resources: SiteLabels, ProductOrderForm.lblNotes %>"
                    HeaderStyle-HorizontalAlign="Center">
                    <HeaderStyle Width="200px" />
                    <ItemStyle Width="200px" />
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
    </telerik:RadGrid>
</div>


Relevant code behind

protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    AddFooterRow(sender as RadGrid);
}
 
private void AddFooterRow(RadGrid grid)
{
    if (grid != null)
    {
        GridItem[] footerItems = grid.MasterTableView.GetItems(GridItemType.Footer);
 
        if (footerItems.Count() == 1)
        {
            GridTFoot foot = footerItems[0].Parent.Controls[0].Parent as GridTFoot;
 
            for (int i = 0; i < foot.Controls.Count; i++)
            {
                GridFooterItem item = foot.Controls[i] as GridFooterItem;
 
                if(item != null)
                {
                    lastFooterPos = i;
                    break;
                }
            }
 
            GridFooterItem existingFooter = foot.Controls[lastFooterPos] as GridFooterItem;
            GridFooterItem newFooterItem = new GridFooterItem(grid.MasterTableView, 0, 0);
 
            foreach(TableCell fc in existingFooter.Cells)
            {
                TableCell newFooterCell = new TableCell();
                newFooterCell.Text = "allo";
                newFooterItem.Cells.Add(newFooterCell);
            }
 
            foot.Controls.AddAt(lastFooterPos + 1, newFooterItem);
        }
    }
}


Of course if you need more precisions, just ask. Thank you for your help.
Eyup
Telerik team
 answered on 16 Aug 2018
4 answers
62 views

Hello,

I have ASP.NET web pages that I would like to encapsulate in RadDock Tool (or Document) windows... I already have the Dock Layout created and placed on an ASP.NET page... and at run-time of the page,  would like to have my  other (responsive) ASP.NET web page(s) dynamically displayed in a RadDock Tool (or Document) window(s).

Is there a way (some example code would be awesome) to simply assign a web page to the Tool (or Document) window in the code-behind of the RadDock page?

Since it's nice to know the "why" of things... this allows existing my existing (responsive) pages to be re-purposed (without redesign) and encapsulated in the RadDock window (the new UI) - realizing all the benefits of the Dock with existing formatted content.

Thanking you for all replies.

Chuck

 

 

 

Chuck
Top achievements
Rank 1
 answered on 15 Aug 2018
1 answer
166 views
for small stack blocks, the counts are overlapping. How to manage this?
Vessy
Telerik team
 answered on 15 Aug 2018
7 answers
736 views
Hello,
     I have inserted a simple grid with batch editing option enabled. When I edit any cell, it gets a red mark at top left (which is of course telling that the cell got edited). But the grid is not firing any event like BatchEditCommand, Insert, Update or Delete after editing the cell. Please let me know what m I missing.
What I want is:
1. Get the data after cell got edited to make changes on my page accordingly.
2. Get the complete datasource of grid after editing for example as dataset or datatable.

Thanks.

Full page :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
 
<telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ConfigurationPanel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>
 
 
     <telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True" OnNeedDataSource="RadGrid1_NeedDataSource"
            AllowAutomaticInserts="True" PageSize="10" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"
            OnItemUpdated="RadGrid1_ItemUpdated" OnPreRender="RadGrid1_PreRender" AllowPaging="True"
            AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand" >
            <MasterTableView CommandItemDisplay="TopAndBottom" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
                <BatchEditingSettings EditType="Cell" />
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="ID" SortOrder="Ascending" />
                </SortExpressions>
                <Columns>
                    <telerik:GridBoundColumn DataField="Code" HeaderStyle-Width="210px" HeaderText="ProductName" SortExpression="ProductName"
                        UniqueName="ProductName">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>                                       
                </Columns>
            </MasterTableView>
            <ClientSettings AllowKeyboardNavigation="true"></ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

And C# Code :

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = (A function returning datatable).
        }
 
        protected void RadGrid1_BatchEditCommand(object sender, Telerik.Web.UI.GridBatchEditingEventArgs e)
        {
             
        }
 
        protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
        {
             
        }
 
        protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
        {
             
        }
 
        protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
        {
             
        }
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
             
        }
Vessy
Telerik team
 answered on 14 Aug 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?