Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
481 views
I have a simple RadGrid:

<telerik:RadGrid ID="rgHeaderKey" runat="server">
  <HeaderStyle Font-Bold="true" />
  <MasterTableView HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true" />
</telerik:RadGrid>

The columns and rows are bound to a table in a database; yet some of the columns do not contain any data (that is, all the entries in that column are NULL).  I need to hide those columns that do not contain any data after the grid has been filled.  I tried the following handler for the OnDataBound event:

protected void GridHeaderKeyDataBound(object sender, EventArgs e)
{
    // after data-binding, hide any columns that have no entries
    for(int i = 0; i < rgHeaderKey.Columns.Count; i++)
    {
        // check the entry in the first row
        GridColumn col = rgHeaderKey.Columns[i];
        if (String.IsNullOrEmpty(rgHeaderKey.Items[0][col].Text)) col.Display = false;
    }
}

This fails, however, because rgHeaderKey.Columns.Count is always 0, even after the data have been bound (which I find a bit strange).  I realise this might be because the columns are automatically generated: however, I need it this way because I do not know the names of the columns in advance.

Any help would be very much appreciated.
pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 06 Mar 2014
2 answers
173 views
Hi
I have a RadComboBox with a radTree in it.
I have get text and value of tree node from DataBase. Now i want to select item of radTree that equal to value by JavaScript.
How can i do it?

Here is definition of RadComboBox:

<telerik:RadComboBox runat="server" ID="cmb" EnableVirtualScrolling="true"
    Height="140px" ShowToggleImage="True" Style="vertical-align: middle;" Width="100%"
    OnClientDropDownOpened="cmb_ClientOpened">
    <ItemTemplate>
        <telerik:RadTreeView ID="tv" runat="server" OnClientNodeClicking="tv_ClientNodeClicking">
        </telerik:RadTreeView>
    </ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem Text="" />
    </Items>
</telerik:RadComboBox>
kia
Top achievements
Rank 1
 answered on 06 Mar 2014
7 answers
187 views
Hey there,

I am working on a form using rad controls.I need to make a grid in which first column contains a dropdown,and on its selectedItemIndexChanged I want to show the price of the selected item in the next column on a label.What's the procedure?..
Should i use GridItemTemplate?..Is there any Grid demo which shows a dropDopwn column?..

Need Some help...
Thanks
Amit.
Princy
Top achievements
Rank 2
 answered on 06 Mar 2014
2 answers
263 views
Hi There, I've got a problem with a simple form with button postback, it gives me the following issue, however, if I refresh the page cup of times it seems to be gone away.

Also if I open fiddler, the problem gone away too, very strange.

Any suggestions?


Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Fri, 28 Feb 2014 10:28:25 UTC


Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '

<!DOCTYPE html P'.
Line: 6
Char: 84171
Code: 0
URI: http://cvc98sweb20.mcc.local/FSMSDEV/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a33363de7-7c08-435e-ab35-682b2ed2c688%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2013.3.1324.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a597c6a37-3447-4509-ba46-0faaa25cf6f9%3a16e4e7cd%3aed16cbdc%3af7645509%3a88144a7a%3a24ee1bba%3af46195d3%3a874f8ea2%3a19620875%3acda80b3
Leon
Top achievements
Rank 1
 answered on 05 Mar 2014
2 answers
599 views
Hi All,

I want to add the a custom item to context menu on radgrid header context menu like "Default settings \ Clear settings"
and on click of this event in want to fire a server side code which i have .

Could any one help me on this , how can we achieve this , with a small piece of sample code

Thanks
Chaitanya
Top achievements
Rank 1
 answered on 05 Mar 2014
15 answers
177 views
I have a web page with a RadNumericTextBox on it
it needs to implement the following functionality
if the user types in a number it  waits for the user to click a button to fill a grid
if the user increments the box using the mouse wheel or arrow keys it fills a grid with the value of the textbox as a parameter

please advise
moegal
Top achievements
Rank 1
 answered on 05 Mar 2014
1 answer
112 views
Hi

I am using Rad Scheduler Month view and i am getting two problem.First problem is when i click on any date it should be highlight and second when i click on cell ,value of selected cell to be show on aspx page label or any control.

Please help me on this issue .I am using asp.net and c#.
Boyan Dimitrov
Telerik team
 answered on 05 Mar 2014
2 answers
379 views
There is problem with filter option. When i enter any text in filer textbox and then click on page navigation link, on first click grid filter is occur and on second click page navigation is occur. So i want page should be navigated on first click when i enter any text in filter and click on navigation link.

Thanks,
Padmasinh
Top achievements
Rank 1
 answered on 05 Mar 2014
3 answers
546 views
I used RadDatePicker in EditItemTemplate of GridTemplateColumn in a Radgrid, following this demo:
http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/databinding/defaultcs.aspx

But when page first loading, the calendar didn't popup if I click the button, if I changed the RadSkinManager option, the calendar will display correctly.
Could you please help me find the issue? Thanks.
I create a visual web part in SharePoint 2013 and use the control in the web part , code is below:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="testdatepicker.ascx.cs" Inherits="LRM.Project_Site.testdatepicker.testdatepicker" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2013.3.1114.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
 
 
 
  
 
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
 
        <AjaxSettings>
 
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
 
                <UpdatedControls>
 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1">
 
                    </telerik:AjaxUpdatedControl>
 
                    <telerik:AjaxUpdatedControl ControlID="sharedCalendar"></telerik:AjaxUpdatedControl>
 
                </UpdatedControls>
 
            </telerik:AjaxSetting>
 
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
 
                <UpdatedControls>
 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1">
 
                    </telerik:AjaxUpdatedControl>
 
                </UpdatedControls>
 
            </telerik:AjaxSetting>
 
        </AjaxSettings>
 
    </telerik:RadAjaxManager>
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
 
    </telerik:RadAjaxLoadingPanel>
 
    <div class="controls">
 
        <div>
 
            <label>
 
                RadDatePicker in EditItemTemplate of GridTemplateColumn (additional shared calendar
 
                is in use):</label>
 
        </div>
 
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Width="300px"
 
            OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand"
 
            OnItemCreated="RadGrid1_ItemCreated">
 
            <MasterTableView Width="100%" EditMode="InPlace">
 
                <Columns>
 
                    <telerik:GridTemplateColumn HeaderText="Available dates" UniqueName="TemplateColumn">
 
                        <ItemTemplate>
 
                            <asp:Label runat="server" ID="date" Text='<%# Eval("Week", "{0:D}") %>'>
 
                            </asp:Label>
 
                              
 
                        </ItemTemplate>
 
                        <EditItemTemplate>
 
                            <telerik:RadDatePicker ID="picker1" EnableAjaxSkinRendering ="true"  MinDate="2006/1/1" runat="server" DbSelectedDate='<%# Bind("Week") %>' AutoPostBack="true">
 
                            </telerik:RadDatePicker>
 
                        </EditItemTemplate>
 
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton">
 
                    </telerik:GridEditCommandColumn>
 
                </Columns>
 
            </MasterTableView>
 
        </telerik:RadGrid>
 
        <div style="display: none;">
 
            <telerik:RadCalendar ID="sharedCalendar" runat="server" EnableMultiSelect="false" >
 
            </telerik:RadCalendar>
 
        </div>
 
    </div>
 
    <div class="controls">
 
        <div>
 
            <label>
 
                RadDatePicker embedded in GridDateTimeColumn (internal "shared" calendar is in use):</label>
 
        </div>
 
        <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="False" Width="300px"
 
            OnNeedDataSource="RadGrid2_NeedDataSource" OnUpdateCommand="RadGrid2_UpdateCommand">
 
            <MasterTableView Width="100%" EditMode="InPlace">
 
                <Columns>
 
                    <telerik:GridDateTimeColumn HeaderText="Available dates" DataField="Week" DataFormatString="{0:D}">
 
                    </telerik:GridDateTimeColumn>
 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton">
 
                    </telerik:GridEditCommandColumn>
 
                </Columns>
 
            </MasterTableView>
 
        </telerik:RadGrid>
 
    </div>

using System;
using System.ComponentModel;
using System.Web.UI.WebControls.WebParts;
using Telerik.Web.UI;
using System.Linq;
using System.Data.Linq;
using System.Data;
using System.Collections;
using Microsoft.SharePoint;
using System.Web.UI.WebControls;
 
namespace LRM.Project_Site.testdatepicker
{
    [ToolboxItemAttribute(false)]
    public partial class testdatepicker : WebPart
    {
        LinqDataDataContext context = new LinqDataDataContext(Model.ConstList.ConnectionString);
        // Uncomment the following SecurityPermission attribute only when doing Performance Profiling on a farm solution
        // using the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
        // for production. Because the SecurityPermission attribute bypasses the security check for callers of
        // your constructor, it's not recommended for production purposes.
        // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
        public testdatepicker()
        {
        }
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            InitializeControl();
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
        }
 
      
  
 
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = context.HealthStatus;
        }
 
        protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
        {
 
            RadDatePicker picker = (RadDatePicker)e.Item.FindControl("picker1");
 
            picker.EnableAjaxSkinRendering = true;
            object newDate = picker.DbSelectedDate;
 
 
           
 
        }
 
 
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
 
                GridEditableItem editItem = (GridEditableItem)e.Item;
 
                RadDatePicker picker = (RadDatePicker)editItem.FindControl("picker1");
                picker.EnableAjaxSkinRendering = true;
                picker.SharedCalendar = sharedCalendar;
 
            }
 
        }
        protected void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
 
            RadGrid2.DataSource = context.HealthStatus;
 
        }
 
 
 
        protected void RadGrid2_UpdateCommand(object source, GridCommandEventArgs e)
        {
 
            RadDatePicker picker = ((e.Item as GridEditableItem)["Week"].Controls[0] as RadDatePicker);
 
            object newDate = picker.DbSelectedDate;
 
 
 
           
 
        }
    }
}

Viktor Tachev
Telerik team
 answered on 05 Mar 2014
6 answers
637 views
Hello, i have one radasyncupload on my page and when i run on my PC it work fine, but when i move it to server, this not work and all time that i upload any archive, this show the yellow ball blinking.

last time this was working on server, but now it stoped to work.


Edit: I found this when testing on server

return a.JSON.parse(b) (found a error here)

the ScreenShoot founderror.png show the Json.




Hristo Valyavicharski
Telerik team
 answered on 05 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?