Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
67 views
I am wanting to use a cookie to remember the grid page number so when users go to a detail page and then come back it will remember the page number the grid was on. I have the code below to read the cookie, but I am not sure when in the grid life cycle I should set the CurrentPageIndex. Thanks in advance.

if (CookieUtilities.HasCookieItemValue("crl", "PGN"))
{
    int result;
    if (int.TryParse(CookieUtilities.GetCookieItemValue("crl", "PGN"), out result))
    {
        if (rgSalesCallList_SalesCallReportList.PageCount > result)
        {
            rgSalesCallList_SalesCallReportList.CurrentPageIndex = result;
        }
        else
        {
            rgSalesCallList_SalesCallReportList.CurrentPageIndex = rgSalesCallList_SalesCallReportList.PageCount - 1;
        }
    }
}
Radoslav
Telerik team
 answered on 10 Nov 2010
4 answers
382 views
I'm loading a UserControl from my page markup.

The page has a RadStylesheetManager on it.

I want to ensure my page has a particular stylesheet loaded and I don't want to rely on the developer using the control loading the stylesheet on the page explicitlt. So I thought that something like this might work ...
RadStyleSheetManager mgr = Page.Items[typeof(RadStyleSheetManager)] as RadStyleSheetManager;
if (mgr != null)
{
    StyleSheetReference ss = new StyleSheetReference();
    ss.Path = Page.ResolveUrl("~/StyleSheets/Popup/InlinePopups.css");
    ss.Name = "InlinePopups";
    mgr.StyleSheets.Add(ss);
}

Now mgr is being correctly populated. But when the page runs, I get this ...
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace:
 
 
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.ScriptEntrySlot.GetSerializedAssemblyInfo(ScriptEntry scriptEntry) +208
   Telerik.Web.UI.ScriptEntrySlot.SerializeScriptEntry(ScriptEntry scriptEntry) +71
   Telerik.Web.UI.ScriptEntryUrlBuilder.TryAddScriptEntry(ScriptEntry scriptEntry) +56
   Telerik.Web.UI.ScriptEntryUrlBuilder.RegisterScriptEntry(ScriptEntry scriptEntry) +237
   Telerik.Web.UI.RadStyleSheetManager.Page_PreRenderComplete(Object sender, EventArgs e) +373
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8701886
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1029

So, what am I doing wrong?

-- 
Stuart
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.ScriptEntrySlot.GetSerializedAssemblyInfo(ScriptEntry scriptEntry) +208
   Telerik.Web.UI.ScriptEntrySlot.SerializeScriptEntry(ScriptEntry scriptEntry) +71
   Telerik.Web.UI.ScriptEntryUrlBuilder.TryAddScriptEntry(ScriptEntry scriptEntry) +56
   Telerik.Web.UI.ScriptEntryUrlBuilder.RegisterScriptEntry(ScriptEntry scriptEntry) +237
   Telerik.Web.UI.RadStyleSheetManager.Page_PreRenderComplete(Object sender, EventArgs e) +373
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8701886
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +10
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.ScriptEntrySlot.GetSerializedAssemblyInfo(ScriptEntry scriptEntry) +208
   Telerik.Web.UI.ScriptEntrySlot.SerializeScriptEntry(ScriptEntry scriptEntry) +71
   Telerik.Web.UI.ScriptEntryUrlBuilder.TryAddScriptEntry(ScriptEntry scriptEntry) +56
   Telerik.Web.UI.ScriptEntryUrlBuilder.RegisterScriptEntry(ScriptEntry scriptEntry) +237
   Telerik.Web.UI.RadStyleSheetManager.Page_PreRenderComplete(Object sender, EventArgs e) +373
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8701886
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +
Stuart Hemming
Top achievements
Rank 2
 answered on 10 Nov 2010
1 answer
49 views
Looks like everything updated today :)
Dimo
Telerik team
 answered on 10 Nov 2010
16 answers
385 views
Hi,

I have two issues:
- I set CaptchaImage-CharSet to "ABCDEFGHJKLMNPQRSTUVWXYZ123456789" but Captcha still generate "O" character. See sample.png.
- when I enter valid code and I go back in the browser then captcha image is still valid with same code - I can valid code only first time and send control to robot (when robot simulate go back then I needn't enter new code).

Can you help me please?

ASP.NET AJAX Q1 2010 SP1

Kamil
Pero
Telerik team
 answered on 10 Nov 2010
2 answers
69 views
I am using your scheduler control to perform scheduling of activities.  The control is displayed exclusively in the month view.

When a date is clicked, the app will open a RadWindow to create an appointment for the selected date.  After processing the appointment, the popup window is closed.  After that point the scheduler will no longer handle SwitchToSelectedDay events.  Clicking the calendar will continue to generate postbacks with the event data, but the code to handle the event is no longer fired.

Why?
Rich
Top achievements
Rank 1
 answered on 10 Nov 2010
5 answers
225 views
Hi all!
 I created a template for editmode. And set
EditMode="EditForms"

When click on "Edit", it shows correctly what I designed.
But the Checkbox doesn't automatically checked.
I mean when I edit a specific row, the checkbox of that row should be set to TRUE. Please attack the pics!
(This problem doesn't happen when EditMode="InPlace")

Thanks!

Andy.
Andy
Top achievements
Rank 1
 answered on 10 Nov 2010
2 answers
156 views
How can an animation be displayed while a grid is loading?
Rich
Top achievements
Rank 1
 answered on 10 Nov 2010
1 answer
348 views

I need to create a Javascript that does the following:

  1. Detect when the first key is pressed in the RadEditor

  2. Locate the cursor

  3. Programatically insert a piece of text where the cursor is

  4. Allow the normal process to continue, ie the key pressed by the user is to be added immediately after where I added the text.

I managed to do this for non-telerik normal text areas.  But it is giving me big problems with telerik RadEditor.Net2.dll version 7.2.0.0

On clientload of rad editor I am adding a KeyPress event handler.  However, in keypress method I am unable to get the cursor position.  I am using this script:

 

function getCaret(editor) {

if (editor.selectionStart) {

return editor.selectionStart;

}

else if (!document.selection) {

return 0;

}

var c = "\001";

var sel = document.selection.createRange();

var dul = sel.duplicate();

var len = 0;

dul.moveToElementText(editor); <-- GIVES JAVASCRIPT EXCEPTION OVER HERE

sel.text = c;

len = dul.text.indexOf(c);

sel.moveStart('character', -1);

sel.text = "";

return len;

}

What do you recommend?  Am I approaching this incorrectly for RadEditor?  I really need to get this working!

 

Rumen
Telerik team
 answered on 10 Nov 2010
1 answer
115 views
Hi All,

How can i get filtering my RadGrid with text? For Example in the slider 7 different Colour.
a  b  c  d  e  f  g 
and in the default view table will show products all of this colours
when user draging slider from a to b
i want to showing products which coloured b c d e f g in my RadGrid

When it is all numbers in DB it is ok. No Problem but when i wanted filtering with text really confused.

Hope to hear you soon.
Regards
.

<

 

 

telerik:RadSlider runat="server" ID="RadSlider1" IsSelectionRangeEnabled="true"

 

 

 

MinimumValue="0" MaximumValue="300" SmallChange="1" SelectionStart="0" SelectionEnd="300"

 

 

 

OnClientValueChanging="OnClientValueChanging" OnValueChanged="RadSlider1_ValueChanged"

 

 

 

OnClientSlideStart="OnClientSlideStart" OnClientSlideEnd="OnClientSlideEnd" AutoPostBack="true"

 

 

 

ShowDecreaseHandle="false" ShowIncreaseHandle="false" />

 

SelectionStart: $

 

<asp:Label ID="lblSelectionStart" runat="server" Text="0"></asp:Label><br />

 

SelectionEnd: $

 

<asp:Label ID="lblSelectionEnd" runat="server" Text="300"></asp:Label>

 



 

 

Protected Sub RadSlider1_ValueChanged(ByVal sender As Object, ByVal e As EventArgs)

 

lblSelectionStart.Text = RadSlider1.SelectionStart.ToString()

lblSelectionEnd.Text = RadSlider1.SelectionEnd.ToString()

RadGrid1.Rebind()

 

 

End Sub


 

SelectCommand

 

 

="SELECT * FROM [Products] INNER JOIN [Suppliers] ON Products.SupplierID=Suppliers.SupplierID WHERE (UnitPrice &gt; @MinimumPrice) AND (UnitPrice &lt; @MaximumPrice) AND (UnitsInStock &gt; @MinimumStock) AND (UnitsInStock &lt; @MaximumStock) AND (CategoryID &gt; @MinimumCategory) AND (CategoryID &lt; @MaximumCategory)">

 

 

 

 

 

 

 

<asp:ControlParameter ControlID="RadSlider1" PropertyName="SelectionStart" Name="MinimumPrice" />

 

Tsvetie
Telerik team
 answered on 10 Nov 2010
3 answers
257 views
hello everyone,

I am working with the radgrid and I have issue where paging is not working.  Let me be more specific: set page size isn't working and going to individual pages using the "go" button isn't working. 

I have tried everything i can think of.

<telerik:RadAjaxPanel runat="server" ID="rapResource" LoadingPanelID="ralpResource"> 
    <telerik:RadGrid ID="rgResourceList" runat="server" AllowPaging="true" PageSize="15" > 
        <MasterTableView AutoGenerateColumns="false" PageSize="15" AllowPaging="true"> 
            <Columns> 
                <telerik:GridTemplateColumn UniqueName="JobLinks" HeaderText="" /> 
                <telerik:GridTemplateColumn UniqueName="Tech" HeaderText="Technician" /> 
                <telerik:GridTemplateColumn UniqueName="Program" HeaderText="Program" Visible="false" /> 
                <telerik:GridTemplateColumn UniqueName="JobNumber" HeaderText="JobNumber" Visible="false" /> 
                <telerik:GridTemplateColumn UniqueName="ETA" HeaderText="ETA" /> 
                <telerik:GridTemplateColumn UniqueName="ETC" HeaderText="ETC" /> 
                <telerik:GridTemplateColumn UniqueName="Phone" HeaderText="Phone" /> 
                <telerik:GridTemplateColumn UniqueName="City" HeaderText="City" Visible="false" /> 
                <telerik:GridTemplateColumn UniqueName="State" HeaderText="State" Visible="false" /> 
                <telerik:GridTemplateColumn UniqueName="WorkOrder" HeaderText="WorkOrder"> 
                    <ItemTemplate> 
                        <asp:ImageButton runat="server" ID="ibtnPrint" ImageUrl="~/Images/iconPrint.png" 
                            AlternateText="" ToolTip="Print Work Order" /> 
                        <asp:ImageButton runat="server" ID="ibtnEmail" ImageUrl="~/Images/iconEmail.gif" 
                            AlternateText="" ToolTip="Email Work Order" /> 
                        <asp:ImageButton runat="server" ID="ibtnEmailAttach" ImageUrl="~/Images/iconEmailAttach.gif" 
                            AlternateText="" ToolTip="Email as Attachment" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 
</telerik:RadAjaxPanel> 
<telerik:RadAjaxLoadingPanel runat="server" ID="ralResource" /> 

Any help would be greatly appreciated....

Thanks,

-zd



Radoslav
Telerik team
 answered on 10 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?