Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
152 views

Dear all, 

           I have a radgrid like follows:

           <telerik:RadGrid ID="uiGrid" runat="server"
                                        AutoGenerateColumns="false" ItemStyle-BackColor="White" AlternatingItemStyle-BackColor="White"
                                        OnDataBound="uiGrid_DataBound" OnItemDataBound="uiGrid_ItemDataBound" OnNeedDataSource="uiGrid_NeedDataSource"
                                        ClientSettings-ClientEvents-OnKeyPress="keyPressInGrid"
                                        Width="100%" Height="500">
                                        <ClientSettings>
                                            <Scrolling CountGroupSplitterColumnAsFrozen="false" AllowScroll="true" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="3"></Scrolling>

                                        </ClientSettings>
                                        <MasterTableView>
                                            <GroupByExpressions>
                                                <telerik:GridGroupByExpression>
                                                    <SelectFields>
                                                        <telerik:GridGroupByField FieldAlias="<%$ Resources:Resource,Group %>" FieldName="IndicatorParentName"></telerik:GridGroupByField>
                                                    </SelectFields>
                                                    <GroupByFields>
                                                        <telerik:GridGroupByField FieldName="IndicatorParentName" SortOrder="Ascending"></telerik:GridGroupByField>
                                                    </GroupByFields>
                                                </telerik:GridGroupByExpression>
                                            </GroupByExpressions>
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="IndicatorName" HeaderText="<%$ Resources:Resource,Indicator %>" UniqueName="IndicatorName"
                                                    SortExpression="IndicatorName" DataType="System.String" ItemStyle-Wrap="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn>
                                                    <ItemTemplate>
                                                        <asp:HiddenField ID="uiIndicatorID" runat="server" Value='<%#Eval("IndicatorID")%>' />
                                                        <asp:HiddenField ID="uiIndicatorName" runat="server" Value='<%#Eval("IndicatorName")%>' />
                                                        <asp:ImageButton ID="uiTipsButton" runat="server" ImageUrl="images/information-icon.png?20170703" Width="16" Height="16" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn HeaderText="<%$ Resources:Resource,Unit %>">
                                                    <ItemTemplate>
                                                        <asp:Label ID="uiUnit" runat="server" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>

 

And I have functions to find controls value like this :

 

           foreach (GridDataItem item in uiGrid.MasterTableView.Items)
            {
                if (item.ItemType == GridItemType.Item || item.ItemType == GridItemType.AlternatingItem)
                {
                    HiddenField uiIndicatorID = item.FindControl("uiIndicatorID") as HiddenField;
                    for (int i = 0; i < uiGrid.MasterTableView.Columns.Count; i++)
                    {
                        HiddenField uiLocationID = item.FindControl("uiID_" + i.ToString()) as HiddenField;
                        RadNumericTextBox uiCurrencyBox = item.FindControl("uiCurrencyBox_" + i.ToString()) as RadNumericTextBox;
                        RadNumericTextBox uiInputBox = item.FindControl("uiInputBox_" + i.ToString()) as RadNumericTextBox;
                        HiddenField uiRemarksBox = item.FindControl("uiRemarksBox_" + i.ToString()) as HiddenField;

 

Now I want is not to loop the GridIitem to do the processing, I want to do the processing when user leave each inputbox (inside the grid) event happened. So I added the follows , in the InstantiateIn I add a delegation txt_TextChanged to the TextChanged event of _inputbox.

public void InstantiateIn(System.Web.UI.Control container)

             _inputBox = new RadNumericTextBox();
            _inputBox.ID = "uiInputBox_" + _controlIDNumber;
            _inputBox.Width = Unit.Pixel(100);

            UsageEdit ue = new UsageEdit(); //UsageEdit is another class
            _inputBox.TextChanged += ue.txt_TextChanged;

So in UsageEdit Class, I have the function 

            public void txt_TextChanged(object sender, EventArgs e)
        {
            
        }

My question is, how can I get the control value in function. like something:

    public void txt_TextChanged(object sender, EventArgs e)
        {

             HiddenField uiIndicatorID = sender.FindControl("uiIndicatorID") as HiddenField;
                    for (int i = 0; i < uiGrid.MasterTableView.Columns.Count; i++)
                    {
                        HiddenField uiLocationID = sender.FindControl("uiID_" + i.ToString()) as HiddenField;
                        RadNumericTextBox uiCurrencyBox = sender.FindControl("uiCurrencyBox_" + i.ToString()) as RadNumericTextBox;
                        RadNumericTextBox uiInputBox = sender.FindControl("uiInputBox_" + i.ToString()) as RadNumericTextBox;
                        HiddenField uiRemarksBox = sender.FindControl("uiRemarksBox_" + i.ToString()) as HiddenField;            
        }

Can I do that, can I access the control of the grid item in leave event of the inputbox that is in the grid item?

 

Eyup
Telerik team
 answered on 17 Dec 2018
1 answer
457 views

Hello

It seems by default, RadGrid applies client-side filtering on columns. When I press enter on a column, I can see at the end, client side filter is being applied. Is there any property to disable it? Here is a sample:

<telerik:RadGrid AutoGenerateColumns="False" ID="grdInProgressTasks" runat="server" Width="100%" AllowMultiRowSelection="true" AllowSorting="true"
                AllowPaging="true" OnNeedDataSource="grdInProgressTasks_NeedDataSource" CssClass="grdTasks pro-responsive" OnItemDataBound="GrdInProgressTasks_ItemDataBound"
                OnItemCommand="grdInProgressTasks_ItemCommand">
                <MasterTableView DataKeyNames="CrmObjectId,ProcessInstanceTypeIndex,Description, ColorR,ColorG,ColorB" ClientDataKeyNames="Id,CrmObjectId,ProcessInstanceTypeIndex" AllowCustomPaging="true" AllowFilteringByColumn="true" >
                    <Columns>
                        <septa:LocalizedBoundColumn DataField="DSenderId" HeaderResourceKey="General.Literal.AssignedFrom" />
                        <septa:LocalizedBoundColumn DataField="CrmObjectSubject" HeaderResourceKey="General.Literal.General_Subject" />
                        <septa:LocalizedTemplateColumn DataField="NickName" HeaderResourceKey="General.Literal.CrmHistory_IdentityName">
                            <ItemTemplate>
                                <a href="/_SiteCommon/Handler/IdentityFinder.ashx?Id=<%# Eval("IdentityId") %>" target="_blank"><%# Eval("NickName") %></a>
                            </ItemTemplate>
                        </septa:LocalizedTemplateColumn>
                        <septa:LocalizedGridDataBoundColumn DataField="DRelatedToId" HeaderResourceKey="General.Literal.erja" />
                        <septa:LocalizedGridDataBoundColumn DataField="DRelatedToTypeIndex" HeaderResourceKey="General.Literal.ReferType" AllowSorting="false" />
                        <septa:LocalizedGridDataBoundColumn DataField="DCardtableStatusIndex" HeaderResourceKey="General.Literal.Status" AllowSorting="false" />
                        <septa:LocalizedGridDataBoundColumn DataField="DDoneCauseIndex" HeaderResourceKey="General.Literal.End" AllowSorting="false" />
                        <septa:LocalizedBoundColumn DataField="CreateDatePersian" HeaderResourceKey="General.Literal.CreateDate" />
                        <septa:LocalizedGridDataBoundColumn DataField="LifePathType" HeaderResourceKey="General.Literal.Type" AllowSorting="false" />
                    </Columns>
                    <NoRecordsTemplate>
                        <div class="clearfix text-center">
                            <septa:LocalizedLiteral runat="server" ResourceKey="Res.General.Literal.UcUserTasks_AnyCaseDefined"></septa:LocalizedLiteral>
                        </div>
                    </NoRecordsTemplate>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="false" AllowDragToGroup="True" AllowColumnsReorder="True">
                    <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
                    <ClientEvents OnRowDblClick="RowDblClick" OnRowContextMenu="onRowContextMenu" />
                    <Resizing AllowColumnResize="true"></Resizing>
                </ClientSettings>
            </telerik:RadGrid>

 

And here is my columns:

public class LocalizedBoundColumn : GridBoundColumn
{
    public LocalizedBoundColumn()
    {
        this.AutoPostBackOnFilter = true;
        this.CurrentFilterFunction = GridKnownFunction.Contains;
        this.AutoPostBackOnFilter = true;
        this.ShowFilterIcon = false;
    }

 

    // ... 

}
Attila Antal
Telerik team
 answered on 14 Dec 2018
1 answer
115 views

- Click on an image

- Scroll

Rumen
Telerik team
 answered on 14 Dec 2018
9 answers
280 views
Hi,

I want to make use of the RAD Window control just to open up my different forms where all the functionality will be on my various forms and i can show them in RAD Window control rather than in a normal popup window. This approach will help me get rid of the popup blocker problem which falls in with the normal popup window approach. Also i want to have the looks of these RAD Windows on my popup screens.

Kindly assist ASAP.

Thanks, 
Sunil Nahar.
Marin Bratanov
Telerik team
 answered on 14 Dec 2018
11 answers
723 views
Hi,

We have a very tall form with a href links throughout. If a  user scrolls down, and clicks a link, this opens a radwindow. We are getting the current x and y pos of the mouse so that we set the radwindow position to something relative to where the mouse is - the goal being to just have the window appear wherever you are at in the position of the screen. However, when the radwindow opens, the browser resets the scroll position so we are looking at the top of the page - with our radwindow way down and invisible.

How can we open a rad window, and set its position but not have the browser scroll back to the top (we are using Firefox 3.5.3 in tests) ? Here is our code. Thanks in advance!

 function openRadWindow(ESID) {
            var oWnd = radopen("ViewFaculty.aspx?ESID=" + ESID, null);
            oWnd.SetSize(600, 550);
           // tempX and tempY are the current mouse x and y positions
            oWnd.moveTo(tempX, tempY);
            return false;


        }
Marin Bratanov
Telerik team
 answered on 14 Dec 2018
5 answers
315 views

Hello, how can I find a textbox control using the event OnBatchEditOpening?

I have created a column template.

 

<telerik:GridTemplateColumn HeaderText="Target" UniqueName="target" HeaderStyle-Width="360px">
<HeaderStyle Width="360px" />
<ItemTemplate>
<asp:Literal Text='<%# (Eval("target").ToString()) %>' runat="server" ID="literal_target"></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox runat="server" ID="txt_target" TextMode="MultiLine" Width="100%"  />          
</EditItemTemplate>

</telerik:GridTemplateColumn>​

 

Thank you.

Eyup
Telerik team
 answered on 14 Dec 2018
12 answers
473 views

I'm running into an issue while exporting in BIFF format, the column headers aren't correct on any of my grids that use multicolumn headers.  This is on dynamically created columns and multicolumn headers.  Anything that does not use multicolumn headers is good.

In the attached screenshot it shows that the second row in excel is not shifting the column headers to the right like it should, it is just cutting them off.  When I dig into the GridBiffExportingEventArgs table it is completely missing those cells that are cut off.  I tried changing lots of export settings before the export happens and nothing seemed to help.  Has anyone else run into this same issue?

Eyup
Telerik team
 answered on 14 Dec 2018
3 answers
159 views

I am injecting some HTML into the RadEditor's content window using the pasteHtml method in JavaScript.  The HTML I am pasting includes a <span> element, like this:

editor.pasteHtml("<span class='text-highlight'>@MyText</span>");

 

In all browsers, in Design view, after the text is pasted, the cursor appears after the span contents ("@MyText" in the example above).  In Chrome, the cursor is actually positioned inside the <span> tag (which is what I want).  In IE and Edge, however, the cursor position appears after the closing <span> tag.

Is there any way to get the cursor inside the <span> tag after the paste occurs?  I tried using variations of the range.collapse() methods (which have major limitations in IE anyway), but it had the adverse effect of taking the focus away from the RadEditor control.

 

Rumen
Telerik team
 answered on 14 Dec 2018
1 answer
130 views

 

When the editor is opened in Microsoft Edge, <br /> is present in the html, with or without taking focus in the content area.

Does appear to do this in Chrome.

 

Rumen
Telerik team
 answered on 14 Dec 2018
17 answers
841 views
Hello Everyone,

i want to close Menu-items after clicked on any MenuItems using javscript  OnClientItemClicked.

and my RadMenuItems are under

<telerik:GridTemplateColumn >
                        <ItemTemplate>
                     <telerik:RadMenu ID="RadMenuClient" runat="server" EnableRoundedCorners="true" EnableShadows="true"
                            OnClientItemClicked="OnClientItemClicked" ExpandAnimation-Type="None" CollapseAnimation-Type="None"
                            ExpandDelay="0" CollapseDelay="0" Selected="false" ClickToOpen="true">
                            <Items>
                              <telerik:RadMenuItem ImageUrl="../images/1.jpg" Selected="false">
                                <GroupSettings ExpandDirection="Down" OffsetX="20" OffsetY="-20" />
                                <Items>
                                  <telerik:RadMenuItem Text="Add" Value="Add">
                                  </telerik:RadMenuItem>
                                  <telerik:RadMenuItem Text="Edit" Value="EditI">
                                  </telerik:RadMenuItem>
                                  <telerik:RadMenuItem Text="Delete" Value="Delete">
                                  </telerik:RadMenuItem>
                               </Items>
                              </telerik:RadMenuItem>
                            </Items>
                          </telerik:RadMenu>
                        </ItemTemplate>
                      </telerik:GridTemplateColumn>


can anyone help me ?

Thanks,
Peter Milchev
Telerik team
 answered on 14 Dec 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?