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

I want to remove the blank space intended for adding images to toolbar buttons. Please help.

Thank you,
Ivy
Princy
Top achievements
Rank 2
 answered on 05 Mar 2013
1 answer
109 views
Hi,

In my webpage I dont want the AjaxLoadingPanel to appear over the updated control. Instead I want to display it on a certain
position on my page. Is this possible?

Any help appreciated,
Freddy
Princy
Top achievements
Rank 2
 answered on 05 Mar 2013
16 answers
604 views
Ok, in Visual Studio 2008, after simply dragging a RadDatePicker (Ajax) onto my form, I'm seeing the following warnings in the error list...

Validation (ASP.Net): Element 'DateInput' is missing required attribute 'runat'.

and

Validation (ASP.Net): Element 'Calendar' is missing required attribute 'runat'.

I imagine this is a bug with your control (probably in the [ToolboxData()] for the RadDatePicker class)

My question is: should I go ahead and manually add "runat='server'" for those tags in my declarative? Or is there some trick to make Visual Studio not display these warnings?

Thanks.

 

 

DuelingCats
Top achievements
Rank 2
 answered on 04 Mar 2013
0 answers
68 views
Solved. Been a long day. ;)

 
Danny
Top achievements
Rank 2
 asked on 04 Mar 2013
2 answers
204 views
Hi there,

I am using a RadDatePicker filter with the DisplayDateFormat="MM/dd/yyyy" and filter function=LessThanOrEqualTo. It seems the filter not returning the correct data, for example, if I set the RadDatePicker ="07/12/1996", the filter returning date prior to December 7th, 1996, while I am actually expecting date prior to July 12th, 1996.

Please see my following code (database is NorthWind), any help is greatly appreciated.

<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
            GridLines="None" Width="800px" AllowFilteringByColumn="true" EnableLinqExpressions="false" AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource" ShowFooter="True">
            <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"
            ShowFooter="True" TableLayout="Auto">
                <Columns>
                    <telerik:GridTemplateColumn DataField="Freight" HeaderText="Freight" SortExpression="Freight" AutoPostBackOnFilter="true" CurrentFilterFunction="GreaterThanOrEqualTo"
                        ShowFilterIcon="false">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbl_freight" runat="server" Text='<%#Eval("Freight")%>' Visible="true"/>
                            </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="ShipName" HeaderText="Ship Name" SortExpression="ShipName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbl_name" runat="server" Text='<%#Eval("ShipName")%>' Visible="true"/>
                        </ItemTemplate>
                   </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="OrderDate" UniqueName="OrderDate" HeaderText="Order Date" SortExpression="OrderDate">
                    <FilterTemplate>
                        <telerik:RadDatePicker ID="filterOrderDate" runat="server" Width="100%" ClientEvents-OnDateSelected="DateSelected"
                            DbSelectedDate='<%# SetOrderDate(Container) %>'><DateInput ID="DateInput1" runat="server"  DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy"></DateInput> 
                        </telerik:RadDatePicker> 
                        <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
                            <script type="text/javascript">
                                function DateSelected(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
  
                                    var date = FormatSelectedDate(sender);
  
                                    tableView.filter("OrderDate", date, "LessThanOrEqualTo");
                                }
                                function FormatSelectedDate(picker) {
                                    var date = picker.get_selectedDate();
                                    var dateInput = picker.get_dateInput();
                                    var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());
  
                                    return formattedDate;
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbl_duedate_gv" runat="server" Text='<%#Eval("OrderDate", "{0:MM/dd/yyyy}")%>' Visible="true"/>
                    </ItemTemplate>
               </telerik:GridTemplateColumn>
             </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </form>
</body>


cs code
public partial class RadGridFilterTest : System.Web.UI.Page
{
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        LoadData();
    }
  
    private void LoadData()
    {
        RadGrid1.DataSource = GetDataTable("SELECT OrderID, OrderDate, Freight, ShipName, ShipCountry FROM Orders");
    }
  
    public DataTable GetDataTable(string query)
    {
        String ConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(ConnString);
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand(query, conn);
  
        DataTable myDataTable = new DataTable();
  
        conn.Open();
        try
        {
            adapter.Fill(myDataTable);
        }
        finally
        {
            conn.Close();
        }
  
        return myDataTable;
    }
  
    protected DateTime? SetOrderDate(GridItem item)
    {
        if (item.OwnerTableView.GetColumn("OrderDate").CurrentFilterValue == string.Empty)
        {
            return new DateTime?();
        }
        else
        {
            DateTime DT = new DateTime();
              
            DT = DateTime.ParseExact(item.OwnerTableView.GetColumn("OrderDate").CurrentFilterValue, "MM/dd/yyyy", null);
            //DT = DateTime.Parse(item.OwnerTableView.GetColumn("OrderDate").CurrentFilterValue);
            return DT;
        }
    }
}
Meng
Top achievements
Rank 1
 answered on 04 Mar 2013
3 answers
430 views
I want to call a javascript function when a radButton receives focus by tabbing onto the control.  Similarly, call a javascript function when radButton loses focus.  How can this be accomplished?
Mark
Top achievements
Rank 1
 answered on 04 Mar 2013
11 answers
634 views
I am working in C# for ASP.NET in Visual Studio version 2008.  I recently updated my environment to include the following:$0* 3.5 .NET Framework Service Pack.$0$0* 2008-08-20 release of the AJAX Control Toolkit.$0$0$0$0$0As soon as I made the upgrades listed above I started to receive the following message: 'ASP.NET Ajax client-side framework failed to load.'$0$0$0$0$0The error occurs due to the presence of the Telerik RadScriptManager control on a page.  If I replace that control with the standard AJAX ScriptManager control the error goes away.$0$0$0$0$0Any information you could provide would greatly be appreciated.$0$0$0$0$0Thank You,$0$0$0$0$0David Nowak.$0
Travis
Top achievements
Rank 1
 answered on 04 Mar 2013
3 answers
245 views
I'm using a RadGrid, and I'm able to show and hide columns using client-side script:

 

mygrid.get_masterTableView().hideColumn(i);

But, when I hide the column, it leaves a blank space where the column was located. Is it possible to have the remaining columns automatically resize and fill the empty space?

If this isn't possible, can I manually resize the remaining columns? I've tried the following script to set the hidden column width to zero, but it doesn't have any affect:

mygrid.get_masterTableView().resizeColumn(i, 0);

Sophie
Top achievements
Rank 2
 answered on 04 Mar 2013
9 answers
531 views
Is there a way to send tokens such as OAuth2 with the call to the ODataService?

I can see that there may be a way of injecting headers in the client-side event

OnRequesting but only if these are exposed in the args.set_Options object.



Thanks

Gary
Genady Sergeev
Telerik team
 answered on 04 Mar 2013
5 answers
620 views
I have a radgrid placed on a web form that uses PeterBlum's RequiredValidator and CustomValidator to validate some data on the page. 
I would like to validate the web form data before performing an Insert or Update on the grid.   
I am using radgrid's automatic insert and update actions.

The following approach succeeds in preventing the insert form from loading if the validation fails, but doesn't continue on to displaying the validation messages.
Any suggestions?
Protected Sub Grid_ItemCommand(source As Object, e As GridCommandEventArgs) Handles PreferredMediaEditableGrid.ItemCommand
 
    Select Case e.CommandName
 
      Case RadGrid.InitInsertCommandName
 
        PeterBlum.DES.Globals.Page.Validate()
        If Not PeterBlum.DES.Globals.Page.IsValid Then
 
          ' cancel automatic insert.
          e.Canceled = True
 
        End If
 
    End Select
 
  End Sub
Angel Petrov
Telerik team
 answered on 04 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?