Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
790 views
I am working on an  page that dymically creates controls at runtime as determined by a database definition.  This is an indexing application and the number and types of controls varies by document type.  Everything is working fine except the RadCombo box.  Because some of the value lists will be very long I am using the load on demand feature.  When I was testing this functionality I used the load on demand example with a design-time placed combox box and it worked great.  Now I am trying to duplicate this configuratiion with run time code and I'm getting the following error when I attempt to load the items on demand: 

"The target '<my dynamic control id>' for the callback could not be found or did not implement ICallBackEventHandler."

Here is my server side code used to create the combo box:

object iControl =

new RadComboBox();
((
RadComboBox)iControl).Width = Unit.Pixel(200);
((
RadComboBox)iControl).AllowCustomText = true;
((
RadComboBox)iControl).ShowToggleImage = true;
((
RadComboBox)iControl).ShowMoreResultsBox = true;
((
RadComboBox)iControl).EnableLoadOnDemand = true;
((
RadComboBox)iControl).EnableVirtualScrolling = true;
((
RadComboBox)iControl).MarkFirstMatch = true;
((
RadComboBox)iControl).ItemsRequested += new RadComboBoxItemsRequestedEventHandler(index_create_ItemsRequested);
((RadComboBox)iControl).ID = "~~~" + docFieldDef.FieldTypeName + "~~~fld~" + docFieldDef.FieldDefID.ToString();
tbCell3.Controls.Add((RadComboBox)iControl);

And here is the shell for he event handler, although this code does not get executed at present.

protected void index_create_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
<snip>
}

Please let me know if I have missed something.
Thanks,
Andy

Helen
Telerik team
 answered on 13 Jun 2012
1 answer
203 views
Hi ,
 How to display check boxes in RadListView with check/uncheck functionality.

Thanks
Princy
Top achievements
Rank 2
 answered on 13 Jun 2012
1 answer
194 views
Hello Telerik Team,

Not sure if my title explains the situation properly, but here goes.  I'm basically making a grid email summary report using RadGrid. Basically my data comes back with columns such as: DateEnding, Area, Sent, Bounced, Clicks, etc, which I have successfully pivoted using the example provided.  My question is, is there a way to customize(or group maybe a better word) the headers of the columns.  I want the grid to display with DateEnding has the main header, and our 3 different area's under DateEnding as the subheaders.  The client wants to be able to easily compare mentioned metrics for a 4week period, across all areas.

Ideally the grid would look like : | 5/25/12 | 6/2/12 | 
|  North   |  South  |  West |  North   |  South  |  West | 

Please let me know if my explanation is not sufficient.  Maybe there is a better way to pull the data on my end to avoid this?  Any help is appreciated!

Thanks


Shinu
Top achievements
Rank 2
 answered on 13 Jun 2012
2 answers
112 views
I've got a radtooltip that when the user "single-clicks" an appointment on the scheudler.  However, when I click the little red X to delete an appointment off the scheduler, the tooltip still popups.

How do I get the X to close fire the delete?

Thanks.

Vince.
Minculescu
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
169 views
What I'm doing:
1. Put two RadAjaxPanels on a page.
2. Put one Rad controls in one of these panels and a simple asp.net control in the other one.
3. Changes made in one of these panels should refresh another panel but don't touch the panel where is the change was made.
4. Do any action in the panel with RadControl - panel with asp.net control will refresh correctly.
5. Do any change with asp.net control - panel with Rad control will breaks down and doesn't fire any events anymore.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AjaxProject_1.Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Default page</title>
</head>
<body>
    <form id="form1" runat="server">
    <tel:RadScriptManager runat="server" ID="Rsm1"></tel:RadScriptManager>
    <tel:RadAjaxManager runat="server" ID="Ram1"></tel:RadAjaxManager>
    <tel:RadScriptBlock runat="server">
        <script language="javascript">
            function __doXBack(args) {
                var ram = $find("<%= Ram1.ClientID %>");
                if (ram) ram.ajaxRequest(args);
            }
 
            function Refresh1(sender, args) {
                var value = args.getDataKeyValue("Id");
                if (value) __doXBack("1|" + value);
            }
 
            function Refresh2(ddl) {
                __doXBack("2|" + ddl.options[ddl.selectedIndex].value);
            }
        </script>
    </tel:RadScriptBlock>
 
    <tel:RadAjaxPanel runat="server" ID="Rap1">
        <asp:DropDownList runat="server" ID="Rcb1" onChange="Refresh2(this)"></asp:DropDownList>
    </tel:RadAjaxPanel>
 
    <hr/>
 
    <tel:RadAjaxPanel runat="server" ID="Rap2">
        <tel:RadGrid runat="server" ID="Grid1">
            <ClientSettings>
                <Selecting AllowRowSelect="True"></Selecting>
                <ClientEvents OnRowSelected="Refresh1"></ClientEvents>
            </ClientSettings>
            <MasterTableView ClientDataKeyNames="Id"></MasterTableView>
        </tel:RadGrid>
    </tel:RadAjaxPanel>
    </form>
</body>
</html>


using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Telerik.Web.UI;
 
namespace AjaxProject_1
{
    public partial class Default : System.Web.UI.Page
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
             Ram1.AjaxRequest += Ram1OnAjaxRequest;
        }
 
        private void Ram1OnAjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e == null || string.IsNullOrEmpty(e.Argument)) return;
             if (e.Argument.StartsWith("1|"))
            {
                InitComboBox(e.Argument);
                Rap1.RaisePostBackEvent(null);
            }
            if (e.Argument.StartsWith("2|"))
            {
                InitGrid();
                Rap2.RaisePostBackEvent(null);
            }
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
             InitComboBox("0");
            InitGrid();
        }
 
        private void InitComboBox(string id)
        {
            Rcb1.Items.Clear();
             var list = new List<string> {id};
            for (var i = 0; i < 10; i++) list.Add(GetRandomPropertyValue());
            Rcb1.DataSource = list;
            Rcb1.DataBind();
        }
 
        private static readonly IList<string> Properties = new[] {"Id", "Name"};
        private void InitGrid()
        {
            var data = new DataTable();
            Array.ForEach(Properties.ToArray(), t => data.Columns.Add(new DataColumn(t, typeof(string))));
            for (var i = 0; i < 10; i++)
            {
                var row = data.NewRow();
                row["Id"] = i.ToString();
                row["Name"] = GetRandomPropertyValue();
                data.Rows.Add(row);
            }
             Grid1.DataSource = data;
            Grid1.DataBind();
        }
 
        private static IList<char> _chars;
        private static readonly Random Rnd = new Random(DateTime.Now.Millisecond);
        private static string GetRandomPropertyValue()
        {
            if (_chars == null)
            {
                _chars = new List<char> {' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
                for (var c = 'a'; c <= 'z'; c++) _chars.Add(c);
                for (var c = 'A'; c <= 'Z'; c++) _chars.Add(c);
            }
 
            var len = Rnd.Next(10, 15);
            var sb = new StringBuilder();
            for (var i = 0; i < len; i++) sb.Append(_chars[Rnd.Next(0, _chars.Count - 1)]);
            return sb.ToString();
        }
    }
}


I know that I can get that behaviour from page with another methods like AjaxUpdatedControls in AjaxManager and so on, but I need to update panels like I described. It is some kind of specific application and I have to use this way to update controls on page.
Unfortunately it is not working.
Any ideas how to make it working?
Vasil
Telerik team
 answered on 13 Jun 2012
1 answer
39 views

Hi!

I am new to asp, so please excuse me if I don't express myself correctly.

I have a RadScheduler with a Linq data source. I want to get appointments from the database based on a given id.

In my DataClasses.dbml I have four tables and (for now) two stored procedures, GetProgram() and GetProgramById(int id). The user chooses the id from a checkboxlist, and I want to call the GetProgramById(int id) from codebehind. 

In markup I have configured the RadScheduler with DataSourceID="ProgramDataSource". I try to set the data source property to the result of the GetProgramById(int id), but then I get an error saying that both DataSourceID and DataSource properties are set, and that I have to remove one of them. If I remove  DataSourceID="ProgramDataSource" from markup I can set DataSource=GetProgrambyID(int id), but then none of the appointments are updated to the database after closing the AdvancedEdit form of the scheduler.

There must be a way to get a subset of the appointments, and to be able to edit them, so I would be greatful if anyone could help me find it.

Thank you!

Regards, Jill-Connie Lorentsen

protected void RadListBoxTmp_ItemCheck(object sender, RadListBoxItemEventArgs e)
   {
 
       int id;        
       bool result = Int32.TryParse( e.Item.Value, out id);
       if ( e.Item.Checked && result)
       {
           var dataContext = new DataClassesDataContext();
           ProgramDataManager dataManager = 
                   new ProgramDataManager((SqlConnection)dataContext.Connection);
 
           var program = new List<GetProgramByIDResult>();
           program = dataManager.GetProgramByID(id);
 
            
           RadScheduler1.DataSource = program;
           RadScheduler1.Rebind(); 
       }
         
   }
Plamen
Telerik team
 answered on 13 Jun 2012
8 answers
127 views
hai
on postback i wan to show the radslidingpane expanded. but i couldnt find any server side properties for that
is it possible to do this at all
Nicolaï
Top achievements
Rank 2
 answered on 13 Jun 2012
1 answer
422 views
One of the variables in my update queries is the current date.  I don't know how to set it up ride on the sqldatasource.  Using the regular aspx gridview, I normally set this in the code behind.

I'm at a loss on how to do this in radgrid.  Here's the code that I've trying to solve.  Everything else works but when I do the update, it still cannot find this parameter.

I would appreciate the help.  Thank you!

 Protected Sub RadGrid1_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
        SqlDataSource1.UpdateParameters.Add("@InactiveDate", SqlDbType.DateTime)
        SqlDataSource1.UpdateParameters("@InactiveDate").DefaultValue = Date.Now()


    End Sub
Shinu
Top achievements
Rank 2
 answered on 13 Jun 2012
1 answer
63 views
hi,
i am using radgrid with vitualscrolling in my application and i am using client side databinding to avoid postpack .if radgrid contains more than two pages ,radgrid working fine but if radgrid contains two pages, i am unable to view second page..becoz scroll is not working... please give some suggestion.The following codings are using in my application.

javascript:
function RadGrid1_Command(sender, args)
{
args.set_cancel(
true);
var currentPageIndex = sender.get_masterTableView().get_currentPageIndex();
var pageSize = sender.get_masterTableView().get_pageSize();
...........................................
...........................................
..........................................
...........................................
...................
}
function updateGrid(result) {
var tableView = $find(document.getElementById("hdnradgridclientid").value).get_masterTableView();
tableView.set_dataSource(result);
tableView.dataBind();
}
function updateVirtualItemCount(result)
{
var tableView = $find(document.getElementById("hdnradgridclientid").value).get_masterTableView();
tableView.set_virtualItemCount(result);
}       


aspx page:

<telerik:RadGrid ID="RadGridAssessment" EnableViewState="false" Width="100%" runat="server"
 AllowSorting="True" Height="430px" AllowMultiRowSelection="true" AllowPaging="true"GridLines="None" BorderWidth="0" AutoGenerateColumns="true" PagerStyle-AlwaysVisible="false"Skin="Vista" OnNeedDataSource="RadGrid1_NeedDataSource">
<PagerStyle Visible="false" />
<MasterTableView Width="99%">
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
<ClientEvents OnCommand="RadGrid1_Command" />
<Selecting AllowRowSelect="True"></Selecting>
<Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" UseStaticHeaders="true"ScrollHeight="275px" SaveScrollPosition="True">
</
Scrolling>
</ClientSettings>
 </telerik:RadGrid>

Prab
Top achievements
Rank 1
 answered on 13 Jun 2012
0 answers
63 views
the following thread started this discussion http://www.telerik.com/community/forums/aspnet-ajax/grid/getting-value-from-griddropdowncolumn-when-not-in-edit-mode.aspx about retrieving ListValueField of a cell when in display mode. At the time, it was not possible to do so directly. Have you made any changes in this regard enabling such retrieval? If not, i would like to propose this as a feature enhancement.

from my point of view - and no offense - it is a complete crock to make another trip to the database when the data has already once been retrieved.

to be more specific, i have the GridDataItem form of the data - i even have full access to the grid - and would like to retrieve the ListValueField - not the ListTextField value which is quite simple to access.
tony
Top achievements
Rank 1
 asked on 13 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?