Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
I have the following method which adds a new GridCalculatedColumn to my Grid.

protected void AddCalculatedColumn(string headerText, string expression, string dataFormatString, params string[] dataFields)
        {
            var calculatedColumn = new GridCalculatedColumn
            {
                DataFields = dataFields,
                HeaderText = headerText,
                Expression = expression,
                DataFormatString = dataFormatString,               
            };


            Product.Columns.Add(calculatedColumn);
        }

I pass 2 decimal values data fields and the expression is "{0}/({0}+{1})" and it throws a divide by 0 exception.

How to handle that when {0} or/and {1} is null then the total value which is displayed to be 0 instead of throwing this exception?

What can be set as an expression?

Thanks,
Pooya
Top achievements
Rank 1
 answered on 12 Sep 2011
1 answer
129 views

Hello All,

    I am developing a web application in which i have RadGrid. In the RadGrid Edit button, I am calling a Javascript function which will get the geocodes and writes in to the hidden fields. Now the problem is, If I put the alert message in that function,  I can see the geocodes properly. If i remove the alert message, the hidden fields are blank.

I guess the  probelm is, I am reading those hidden field values from code behind before the page loads completly.

Here is my javascript

        function initiate_geolocation() {  
                 navigator.geolocation.getCurrentPosition(handle_geolocation_query);  
                alert('delay to get the geocodes');
             return false;
         }

 

       function handle_geolocation_query(position){  
        enableHighAccuracy: true
                                
              
                  var lat = '<%=hidLat.ClientID %>';
                   var lon  = '<%= hidLong.ClientID %>';
                
                                           
                  document.getElementById(lat).value = position.coords.latitude;
              
                  document.getElementById(lon).value = position.coords.longitude;
                  
                 } 

And in the code behind, in the item data bound event

i added the attributes for the edit button and called the javascript function

  Dim editButton As ImageButton = DirectCast(item.FindControl("EditButton"), ImageButton)
  editButton.Attributes.Add("OnClick", "initiate_geolocation();")


Im trying to access those hidden fields in the update command event of the Radgrid

Is there something to do to let the form load completly and then read those hidden fields? How do I get out of this problem?

Appreciate the Help!

Thanks

Daniel
Telerik team
 answered on 12 Sep 2011
1 answer
80 views

Can we open a pannel from a button click?
Cat Cheshire
Top achievements
Rank 1
 answered on 12 Sep 2011
1 answer
280 views
i have a radnumeric text box in my app and it's crashing - getting alot of issues with datatype it seems

<telerik:RadNumericTextBox ID=theAmount1" 
dbValue='<%# Bind(theAmount") %>' 
MinValue="1" 
NumberFormat-DecimalDigits="2" 
DataType="System.Decimal"
Type="Currency"
runat="server">
</telerik:RadNumericTextBox>

here's the error

Server Error in '/' Application. 

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Cannot create an object of type 'System.Type' from its string representation 'System.Decimal' for the 'DataType' property.

Source Error: 
Line 206: <telerik:RadNumericTextBox ID="theAmount1" 
Line 207: dbValue='<%# Bind(theAmount") %>' 
Line 208: MinValue="1"  

here's another one

<telerik:RadNumericTextBox ID="theYears1" DbValue='<%# Bind("theYears") %>'
Width="60px" runat="server"
DataType="System.Int16" 
MinValue="0" NumberFormat-DecimalDigits="0">
</telerik:RadNumericTextBox>

Server Error in '/' Application. 

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Cannot create an object of type 'System.Type' from its string representation 'System.Int16' for the 'DataType' property.

Source Error: 

Line 154: <telerik:RadNumericTextBox ID="theYears1" DbValue='<%# Bind("theYears") %>'
Line 155: Width="60px" runat="server"
Line 156: DataType="System.Int16"  

and another one

<telerik:RadNumericTextBox ID="theDebt1" 
Type="Currency" 
DataType="System.Decimal"
dbValue='<%# Bind("theDebt") %>'
NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" 
Width="90px" 
runat="server">
</telerik:RadNumericTextBox>

Server Error in '/' Application. 

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Cannot create an object of type 'System.Type' from its string representation 'System.Decimal' for the 'DataType' property.

Source Error: 
Line 375: <telerik:RadNumericTextBox ID="theDebt1" 
Line 376: Type="Currency" 
Line 377: DataType="System.Decimal"  

How do I fix this - any ideas?


Vasil
Telerik team
 answered on 12 Sep 2011
0 answers
135 views
Update - turns out it's a separate ajax problem, nothing to do with RadNotification. Please close this thread, thanks.

I'm using RadNotification in conjunction with the Timer control.
The RadNotification gets displayed at regular intervals.
When I scroll to the bottom of the page and RadNotification gets displayed, it brings me back to the top of the page.
Is there a way to retain the scroll position?
Andy
Top achievements
Rank 1
 asked on 12 Sep 2011
1 answer
100 views
Hello !

Just started working with telerik components about 2 weeks ago, documentation and help on forums is great !! I've been able to solve most of my issues using those. But now i have encountered an issue that i cannot seem to solve or find any info on.

I have a RadGrid inside a RadCombo, i have set several of the ComboBox's events to stop it from closing, for example :
<telerik:RadComboBox Id="RadComboBox1" Width="200px" runat="server"
            MarkFirstMatch="False" AllowCustomText="False" OnClientDropDownOpening="OnClientDropDownOpening" OnClientDropDownClosing="OnClientDropDownClosing"
            OnClientSelectedIndexChanging="OnClientSelectedIndexChanging" OnClientBlur="OnClientBlur" DropDownWidth="500px">
 
And the function looks like this:

var supressDropDownClosing = false;
 
function OnClientDropDownClosing(sender, eventArgs) {
    eventArgs.set_cancel(supressDropDownClosing);
}

That way i can avoid closing the dropdownlist when clicking on a checkbox or opening a hierarchy.

Now the real problem is when i use the filters on the gridview, when i type in the filter textbox and then select, for example "Contains", the comboBox closes and shows the filtered items. I haven't been able to figure out how to stop the combo from closing when selecting the filter type. I saw something about StopPropagation and wiring it to the event, but how do i get access to the event that fires when i click the "contains" inside the filter ?

Thanks in advance for any help, if additional info is needed, i'll try and elaborate.



Cat Cheshire
Top achievements
Rank 1
 answered on 12 Sep 2011
2 answers
173 views
Hi all,

I'm using grid and export data into excel file, but I want to make cells alignment center, also when I checked "Enable filtering" text boxes HTML exported also to excel, so how I can hide this in file?
Also can I add logog or any other content in the first row cells of excel??

Please advise.
Regards
Julian
Top achievements
Rank 1
 answered on 12 Sep 2011
1 answer
82 views
I have ASP.Net Ajax Q3 2010 installed and running on my machine. My machine has VS 2010 installed but not 2008.

When I try to install ASP.Net Ajax Q2 2011, I make sure to tell it not to install the 2008 Extensions and it seems to work fine. But almost at the end of the install, a message box comes up saying:

    Unable to setup Visual Studio 2008 templates. Please repair Visual Studion 2008 or disable the Visual Studion 2008 integration
    feature before attempting another install.

Any suggestions?

TIA - Jeff.
Erjan Gavalji
Telerik team
 answered on 12 Sep 2011
1 answer
122 views
Hi Telerik-Team,

Information:
I am just working on a DNNModule containing a simple flat Grid.
I implemented a Button to get all Items in the Grid in EditMode at the same time. This is working correctly.
Now I implemented a OnTextChanged-Event on every Textbox in the EditForm and in this Event I want to close all other EditForms but leave opened my current Form where I currently changed a value in a Textbox.

Problem:
Now I noticed that all Textboxes are correctly working in the Editforms concerning the OnTextChanged-Event. Instead of one:
I noticed that a Textbox with "TextMode=MultiLine" (TextArea) working not correctly it fires the OnTextChanged-Event but I dindt enter anything it this textbox.

for example (these are GridRows all in EditMode:
1. [TextBox], [Label], [TextArea]
2. [TextBox], [Label], [TextArea]
3. [TextBox], [Label], [TextArea]

Now if I enter some data in the TextBox 3 and get out with the Focus the TextArea 1 is fireing a OnTextChanged-Event.
But I changed the Text only in TextBox3 not in TextArea1.
My Problem is that now the Event will close the EditForm of row 2 and 3 and leave the editform of Row1 opened. But I just want to leave the row3 in EditMode and close 1 and 2. the Event in TextArea is fireing itself autonomous
I noticed that there are some JavaScript "OnChange" Entires in the TextArea:
javascript:setTimeout('WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions
("dnn$ctr417$myUserControl$myGrid$ctl00$ctl07$myTextArea", "", true, "", "", false, true))', 0)

Is it possible that this javascript is fireing the OnTextChanged event? And if Why does the Grid create this OnChange-Event?

I appreciate getting hints or tips from you.


best regards,

Marc
Vasil
Telerik team
 answered on 12 Sep 2011
5 answers
478 views
Hello

I'm trying to do something similar to what is shown in Controls --> RadAjax --> General FAQ and How-to -->Load user controls in the documentation.

I have a RadSplitter with 3 panes on a MasterPage.  The left pane contains a couple buttons that expand the middle pane when clicked - the middle pane contains a PlaceHolder control and I load in the user control as follows:

        Me.oCtrlDemo = LoadControl("~\user_controls\events_pane.ascx")
        Me.PlaceHolder1.Controls.Add(Me.oCtrlDemo)

So far so good.  This UserControl contains a list of 5 buttons, and each button calls a JavaScript function as follows (the JavaScript functions are declared at the top of the UserControl within a RadCodeBlock):

<asp:ImageButton ID="btnGridReport" runat="server" ImageUrl="~/images/events/document.png"
     onclientclick="show_EventInfoGrid(); return false;" ToolTip="Event Info Grid" />

When AJAX is disabled, I can click on a button in the UserControl and the JavaScript function is called - however, when AJAX is enabled, I get an error that the JavaScript function (show_EventInfoGrid()) cannot be found.  

Here is the AjaxManager code from the MasterPage:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="btnEventsUsers">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="PlaceHolder1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="btnSecurityPane">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="PlaceHolder1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>


Have been struggling with this - any suggestions greatly appreciated

Thanks

Brian
jose luis
Top achievements
Rank 1
 answered on 12 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?