Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
259 views
I am trying to create a page that will display a dynamic set of results based on user input.  The gist is that the results will look something would contain specific info about a customer site, followed by a grid with the detailed results for that particular location.  Something like:

Site: sitename, city, state
    grid w/ satisfaction survey results

The user would be able to pick either a single site, all of the sites that reports to them, or to a subset.  Since this is a dynamic list, I thought it would be best to use a user control with the grid.  I already have a datatable that has the results for all of the selected sites, so I want to pass the datatable to the user control, then let the control apply a filter.

So I created a user control, and the code-behind for it looks like:

namespace SurveyResults
{
  public partial class resultsGrid : System.Web.UI.UserControl
  {
    private DataTable _dtResults = null;
 
    public DataTable dtResults
    {
      get
      {
        return _dtResults;
      }
      set
      {
        _dtResults = dtResults;
      }
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        gridResults.DataSource = _dtResults;
        gridResults.Rebind();
    }
  }
}


Then I added a placeholder to my primary page, and added the following code:

// dtResults is a datatable that contains the results for all sites.  I have verified that it does contain data at this point
 
_resultsGrid = (resultsGrid)Page.LoadControl("resultsGrid.ascx");
_resultsGrid.dtResults = dtResults;
phResults.Controls.Add(_resultsGrid);

When I set a breakpoint on the set property for dtResults, I am only getting a null value.  So then when the page_load for the user control runs, the datasource is null.  I don't get an error, I just don't get a grid either.

I will be very much appreciative if someone can point out what it is that I am doing wrong here.

Thank you!
Andrey
Telerik team
 answered on 16 Jul 2012
3 answers
132 views
Hi all,

In my datagrid, I need to generate an automatic date picker on the addnewrecord command. How can I do this?

Thanks in advance
Princy
Top achievements
Rank 2
 answered on 16 Jul 2012
3 answers
94 views
I am using the RadSchedular for our application. All the data are coming,saving and updating through Web service which the Telerik project provided. I only changed the business logic in the MyDbSchedulerProvider class to get and save data from our database. There are lots of cases when service side error can occur. However I am unable to throw the error from web method to the Schedular pages . Can anyone please help me in this regard?
Plamen
Telerik team
 answered on 16 Jul 2012
2 answers
99 views
Hi all,


I have a Rad Binary Image.. i wish to the binary image control work as a hyper link..
please help

Regards,

Prassin
Prassin
Top achievements
Rank 1
 answered on 16 Jul 2012
11 answers
235 views
Hello,

in my project I have big troubles with the rendering of the RadDatePicker. It seems the CSS is not applied (well) to the control. Instead of the calendar button, the tooltip is rendered as hyperlink for opening the calendar. When the calendar, for date selection, is opened there's no background etc.
The RadDatePicker is on a RadMultiPage in a UserControl that is set to visibele after clicking a button in the NamingContainer (in the sampel a aspx but in my project also a UserControl) of the UserControl. The UserControl has a RadAjaxPanel on it which contains the RadDatePicker, the NamingContainer als has a RadAjaxPanel.

I've tried to reproduce the problem in a sample project which I've attached. Only in this sample te problem appears after clicking/changing the tabstrip a few times while in my application the problem always appears.

Hopefully there's someome who can help me with this problem.

Regards,
    Jos Meerkerk

Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadDatePicker.Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="uc" TagName="DatePicker" Src="~/DatePicker.ascx" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
 
<body>
    <form id="form1" runat="server">
    <div  style="margin-left:100px;margin-top:100px;">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton"
            onclick="RadButton1_Click">
        </telerik:RadButton> <br />
        <uc:DatePicker ID="ucDatePicker" runat="server"  Visible="false" />
    </div>
    </form>
</body>
</html>

Default.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace RadDatePicker
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void RadButton1_Click(object sender, EventArgs e)
        {
            ucDatePicker.Visible = true;
        }
    }
}

DatePicker.ascx:
<telerik:RadAjaxPanel ID="rapPanel" runat="server">
<telerik:RadTabStrip ID="RadTabStrip1" runat="server"
    MultiPageID="RadMultiPage1" Skin="Windows7" AutoPostBack="true">
    <Tabs>
        <telerik:RadTab runat="server" PageViewID="rpvPage1" Text="Root RadTab1">
        </telerik:RadTab>
        <telerik:RadTab runat="server" PageViewID="rpvPage2" Text="Root RadTab2">
        </telerik:RadTab>
        <telerik:RadTab runat="server" PageViewID="rpvPage3" Text="Root RadTab3">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" Runat="server" RenderSelectedPageOnly="true" EnableEmbeddedScripts="true" SelectedIndex="0">
    <telerik:RadPageView ID="rpvPage1" runat="server">
        RadPageView Page 1
    </telerik:RadPageView>
    <telerik:RadPageView ID="rpvPage2" runat="server">
        RadPageView Page 2<br />
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <telerik:RadDatePicker ID="RadDatePicker2" runat="server" Skin="Windows7">
            </telerik:RadDatePicker>
        </telerik:RadAjaxPanel>
    </telerik:RadPageView>
    <telerik:RadPageView ID="rpvPage3" runat="server">
        RadPageView Page 3
    </telerik:RadPageView>
</telerik:RadMultiPage>
 
</telerik:RadAjaxPanel>

RvdGrint
Top achievements
Rank 1
 answered on 15 Jul 2012
0 answers
71 views
Hi

I have persistStateInCookie = true so that visitors can know where they are when navigating pages.
But I want to be able to close all expanded menu items when the visitor returns to the home page.

Right now, any item that was expanded remains open when the visitor returns to the Home page which is
somewhat confusing.

Can anyone help?

I have tried numerous ways of expiring the cookie, but nothing works so far.

Thanks for help!

Clive
Clive Hoggar
Top achievements
Rank 1
 asked on 14 Jul 2012
1 answer
90 views
Hi All,

I have rad grid and rad tree view .. when i select a particular rad tree view node the grid need to be populated regarding that particular node click..

>Node1
        >Node2
                    >Node3
>New Node1
          >New Node2

Node2 and Node3 stand under Node1

when i click Node3 the child node value need to be 3. i need to achieve this too..

please help

Regards,

Prassin

Prassin
Top achievements
Rank 1
 answered on 14 Jul 2012
1 answer
92 views
i am working on a project where we have sports people that we show in telerik grid

here we need to know if they are professional, this is handled by a bool, so far so good
it works good when i start the page but if i refresh via the toolbar in the bottom, the checkboxes we use are changed to its string value, how can i avoid this?

@(
    Html.Telerik().Grid(Model)
        .Name("Player")
        .ClientEvents(events =>
        {
            events.OnDataBound("Grid_onDataBound");
            events.OnSubmitChanges("Grid_onSubmitChanges");
            events.OnError("Grid_onError");
        })
        .Sortable(sorting => sorting.Enabled(true))
        .DataKeys(keys => keys.Add(o => o.Id)
            .RouteKey("Id"))
        .ToolBar(commands =>
        {
            commands.Insert().ButtonType(GridButtonType.Image).ImageHtmlAttributes(new { style = "margin-left:0" });
            commands.SubmitChanges().ButtonType(GridButtonType.Image);
        })
        .DataBinding(dataBinding => dataBinding.Ajax()
            //.Insert("Players_update", "Player", new { Tournament = ViewBag.TournamentID })
            .Select("Select_players", "Player", new { Tournament = ViewBag.TournamentID })
            .Update("Players_update", "Player", new { Tournament = ViewBag.TournamentID })
            //.Delete("Players_update", "Player", new { Tournament = ViewBag.TournamentID })
        )
        .PrefixUrlParameters(false)
        .Columns(columns =>
        {
            columns.Bound(o => o.FirstName).Width(180);
            columns.Bound(o => o.LastName).Width(180);
            columns.Bound(o => o.Email).Width(200);
            columns.ForeignKey(o => o.Sex, (IEnumerable)ViewData["gender"], "Id", "Text").Width(120);
            columns.ForeignKey(o => o.Country, (IEnumerable)ViewData["country"], "Id", "Name").Width(120);
            columns
                .Bound(o => o.IsPro)
                .ClientTemplate("<input type='checkbox' name='IsPro' value='<#=IsPro#>' />")
                .Width(30);
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.Image);
                commands.Delete().ButtonType(GridButtonType.Image);
            });
        })
                .Editable(editing => editing.Mode(GridEditMode.InCell))
         .KeyboardNavigation(navigation => navigation.EditOnTab(true))
         )
Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Jul 2012
2 answers
293 views
Hi,

I have a grid and in that i have by default sorting by date desc and default group by by date and i is by default expended. The problem is that the sorting order is desc of date but the date is only taking the date and the month part in the not measuring by the sorting.
 
Please see the attachment.

I have used following code for sorting and grouping

 <SortExpressions >
                            <telerik:GridSortExpression FieldName="UpdatedDate" SortOrder="Descending"/>
                        </SortExpressions>
  <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <GroupByFields>
                                    <telerik:GridGroupByField FieldName="UpdatedDate" SortOrder="Descending"  FormatString="{0:yy/mm/dd}" />
                                </GroupByFields>
                                <SelectFields>
                                    <telerik:GridGroupByField FieldName="UpdatedDate" />
                                </SelectFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                        <GroupHeaderTemplate>
                            <asp:Label Text='<%#String.Format("{0:MM/dd/yy}", Eval("UpdatedDate"))%>' runat="server"
                                ID="lblDate" Style="font-weight: bold; color: Black;"></asp:Label>
                        </GroupHeaderTemplate>
Manish
Top achievements
Rank 2
 answered on 14 Jul 2012
2 answers
66 views
Hello,

  We have a Radgrid in one of our web pages. The user can upload the documents here and they should be able to view the documents they have already uploaded. I have a image button as one of the columns in the RadGrid. Idea being, when the user clicks on that button, a RadWindow should open.  I have the byte array of the document. With this, how do i open the document in a new window.
One way is to pass the byte array(which is saved in the database) to the RadWindow. How do i do this?

Appreciate the help
Thanks
Jamie
Top achievements
Rank 1
 answered on 13 Jul 2012
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?