Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
84 views
Hello,

I have a page with a grid and some labels. On grid item command event (grid is ajax enabled with RadAjaxManager) I want to do some code and then return an alert with the results. The following code works (shows the alert) in IE, Chrome and Opera, but not in Firefox.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    DefaultLoadingPanelID="RadAjaxLoadingPanel1"
    onajaxrequest="RadAjaxManager1_AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="MyGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="MyGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="MyGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="MyButton">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Label1" />
                <telerik:AjaxUpdatedControl ControlID="Label2" />
                <telerik:AjaxUpdatedControl ControlID="Label3" />
                <telerik:AjaxUpdatedControl ControlID="Label4" />
                <telerik:AjaxUpdatedControl ControlID="Label5" />
                <telerik:AjaxUpdatedControl ControlID="Label6" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

protected void MyGrid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if(e.CommandName == "MyCommand")
    {
        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('StartupScript');", true); 
        RadAjaxManager1.ResponseScripts.Add("alert('ResponseScripts');");
    }
}

Any ideas?

Thanks in advance.
Marco
Top achievements
Rank 1
 answered on 10 Nov 2011
2 answers
121 views
This is the old sample, it works for me: 
http://demos.telerik.com/aspnet-classic/controls/examples/integration/aspnetajax/autosaveradeditor/defaultCS.aspx
    
Here are my steps
  1. In "Design View", I insert a "Textbox".
  2. Swith to "Preview", click the newly add Textarea, typein "abc".
  3. Swith to "Html" view, I can see my input was taken - it was changed to <INPUT style="WIDTH: 100px; HEIGHT: 22px" value=abc>


I tried same steps for the new sample, but I can not see "value=abc" added:
http://demos.telerik.com/aspnet-ajax/editor/examples/autosave/defaultcs.aspx

Please point to me what I missed (or it is a bug?), thanks for your help!

Stanley
Top achievements
Rank 1
 answered on 10 Nov 2011
1 answer
159 views
Hi,

I'm using a Radgrid in my web project, I'm having issues getting the Radgrid's height to size according to the content.
Basically I wish to have the radgrid take up full height and width of the page.
I need to use vertical and horizontal bars should it overflow and using static headers, as well as the columns to be inline with the header.

My page is within a masterpage and radgrid within an ajaxpanel, I have tried the radgrid within a table setting parent to 100% height & width 100%, as well as the ajaxpanel.

But still no luck at getting the desired outcome.
Any assistance would be greatly appreciated.

Thanks in advance.

(Below code I'm using)


      <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" Height="100%">
              
       <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/jscript">
            function myRefreshGrid() {
                var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                masterTable.rebind();
            }


            function OnClientPageLoad(sender, args) {
                setTimeout(function() {
                    sender.set_status("");
                }, 0);
            }


            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }


           
        </script>    
       </telerik:RadScriptBlock>

        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="odsSiteDetails" GridLines="None" ShowFooter="True" AllowFilteringByColumn="True" AutoGenerateColumns="False" Height="100%" Width="100%">
            <AlternatingItemStyle Wrap="False" /><ItemStyle Wrap="False" />
            <MasterTableView DataKeyNames="ID" DataSourceID="odsSiteDetails" TableLayout="auto" Width="100%">
                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                <RowIndicatorColumn Visible="False"><HeaderStyle Width="40px" /></RowIndicatorColumn>
                <ExpandCollapseColumn><HeaderStyle Width="40px" /></ExpandCollapseColumn>
                <Columns>
                 <telerik:GridButtonColumn CommandName="Select" Text="Edit" UniqueName="cmdSelect"></telerik:GridButtonColumn>
                 <telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="Charts" HeaderText="" CommandName="Charts" ImageUrl="~/Images/chart.png"></telerik:GridButtonColumn>
                 <telerik:GridBoundColumn ShowFilterIcon="True" autopostbackonfilter="True" currentfilterfunction="Contains" datafield="ID" datatype="System.Int32" filtercontrolalttext="Filter ID column" headertext="ID" readonly="True" sortexpression="ID" uniquename="ID" visible="False"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn ShowFilterIcon="True" autopostbackonfilter="True" currentfilterfunction="Contains" datafield="Description" filtercontrolalttext="Filter Site column" headertext="Site" sortexpression="Site" uniquename="Site"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn ShowFilterIcon="True" autopostbackonfilter="True" currentfilterfunction="Contains" datafield="Address" filtercontrolalttext="Filter Address column" headertext="Address" sortexpression="Address" uniquename="Address"></telerik:GridBoundColumn>
                 </Columns>
                <EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings>
            </MasterTableView>
            <GroupingSettings CaseSensitive="False" />
            <ClientSettings>
         <Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
           </ClientSettings>
            <EditItemStyle Wrap="False" />
            <ActiveItemStyle Wrap="False" />
        </telerik:RadGrid>
       
        
</telerik:RadAjaxPanel>
      <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Skin="Default">
          
                </telerik:RadAjaxLoadingPanel>
                
    
    <div>
        <telerik:RadWindowManager ID="RadWindowManager1" OnClientPageLoad="OnClientPageLoad" runat="server"></telerik:RadWindowManager>
    </div>
                     
        <asp:ObjectDataSource ID="odsSiteDetails" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="SelectSiteDetails" TypeName="site">
            <SelectParameters>
                <asp:Parameter DefaultValue="-1" Name="ID" Type="Decimal" />
            </SelectParameters>
        </asp:ObjectDataSource>
     
</asp:Content>

Pavlina
Telerik team
 answered on 10 Nov 2011
2 answers
99 views
I have a grid where all items are set to edit mode, when I insert a new item, I want to be able to save that row, as well as other edited rows from  a "Save" command item - but the GridDataInsertItem doesn't seem to be part of the collection of GridItems in the call.

How can I access the inserted item when doing a "Save All?"

Daniel
Top achievements
Rank 1
 answered on 10 Nov 2011
7 answers
127 views
Hi,

I'm using Rad Filter, and when the browser is shrinked,  AND, OR Menu is very inconsistent where it appears. I checked the Rad Filter Demo on Telerik, I don't see the same problem. Also I updated Telerik DLL, but nothing changed.

Thanks,

Nazmi
p.s. I'm attaching an image to show the problem.
Mira
Telerik team
 answered on 10 Nov 2011
1 answer
91 views
I am having a problem with the set_contentUrl method in Safari.  I am using the following:

 

function

GetMultiPageView() {

 

 

 

 

try

{

 

 

 

 

//

 

 

var multiPage = $find("<%=mpWrapper.ClientID %>"

);

 

 

 

 

return

multiPage;

 

}

 

 

catch

(err) {

 

alert(

 

 

"Error encountered: "

+ err.message)

 

}

}



GetMultiPageView().findPageViewByID('pvReportInput').set_contentUrl(Surl);

This works in Internet Explorer and Safari version 4 and 5.0.  Safari 5.1 and up it does nothing.

I have 3 tabs all with their own page view.  I choose to load a PDF into Tab 2.  I have used both sending the PDF through the response header and also by setting the content Url and these options both work.  But in the suspect Safari versions... when I try to click on Tab 1, nothing happens and It just displays the PDF from Tab 2. 

What could be causing this random behavior?
Kate
Telerik team
 answered on 10 Nov 2011
2 answers
87 views
Hi,

I try to handle the error in delete action, when clicked delete button,  but i can't handle radgrid_itemDeleted, visual studio shows the error.

for example

<telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="SingleExpandedItem"
            Width="1102px" Skin="Vista" AllowCollapseAllItems="true"  >
            <CollapseAnimation Type="None"></CollapseAnimation>
            <Items>
                <telerik:RadPanelItem runat="server" Text="Objectives Parameters" Expanded="true">
                    <Items>
                        <telerik:RadPanelItem Text="" Value="PanelItemObjParameters">
                            <ItemTemplate>
                                <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                                    AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"
                                    AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="ObjectiveParameterDataSource"
                                    GridLines="None" >
                                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                    </HeaderContextMenu>
                                    <MasterTableView DataKeyNames="objective_parameter_id" DataSourceID="ObjectiveParameterDataSource"
                                        CommandItemDisplay="Top">
                                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                            <HeaderStyle Width="20px" />
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                            <HeaderStyle Width="20px" />
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="objective_parameter_id" DataType="System.Int32"
                                                FilterControlAltText="Filter objective_parameter_id column" HeaderText="Id" ReadOnly="True"
                                                SortExpression="objective_parameter_id" UniqueName="objective_parameter_id">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridDropDownColumn DataField="objective_id" DataSourceID="ObjectiveDataSource"
                                                HeaderText="Objective" ListTextField="objective_name" ListValueField="objective_id"
                                                UniqueName="objective_id" ColumnEditorID="GridDropDownColumnEditorAdm1">
                                            </telerik:GridDropDownColumn>
                                            <telerik:GridTemplateColumn DataField="field_name" FilterControlAltText="Filter field_name column"
                                                HeaderText="Field Name" SortExpression="field_name" UniqueName="field_name">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="field_nameTextBox" runat="server" Text='<%# Bind("field_name") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="field_nameTextBox"
                                                        ErrorMessage="*"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="field_nameLabel" runat="server" Text='<%# Eval("field_name") %>'></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <EditFormSettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                            </EditColumn>
                                        </EditFormSettings>
                                    </MasterTableView>
                                    <FilterMenu EnableImageSprites="False">
                                    </FilterMenu>
                                </telerik:RadGrid>
                            </ItemTemplate>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>

And code behind is: the error is not recognized the handles RadGrid1.

Protected Sub RadGrid1_ItemDeleted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles RadGrid1.ItemDeleted
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim id As String = item.GetDataKeyValue("objective_parameter_id").ToString()
 
        If Not e.Exception Is Nothing Then
            e.ExceptionHandled = True
            SetMessage("Objective Type with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message)
        Else
            SetMessage("Objective Type with ID " + id + " is deleted!")
        End If
    End Sub


Can help me?
Carlos
Top achievements
Rank 1
 answered on 10 Nov 2011
3 answers
177 views
i used window.print, but it prints only visible section  of the window not the whole content
I need to print complete div content on a btn click without opening a new preview window.
Mira
Telerik team
 answered on 10 Nov 2011
11 answers
321 views
Hi,

I would like advice on how to make a toolbar that looks like the example in the image.

What I want is to have a RadToolBar in the top of a page, with width=100%, a few buttons to the left of the bar and a single button aligned to the right.

I've experimented with some properties of the buttons and with a little of custom cssclasses for the buttons, but didn't come to a solution.

Thanks for any help.

Simón de Lizarza
Kate
Telerik team
 answered on 10 Nov 2011
1 answer
96 views
we want to mark time slots back color based on resource available timings. 
We will save Resource available timings in appointments format.
Please let us know the solution for this.


Ivana
Telerik team
 answered on 10 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?