Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
168 views

Hi,

I am using the HeaderContextMenu in my radgrid to show and hide the columns.  I want to save the users preference as to what columns they have visible.  I thought that this would be easy and I could just save the GridColumn.Display value.   But when I hide a column using the HeaderContextMenu the display value for that column is still true.

Where is the information regarding what columns have been hidden by the user using the HeaderContextMenu?

Eyup
Telerik team
 answered on 13 Jun 2012
1 answer
147 views
Hi All,

 I  have RadListView  having some data .I want to do some operation in the code behind when the checkbox in the listview is checked
 I have the code as below

<telerik:RadListView ID="lstViewSelectedContact" runat="server" ItemPlaceholderID="pnlItemholder"
                                    OnSelectedIndexChanged="listView_SelectedIndexChanged"  Width="600px"  OnPreRender = "lstViewSelectedContact_OnPreRender"
                                    AllowMultiItemSelection="true" DataKeyNames="id"  Visible="true"   
                                    OnNeedDataSource="lstViewSelectedContact_NeedDataSource"
                                    onitemcommand="lstViewSelectedContact_ItemCommand"  >
                                    <LayoutTemplate>
                                        <asp:Panel ID="pnlItemholder" runat="server" Height="100px"></asp:Panel>
                                    </LayoutTemplate>
                                    <ItemTemplate>
                                        <span>
                                            <asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="true"   OnCheckedChanged="chkSelect_OnCheckedChanged" BackColor="Transparent" BorderStyle="None" Text='<%#Eval("text") %>'>                                                   
                                            </asp:CheckBox>                                       
                                        </span>                                     
                                    </ItemTemplate>
                                    <SelectedItemTemplate>
                                        <asp:CheckBox ID="chkSelectedItem" runat="server" AutoPostBack="true" BackColor="LightSkyBlue" BorderStyle="None" CommandName="Deselect" Text='<%#Eval("text") %>'>
                                                   
                                        </asp:CheckBox>                                     
                                      
                                    </SelectedItemTemplate>                                   
                                    <ItemSeparatorTemplate>
                                        <span style="color: Black; font-weight: normal;"></span>
                                    </ItemSeparatorTemplate>
                                </telerik:RadListView>


The Problem is that I cant get the checked items(ID and value) in the code behind ie in chkSelect_OnCheckedChanged event.
Thanks
 Kumar
Shinu
Top achievements
Rank 2
 answered on 13 Jun 2012
1 answer
90 views
I have a RadChart and RadGrid populated with items. (The Datasources are different due to the returned data but they have the same DataKey values)

How can I quickly allow the user to select any of the items on the Radchart and make that the SelectedRow for the RadGrid? (the items will share the same DataKey value) 

I want them to be able to click the bar chart item and then have the corresponding record highlighted on the Radgrid below the chart.

I tried attaching an event handler for the Click events which seems to create event behavior I would expect, but I am having trouble linking these two controls together in the manner I would like.  I believe there would be a quick clientside solution for this so I can simply get a reference to the RadGrid, find the row with a DataKey value that matches the one that it was called from, and make that the SelectedRow so it will be highlighted to the user.  Sounds good in theory but I am having trouble with implementation of such a scenario.

Any help is appreciated
Petar Marchev
Telerik team
 answered on 13 Jun 2012
10 answers
841 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
233 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
219 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
133 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
198 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
51 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
149 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
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?