Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
51 views
Hi,

Please ignore previous image find below image attached.

Thanks
Peter
Telerik team
 answered on 03 Jun 2011
3 answers
417 views
I have a radgrid and I need to loop through (when the user hits a button) and check if the checkbox(es) has been selected and then get the ID to save into a variable.

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowSorting="True"
                    CellSpacing="0" GridLines="None" AutoGenerateColumns="False"
                    AllowMultiRowSelection="True" AllowPaging="True" PageSize="20" >
                    <GroupingSettings CaseSensitive="false" />
                    <MasterTableView ShowFooter="false" DataKeyNames="ID" AllowFilteringByColumn="True" >
                        <Columns>
                            <telerik:GridClientSelectColumn UniqueName="chbxSelection" />
                            <telerik:GridBoundColumn UniqueName="FirstName" SortExpression="First_x0020_Name" HeaderText="First Name"
                                DataField="First_x0020_Name" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" AllowFiltering="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="LastName" SortExpression="Last_x0020_Name" HeaderText="Last Name"
                                DataField="Last_x0020_Name" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" AllowFiltering="true">
                            </telerik:GridBoundColumn>
                             <telerik:GridBoundColumn UniqueName="Organization" SortExpression="Organization" HeaderText="Organization"
                                DataField="Organization" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" AllowFiltering="true">
                            </telerik:GridBoundColumn>
                             <telerik:GridBoundColumn UniqueName="Title" SortExpression="Title" HeaderText="Title"
                                DataField="Title" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" AllowFiltering="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ID" Visible="false" DataField="ID" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
                </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 03 Jun 2011
4 answers
151 views
Hello,

I want to load item data in RadMenu by using a SQL query, when testing the below code I can stop at a break point in
RadMenu1_ItemDataBound but not stopping in RadMenu1_ItemClick, I'm wondering what to do in order to be able
to fire OnItemClick. I Don't know what is wrong, please help...

<
telerik:RadMenu ID="RadMenu1" runat="server" Width="100%" style="margin-bottom:2px"
             EnableRoundedCorners="True" EnableShadows="True"
             DataSourceID="SqlDataSource1" 
             DataFieldID="MenuID" DataFieldParentID="ParentID" 
             DataTextField="FieldText" DataValueField="Page" 
             OnItemClick="RadMenu1_ItemClick" onitemdatabound="RadMenu1_ItemDataBound">           
     </telerik:RadMenu>
  
 protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
        {
            if (Request.IsAuthenticated)
            {
                string value=e.Item.Value.ToString();
                Telerik.Web.UI.RadPane topPane = (Telerik.Web.UI.RadPane)HeadLoginView.FindControl("topPane");
                string[] arreglo = value.Split('?');
                topPane.ContentUrl = arreglo[0];
                Telerik.Web.UI.RadPane paneContent = (Telerik.Web.UI.RadPane)HeadLoginView.FindControl("contentPane");
                paneContent.ContentUrl = "Blank.aspx";
                if (value.IndexOf('?') > 0)
                {
                    if (arreglo[1] == "clp=1")
                    {
                        paneContent.Collapsed = true;
                    }
                    else
                    {
                        paneContent.Collapsed = false;
                    }
                }
                else
                {
                    paneContent.Collapsed = false;
                }
                  
            }
  
  
        }
  
        protected void RadMenu1_ItemDataBound(object sender, Telerik.Web.UI.RadMenuEventArgs e)
        {
            e.Item.Value = e.Item.NavigateUrl;
            e.Item.NavigateUrl = "";  
  
        }


Thanks
Antonio
Veronica
Telerik team
 answered on 03 Jun 2011
1 answer
141 views
Hello,

The following code does not fires onclick properly in RadMenu but removing Loginview and loggedintemplate tags
makes it to run, I think something is not being located in order to fire onclick, what would be the
workaround to allow loginview?

Thanks
Antonio

<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<LoggedInTemplate>
 

<
telerik:RadMenu ID="RadMenu1" runat="server" Width="100%" style="margin-bottom:2px"
         EnableRoundedCorners="True" EnableShadows="True"
         DataSourceID="SqlDataSource1" 
         DataFieldID="MenuID" 
         DataFieldParentID="ParentID"
         onitemclick="RadMenu1_ItemClick" onitemdatabound="RadMenu1_ItemDataBound" 
         >
         <DataBindings>
            <telerik:RadMenuItemBinding TextField="FieldText" Depth="0" />
            <telerik:RadMenuItemBinding TextField="FieldText" Depth="1" ValueField="Page" />
        </DataBindings>
 </telerik:RadMenu>
     <asp:SqlDataSource ID="SqlDataSource1" runat="server"
     ConnectionString="<%$ ConnectionStrings:serpoldbConnectionString %>" 
    SelectCommand="select MenuID,ParentID,FieldText,Page from tbMenu" SelectCommandType="Text"
    CancelSelectOnNullParameter="False">
     </asp:SqlDataSource>

 

 

 

 

</LoggedInTemplate>
    </asp:LoginView>

 

 

 

 

 

 

 

 

 


Veronica
Telerik team
 answered on 03 Jun 2011
1 answer
75 views
I am using a DateTimePicker inside a FilterTemplate for a Grid Column that represents a date.

Obviously Selecting a date should filter the contents to that date, but how do I implement 'before this date' or 'after this date' functionality?

The only example I have found so far on your site has two date pickers in the Filter area.
This uses more screen area than I would like.

Thanks
Shinu
Top achievements
Rank 2
 answered on 03 Jun 2011
2 answers
130 views
Hi

When I am checking different checkboxes only one checkbox is getting checked in RadGrid. I followed this "http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html" and also implemented the example given in RadGrid "pagingsortingwithclientsideselecting-ajax" . In my scenario we have master page.

I need that multiple check boxes must be checked.

Help me how can achieve this.

Thank You.
BRK
Top achievements
Rank 1
 answered on 03 Jun 2011
5 answers
131 views
Hello,

I'm using a GridAttachmentColumn just like the Telerik example: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx
But in my case after the Response.Write in the code-behind a Javasript error c00ce514 is generated. I've searched the web and foud that this is caused by AJAX. Strange in my case because I disabled AJAX during the DownloadAttachment event of the RadGrid.

Anyone any idea or solution?
RvdGrint
Top achievements
Rank 1
 answered on 03 Jun 2011
4 answers
309 views
Dear Sir,

I have a problem with the following scenario:

I have nested user controls as following
<userControl1>
  <table runat="server" id="tblTimesheet">
    <tr>
      <td>
    <asp:Button runat="server" ID="btnSave" Text="Save"/> 
        <userControl2></userControl2>
      </td>
    </tr>
  </table>
</userControl1>

where
UserControl1:
- has RadAjaxLoadingPanel1 and has the RadAjaxManager defined as following:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    ClientEvents-OnRequestStart="Timesheet_RequestStart"
    ClientEvents-OnResponseEnd="Timesheet_ResponseEnd">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnSave">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tblTimesheet"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadCodeBlock runat="server" ID="scriptBlock">
    <script type="text/javascript">
        var currentLoadingPanel = null;
        var currentUpdatedControl = null;
        function Timesheet_RequestStart(sender, args) {
            currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");
            currentUpdatedControl = "<%= tblTimesheet.ClientID %>";
            //show the loading panel over the updated control
            currentLoadingPanel.show(currentUpdatedControl);
        }
        function Timesheet_ResponseEnd() {
            //hide the loading panel and clean up the global variables
            if (currentLoadingPanel != null)
                currentLoadingPanel.hide(currentUpdatedControl);
            currentUpdatedControl = null;
            currentLoadingPanel = null;
        }
   </script>
</telerik:RadCodeBlock>

UserControl2:

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnAddNewRow">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tblTimesheetSection"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<table class="TimesheetSectionTable" runat="server" id="tblTimesheetSection">
</table>
<asp:Button runat="server" ID="btnAddNewRow" Text="Add New"/>


Now the scenario is:
- When you open the form for first time and click on btnAddNewRow on UserControl2. ClientEvents-OnRequestStart is working fine and show the loading panel on all the form.
- Use btnSave on UserControl1. ClientEvents-OnRequestStart is working fine and show the loading panel on all the form.
- After Form return. click on btnAddNewRow on UserControl2. Form is sending Ajax request but ClientEvents-OnRequestStart is not triggered any more from the nested control so the loading panel not appears.
- Use btnSave on UserControl1. ClientEvents-OnRequestStart is working fine and show the loading panel on all the form.


I tried to add the following code to the page load of UserControl2. but that didn't help :(
Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
manager.ClientEvents.OnRequestStart = "Timesheet_RequestStart"
manager.ClientEvents.OnResponseEnd = "Timesheet_ResponseEnd"

Thanks,
Mohamed Ramadan
RvdGrint
Top achievements
Rank 1
 answered on 03 Jun 2011
1 answer
153 views

I’m using radgrid that take its data from the NeedDataSource function.

The user can select one row (server-side).

When the grid first loads I would like to have the first row selected.

When the user creates a new row I would like to have that row selected.

How do I do this?

Shinu
Top achievements
Rank 2
 answered on 03 Jun 2011
2 answers
86 views
Hello Guys,

I am trying to set the filename of my exported excel file but I am still getting the default filename "RadGridExport". Am I missing something?


<telerik:RadGrid ID="myRadGrid" CssClass="AutoShrink" runat="server" GridLines="Both" OnItemCommand="myRadGrid_ItemCommand">           
    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Wrap="True" />
</telerik:RadGrid>


Public Sub btnExport_Click(ByVal sender As Object, ByVal args As EventArgs)
        myRadGrid.MasterTableView.ExportToExcel()
End Sub

Protected Sub myRadGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles myRadGrid.ItemCommand
    If e.CommandName = Telerik.Web.UI.RadGrid.ExportToExcelCommandName Then
        myRadGrid.ExportSettings.ExportOnlyData = True
        myRadGrid.ExportSettings.IgnorePaging = True
        myRadGrid.ExportSettings.OpenInNewWindow = True
        myRadGrid.ExportSettings.FileName = "myFilename"
    End If
End Sub

Any help is appreciated.

Thanks!
kith
Top achievements
Rank 1
 answered on 03 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?