Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
3.0K+ views
Hi All

i have a requirement to get the hidden column value for the rows which checkbox has been selected, can anyone come up with a good solution to complete this thing  may be client side or server side ... 

my rad grid 

            <telerik:RadGrid ID="M" runat="server" Width="99%" AllowPaging="True" EnableViewState="False"
                GridLines="None" meta:resourcekey="MResource1" AllowFilteringByColumn="true"
                OnInit="GridControl_Init" EnableLinqExpressions="false" 
                EnableEmbeddedSkins="false" AutoGenerateColumns="False">
                <HeaderContextMenu EnableEmbeddedSkins="True">
                </HeaderContextMenu>
                <FilterMenu Skin="Nediso" EnableEmbeddedSkins="false">
                </FilterMenu>
                <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" AlwaysVisible="true" />
                <MasterTableView Width="100%" EnableViewState="False" AllowFilteringByColumn="true">
                   <Columns>  


                   <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false">
                   <HeaderStyle Width="3%" HorizontalAlign="Justify" />
                    <ItemStyle Width="3%" HorizontalAlign="Justify" />
                            <HeaderTemplate>
                             <asp:CheckBox id="headerChkbox"  runat="server" onclick="SelectAll(this)"></asp:CheckBox>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox id="CheckBox1" runat="server"></asp:CheckBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                   
                     <telerik:GridBoundColumn DataField="TOKEN" Visible="false" UniqueName="TOKEN" ReadOnly="true" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FIRST NAME" HeaderText="FIRST NAME" UniqueName="FIRST NAME">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LAST NAME" HeaderText="LAST NAME" UniqueName="LAST NAME">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="STATUS" HeaderText="STATUS" UniqueName="STATUS">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DESIGNATION" HeaderText="DESIGNATION" UniqueName="DESIGNATION">
                    </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" Position="TopAndBottom" />
                    
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="True">
                    <Resizing AllowColumnResize="True" />
                    <Selecting AllowRowSelect="True" />                    
                    <ClientEvents OnFilterMenuShowing="OnFilterMenuShowing"></ClientEvents> 
                    </ClientSettings>
                <FilterMenu EnableTheming="True">
                    <CollapseAnimation Type="None" />
                    <ExpandAnimation Type="None" />
                </FilterMenu>
            </telerik:RadGrid>

Christophorus Donny
Top achievements
Rank 1
 answered on 24 Aug 2017
6 answers
746 views
Hi Telerik,

since the Version 2013.1.220.35 we have a problem accessing data on the "old" way.

If you have a GridBoundColumn, which is set to Visible=false, the Text Field is not rendered anymore.

So an access like
GridDataItem item = e.Item as GridDataItem;
 
string Value = item["columnID"].Text;

does not work anymore. I get a " &nbsp;" as result.

I know, that this is not the correct way, to access data. We do it like
string Value = item.GetDataKeyValue("ID")

in most scenarios. (<MasterTableView DataKeyNames="ID">) needed of course.


But is this a feature in the new Version, or is it a bug.
We have to clear this, because we will have many adaptions in the application, if this is not supported anymore!

Thanks for your help.

KR

Lars






Christophorus Donny
Top achievements
Rank 1
 answered on 24 Aug 2017
0 answers
106 views

Hello Folks,

I am facing this problem from past one week. I request one and all to help me out ASAP if you have the solution.

We  are working with an application in ASP.NET Framework [ 3.5] and using Telerik [2009.1.527.35] version.

One of the page(.aspx) has tab panel inside. In tab we have ‘Add’ Icon where it can open popup. This page has two JavaScript reference files i.e, File1.js and File2.js

In File1.js -> In document.ready, we calling the ‘Function1()’ as Sys.WebForms.PageRequestManager.getInstance().add_endRequest(Function1);
Function1 () – sets to varFromChange to False.

In File2.js --> In PageLoad() method we are calling the ‘Function2()’as  Sys.WebForms.PageRequestManager.getInstance().add_endRequest(Function2);
Function2 () – sets to varFromChange to True. 

 

Telerik.Web.UI.WebResource.axd library file has to execute these functions sequentially i.e., Function1() and Function2(). But in some scenarios these functions are not executing sequentially. We could not able to debug this functions as these are calling by Telerik library.

Due to this issue page data is not getting saved.


Here is Stack Trace :

Function2 [Line: 253, Col: 5], File2.js

Anonymous function [Line: 6, Col: 29366], Telerik.Web.UI.WebResource.axd
Sys.WebForms.PageRequestManager.prototype._endPostBack [Line: 15, Col: 9894], Telerik.Web.UI.WebResource.axd
Sys.WebForms.PageRequestManager.prototype._scriptsLoadComplete [Line: 15, Col: 26829], Telerik.Web.UI.WebResource.axd
Anonymous function [Line: 6, Col: 195], Telerik.Web.UI.WebResource.axd
Anonymous function [Line: 6, Col: 298], Telerik.Web.UI.WebResource.axd
Sys._ScriptLoader.prototype._loadScriptsInternal [Line: 6, Col: 44836], Telerik.Web.UI.WebResource.axd
Sys._ScriptLoader.prototype._loadScriptsInternal [Line: 6, Col: 44744], Telerik.Web.UI.WebResource.axd
Sys._ScriptLoader.prototype._loadScriptsInternal [Line: 6, Col: 44744], Telerik.Web.UI.WebResource.axd
Sys._ScriptLoader.prototype._nextSession [Line: 6, Col: 45193], Telerik.Web.UI.WebResource.axd
Sys._ScriptLoader.prototype._loadScriptsInternal [Line: 6, Col: 44844], Telerik.Web.UI.WebResource.axd
Sys._ScriptLoader.prototype._nextSession [Line: 6, Col: 45193], Telerik.Web.UI.WebResource.axd
Sys._ScriptLoader.prototype.loadScripts [Line: 6, Col: 43462], Telerik.Web.UI.WebResource.axd
Sys.WebForms.PageRequestManager.prototype._onFormSubmitCompleted [Line: 15, Col: 19820], Telerik.Web.UI.WebResource.axd
Anonymous function [Line: 6, Col: 298], Telerik.Web.UI.WebResource.axd
Anonymous function [Line: 6, Col: 29366], Telerik.Web.UI.WebResource.axd
Sys.Net.WebRequest.prototype.completed [Line: 6, Col: 67411], Telerik.Web.UI.WebResource.axd
_onReadyStateChange [Line: 6, Col: 62071], Telerik.Web.UI.WebResource.axd

Thanks in advance,

Radhakrishna G


Radhakrishna
Top achievements
Rank 1
 asked on 23 Aug 2017
0 answers
144 views

I have the following code in my web page.  I want to use static headers and allow users to be able to scroll within a RadGrid.  Here is the code:

<table>
        <tr>
            <td>
                    <asp:gridview ID="gvSites"
                                  runat="server"
                                  AutoGenerateColumns="false"
                                  ShowHeader="true"
                                  HeaderStyle-HorizontalAlign="Left"
                                  ItemStyle-HorizonitalAlign="Left"
                                  ClientSettings-Scrolling-AllowScroll="true"
                                  ClientSettings-Scrolling-UseStaticHeaders="true"
                                  Height="575px">
                        <Columns>
                            <asp:TemplateField ItemStyle-Width="100px">
                                <ItemTemplate>
                                    <asp:Label ID="lblSiteCode" HeaderText="Site Code" runat="server" Text='<%# Eval("SiteCode")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField> 
                            <asp:TemplateField ItemStyle-Width="130px">
                                <ItemTemplate>
                                    <asp:Label ID="lblBranchNumber" HeaderText="Branch Number" runat="server" Text='<%# Eval("BranchNumber") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField> 
                            <asp:TemplateField ItemStyle-Width="150px">
                                <ItemTemplate>
                                    <asp:Label ID="lblLocationName" HeaderText="Location Name" runat="server" Text='<%# Eval("LocationName") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>    
                    </Columns>                 
                </asp:gridview>
            </td>
        </tr>
</table>

But none of my header text is displaying.  What am I doing wrong?

 

Bob
Top achievements
Rank 1
 asked on 23 Aug 2017
2 answers
90 views

Very simple case, the X-axis has dates, but the day _before_ is being shown on the access.  Date input looks like:

2017/8/7

2017/814

But 0/6 and 8/13 are shown.  See attachment.  This happens in all cases regardless of number of records.

<telerik:RadHtmlChart ID="burndownChart" runat="server" DataSourceID="dsBurndown" Skin="Web20">
            <PlotArea>
                <XAxis DataLabelsField="WeekDate">
                </XAxis>
                <YAxis Name="$">
                </YAxis>
                <Series>
                    <telerik:AreaSeries AxisName="$" DataFieldY="Spent" Name="Spent" Stacked="True">
                        <LabelsAppearance Visible="true" DataField="WeekDate"></LabelsAppearance>
                    </telerik:AreaSeries>
                    <telerik:AreaSeries AxisName="$" DataFieldY="Remaining" Name="Remaining" Stacked="True">
                    </telerik:AreaSeries>
                </Series>
            </PlotArea>
        </telerik:RadHtmlChart>
Marin Bratanov
Telerik team
 answered on 23 Aug 2017
7 answers
301 views

I have (tried) to configure our app as per http://docs.telerik.com/devtools/aspnet-ajax/controls/captcha/troubleshooting/using-webfarm-or-webgarden-environment, but am missing some important detail as I cannot get the Captcha default validation to work. The user inputs the Captcha.Text in a textbox (ValidatedTextBoxID="rcTextBox1"). I can trace a test scenario where the Page_load is executed on one application processor and the Post_back is executed on a second application processor. The Captcha.Text in the post_back is from a different(local, initialized) CaptchaImage (a new CaptchaImage.Text and noCaptchaImage.PreviousText).  I can pass the original Captcha.Text in Session (sql server) and over-ride the default verification using the user input so I have a work-around. But my expectation is the default Captcha should work "out-of-the-box". I somehow expected I should be able to pass the original CaptchaImage created in the Page_Load to be used in the Post_back. I can save the original image ( Session["CaptchaImage"] = Captcha.CaptchaImage) from the Page_Load but I can't get RadCaptcha to use it directly. I can't set the Captcha.CaptchaImage or Captcha.CaptchaImage.Text from Session as these are only Getters.

Questions:

1)  If I set mageStorageLocation="Session" why doesn't the control do the equivalent of a Session["CaptchaImage"] = Captcha.CaptchaImage / Captcha.CaptchaImage = Session["CaptchaImage"] for me.

2) If I must save the CaptchaImage in Session, what do I do with it on th ePost_back?

3) Why does ValidatedTextBoxID="rcTextBox1") cause the rcTextBox1.Text to be ""? I had to copy it to a HiddenField with JavaScript to retrieve the use input.

 

Marin Bratanov
Telerik team
 answered on 23 Aug 2017
1 answer
294 views

How can I force the post back of the RadSearchBox (onSearch event) when someone chooses one of the items from the ContextList? I want to be able to change a secondary list when an item from the ContextSearch is changed (just like they entered something in the search window and clicked search).  I tried to fire the postback of the SearchBox but it doesn't seem to be returning it to the server to process the items selected.  It seems to fire the panel update, but not the server side OnSearch event.

 

                        <telerik:RadSearchBox ID="RadSearchBox1" runat="server" RenderMode="Lightweight"
                                              DataTextField="DiagForList" MaxResultCount="15"
                                              EmptyMessage="Search/Select Order to left"
                                              DataValueField="DiagnosisCodeID"
                                              DataKeyNames="MapField"
                                              style="margin-left: 10px; margin-top: 1px;"
                                              Width="440px" HighlightFirstMatch="True"
                                              SearchContext-Enabled="true"
                                              DataSourceID="SqlDataSourceDG"
                                              OnClientSearch="OnClientSearch"
                                              ToolTip="Select the order from the drop down and/or search for a diagnosis."
                                              OnDataSourceSelect="RadSearchBox1_DataSourceSelect"
                                              OnSearch="RadSearchBox1_Search" MinFilterLength="3">
                        <SearchContext DataSourceID="SqlUpdateABNFlag" DataTextField="MapField" DataKeyField="MapField" DropDownCssClass="contextDropDown"  />
                        <DropDownSettings Width="500px" />
                        <Localization DefaultItemText="All Orders" LoadingItemsMessage="Loading...." />
                        </telerik:RadSearchBox>

 

 

Script:

 

    function pageLoad() {
        var $ = $telerik.$;
        $(".rsbSCSlide ").on("click", ".rsbListItem", function (e) {
            e.preventDefault();
            RaiseClickEvent('RadSearchBox1');
                });

    }
    function RaiseClickEvent(id) {
      __doPostBack(id,'arguments'');
    }

 

Peter Milchev
Telerik team
 answered on 23 Aug 2017
1 answer
2.5K+ views

Why am I getting this error in Visual Studio 2012 all of a sudden? No problem yesterday, today I get this:

Could not load file or assembly 'Telerik.Web.UI, Version=2015.3.1111.45, Culture=neutral,
PublicKeyToken=121fae78165ba3d4' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003
(E_POINTER))' G:\TFS_TMS\Sprint0\NextGenerationSourceCode-Sprint0\TMS2016\TMS2016\LC TMS2016

 

????????

Rumen
Telerik team
 answered on 23 Aug 2017
0 answers
102 views
I am trying to export a page to PDF that contains RadHtmlCharts, but I am getting a RadAjaxManager error.
Here is the html:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<telerik:RadHtmlChart ChartTitle-Text="Overall" runat="server" ID="rcOverall" Width="600px" Height="400px" Skin="Bootstrap" DataSourceID="sqlOverall" RegisterWithScriptManager="false">
            <PlotArea>
                <Series>
                    <telerik:BarSeries Name="BarSeries1" DataFieldY="points">
                        <LabelsAppearance Visible="false" />
                        <TooltipsAppearance Visible="false" />
                    </telerik:BarSeries>
                </Series>
                <XAxis DataLabelsField="Section" >
                    <TitleAppearance Text="Section">
                        <TextStyle FontSize="12" Bold="true" />
                    </TitleAppearance>
                </XAxis>
                <YAxis Visible="false" MinValue="0" MaxValue="27" Step="3">
                    <TitleAppearance Text="Total Mark">
                        <TextStyle FontSize="12" Bold="true" />
                    </TitleAppearance>
                </YAxis>
            </PlotArea>
            <Legend>
                <Appearance Visible="false" />
            </Legend>
        </telerik:RadHtmlChart>
The code to export is:
 Response.ContentType = "application/pdf"
   
        Response.AddHeader("content-disposition", "attachment;filename=Image.pdf")
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
         Dim sw As New StringWriter()

        Dim hw As New HtmlTextWriter(sw)
        Me.Page.RenderControl(hw)

        Dim srdr As New StringReader(sw.ToString())

        Dim pdfDoc As New Document(PageSize.A4, 15.0F, 15.0F, 75.0F, 0.2F)

        Dim hparse As New HTMLWorker(pdfDoc)
        
        PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
        pdfDoc.Open()

        hparse.Parse(srdr)

        pdfDoc.Close()

        Response.Write(pdfDoc)
        Response.[End]()
When I run it I get an error:
Script control 'RadAjaxManager1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Can anyone please help with this as I have looked everywhere and anything I have tried doesn't work!!!.
Any help would be very welcome. 
Thanks
K
K W
Top achievements
Rank 1
 asked on 23 Aug 2017
3 answers
202 views
Hi,

I am using rad editor in me current project,the scenario is that I every user in database has a table of members having varying Fields in table. i e. these field are dynamic in nature and thus varies based on used.these dynamic fields need to be places in html inside the rad editor so that I can change the value of these fields programatically in HTML.

in my current implementation I validates the HTML on server to check if user has written these fields in HTML (format is like %%MemberName%% or may be something else enclosed in %%%%) then I replaces these values programatically with valid values.

But now according to our client's requirement he want a right click context menu, or drop down list or button on rad editor toolbar to display  and choose these dynamic fields so that the user dont need to remember which fields are dynamic and he can just select those fields to insert in email template in rad editor.

How can I achieve this.Please help me ?? or provide some better alternative?
Rumen
Telerik team
 answered on 23 Aug 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?