Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
432 views
When y try to filter, the exception "Invalid column name" shows up
Here is the aspx
<p>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="RadGrid1" Width="100%" DataSourceID="SqlDataSource1" AllowFilteringByColumn="True"
        AllowSorting="True" AllowPaging="True" PageSize="7" runat="server" AutoGenerateColumns="False"
        OnPreRender="RadGrid1_PreRender" ShowStatusBar="true" EnableLinqExpressions="false">
        <MasterTableView DataKeyNames="IdEmpresa">
            <Columns>
                <telerik:GridBoundColumn UniqueName="Empresa" DataField="Empresa" HeaderText="Empresa"
                    AllowFiltering="false" HeaderStyle-Width="200px" />
                <telerik:GridBoundColumn UniqueName="Supergrupo" DataField="Supergrupo" HeaderText="Super Grupo"
                    HeaderStyle-Width="200px">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxTitle" DataSourceID="SqlDataSource2" DataTextField="SuperGrupo" AutoPostBack="false"
                            DataValueField="SuperGrupo" Height="200px" AppendDataBoundItems="true"
                            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("SuperGrupo").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="Todos" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
                            <script type="text/javascript">
                                function TitleIndexChanged(sender, args)
                                {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("SuperGrupo", args.get_item().get_value(), "EqualTo");
 
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Grupo" DataField="Grupo" HeaderText="Grupo" HeaderStyle-Width="200px">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxCity" DataSourceID="SqlDataSource3" DataTextField="Grupo" AutoPostBack="false"
                            DataValueField="Grupo" Height="100px" AppendDataBoundItems="true"
                            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Grupo").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="CityIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
 
                            <script type="text/javascript">
                                function CityIndexChanged(sender, args)
                                {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("Grupo", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
 
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <br />
    <telerik:RadToolTip ID="RadToolTip1" runat="server" OffsetY="3" Position="TopCenter"
        ShowCallout="false" Height="20px" ShowEvent="fromcode" />
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:BTIMEXICO_DESConnectionC %>"
        ProviderName="System.Data.SqlClient" runat="server"
        SelectCommand="SELECT E.idEmpresa, E.Nombre AS Empresa, GE.idgrupo, G.Descripcion AS Grupo, SG.Descripcion AS SuperGrupo
                       FROM tbl_empresa E
                       LEFT JOIN tbl_grupoempresa GE
                       ON E.idEmpresa = GE.idEmpresa
                       LEFT JOIN tbl_grupos G
                       ON GE.idgrupo = G.idgrupo
                       LEFT JOIN tbl_Supergrupo SG
                       ON SG.idsupergrupo = G.idsupergrupo
                       ORDER BY Nombre">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:BTIMEXICO_DESConnectionC %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT Descripcion AS SuperGrupo FROM tbl_supergrupo"
        runat="server">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:BTIMEXICO_DESConnectionC %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT Descripcion AS Grupo FROM tbl_grupos"
        runat="server">
    </asp:SqlDataSource>
</p>

And the Code-behind
using System;
using System.Linq;
using System.Data;
using Telerik.Web.UI;
 
namespace BCD.PP.VIEW
{
    public partial class Client_Question_Config_A : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
            }
        }
 
        protected void ImportedFilter_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
            DataRowView rowView = (DataRowView)e.Item.DataItem;
            if (rowView["Bool"] is DBNull)
            {
                e.Item.Text = "No";
                e.Item.Value = "0";
            }
            else if ((bool)rowView["Bool"])
            {
                e.Item.Text = "Yes";
                e.Item.Value = "1";
            }
        }
 
        protected void RadGrid1_PreRender(object sender, System.EventArgs e)
        {
            if (RadGrid1.MasterTableView.FilterExpression != string.Empty)
            {
                RefreshCombos();
            }
        }
        protected void RefreshCombos()
        {
            SqlDataSource2.SelectCommand = SqlDataSource2.SelectCommand + " WHERE " + RadGrid1.MasterTableView.FilterExpression.ToString();
            SqlDataSource3.SelectCommand = SqlDataSource3.SelectCommand + " WHERE " + RadGrid1.MasterTableView.FilterExpression.ToString();
            RadGrid1.MasterTableView.Rebind(); //<<< Here is where the exception pops up
        }
    }
}

Following the example from here

I suspect the problem may be because the SQLDataSource is composed by joins instead of being a single table
any idea on how to solve this?
James Campbell
Top achievements
Rank 1
 answered on 28 Mar 2012
1 answer
117 views
Sorry if this has been posted this in somewhere else.   


I'm using a RadComboBox (ASP.Net) that has properties:
CloseDropDownOnBlur="true"
MarkFirstMatch="true"
AllowCustomText="true"


The Problem I'm facing is: 
If user start typing your own title, the pre-defined values starts to appear.
Say, the user types a single letter, say "N" into the box and it instantly selects the first option that starts with a 'N' (the list is presorted) and fill in that option in the box.
When you click off the combobox, is takes what you typed followed with the predefined value.


For e.g.: 'nNetwork Administrator'

I typed in "n"

'Network Administrator' automatically got taged on to the end there.


This happens on IE 9, IE8, Safari and Chrome but not on Mozilla (My Mozilla version is 3.6.28).
The Telerik RdComboBox Version I'm using is: 2.8.5.0

Please advice. 
Thanks in Advance
Ivana
Telerik team
 answered on 28 Mar 2012
1 answer
86 views
Dear Telerik,

After the upgrade form 2011.3.1115.40  to 2012.1.215.40 I had I lot of errors. Some thinks where fixed by the CAG and copieing dll's in the bin dir.

Any update gives me the creeps, it's giving me always troubles so it is not a thing I looking forward to.

This time I've spend over two days struggeling with the newest update, conlcuding that i had to roll back everything and stick with the 2011Q3 version.
For example im using the Documentmanger with Physical Paths which didnt work out.
So in the end ive build a new project complete according to the Telerik examples, and thank god... it didnt work in that project either...

Everything works fine until you want to insert that selected document into the RadEditor. I have search the code for a javascript Event on the insert button, I have set on every JS function a breakpoint none of them has been hit.

We did a rollback and it worked like a charme!

So there must be somthing wrong with it.

Regards Marco.
Rumen
Telerik team
 answered on 28 Mar 2012
3 answers
260 views
I am try to access the GridFooterItem on databound event and GridFooterItem.DataItem is nothing. 

Why I am getting Nothing for  "GridFooterItem.DataItem"?
Eyup
Telerik team
 answered on 28 Mar 2012
3 answers
191 views
Hi!

Is there a way to hide or change the attached button?

<telerik:RadTextBox ID="radTextBoxUsername" runat="server" CssClass="inputBox" ClientEvents-OnKeyPress="OnKeyPress"
                    MaxLength="16" ClientEvents-OnBlur="UsernameTextBoxValueChanged" SelectionOnFocus="SelectAll">
                    <ClientEvents OnKeyPress="OnKeyPress" OnBlur="UsernameTextBoxValueChanged"></ClientEvents>
                    <InvalidStyle CssClass="inputBoxInvalid" />
                </telerik:RadTextBox>
Michael O'Flaherty
Top achievements
Rank 2
 answered on 28 Mar 2012
3 answers
190 views
We're currently using an older version of Telerik (from 2009).  We are located in Arizona. DST has always been a huge hassle for us, requiring manual editing of appointments for customers in areas that do DST (e.g. all but Arizona).  Example: It's Friday, and the DST switch-over happens on Sunday. If they schedule an appointment for Monday in Mountain time, the UTC time saved to the database will be an hour off.  This requires us to edit the offsets on every time zone on the scheduler (except Arizona), but it's nearly impossible to time this edit in such a way that eliminates a huge pile of mis-scheduled appointments twice a year. People seriously dread "DST week" in our office because it means overtime spent correcting scheduling mistakes and calling customers.

I noticed that in the most recent update, it was mentioned that the time zone handling has become more advanced.  In the documentation it was unclear if this new functionality would help us to correctly handle DST.  Is there anywhere I can read more about the "CustomTimeZones" referred to in the changelog?  We are trying to decide if it is worth re-purchasing Telerik for this (it most certainly would be if let us handle DST correctly).

Also, any additional insight as to how we can properly handle DST would be much appreciated.  We currently only deal with Pacific, Mountain, Arizona, Central, and Eastern.

Thanks!
Plamen
Telerik team
 answered on 28 Mar 2012
5 answers
2.1K+ views
Hi,

I have a radtextbox in my screen. When user enters the characters by default it should display in capital letter.

I have written like this, but it is not working

<

 

 

telerik:RadTextBox ID="radtxtCarrierComments" MaxLength="50" Width="350px" runat="server" onkeypress="return AllowAlphaNumericandSpace(event);" onkeydown="javascript:EnableOk();" AutoPostBack="true" style="text-transform: uppercase;">

 

 

 

</telerik:RadTextBox>

In this I have both onkeypress and onkeydown client events + i have set the style property.

Can anybody help me in this?

 

Massimo
Top achievements
Rank 1
 answered on 28 Mar 2012
1 answer
77 views
Dear experts,

I am wondering whether I can apply rotator to do something like this page:

http://www.bmj.com/ (the rotating banner)

I was looking at demo page and I am not sure which mode is suitable:
http://demos.telerik.com/aspnet-ajax/rotator/examples/overview/defaultcs.aspx


or am I looking at the wrong control?

Many thanks for your help!!!

Ray
Slav
Telerik team
 answered on 28 Mar 2012
1 answer
201 views
Hi,
    How to find a rad treeview node using the tree node full path.
    I got the full path as string.   
    I want to get the tree node using that full path.
How to get it.
Plamen
Telerik team
 answered on 28 Mar 2012
3 answers
298 views
Hi,

We are using RadButton as CheckBoxes and we catch a problem when trying to check the button with the keyboard, when the user checks it with the space key, only the client-side event fires.

We tried first this code:
<telerik:RadButton runat="server" ID="chkIMOPRO" Text="IMO Product" ButtonType="ToggleButton"
               AutoPostBack="true" ToggleType="CheckBox" OnCheckedChanged="chkIMOPRO_CheckedChanged">
               <ToggleStates>
                   <telerik:RadButtonToggleState Selected="true" />
                   <telerik:RadButtonToggleState Selected="false" />
               </ToggleStates>
</telerik:RadButton>

With that code, everything worked fine, but when one user tried to check it with the keyboard, nothing really happens, we are getting to the server side through RadAjax:
<telerik:RadAjaxManager runat="server" ID="ajaxManager" OnAjaxRequest="ajaxRequest"
        EnableAJAX="true">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="chkIMOPRO" EventName="chkIMOPRO_CheckedChanged">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlIMOINFO" LoadingPanelID="loadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

And then, we tried the following approach:
function chkIMOPRO_CheckedChanged(sender, args) {
    alert('');
}

<telerik:RadButton runat="server" ID="chkIMOPRO" Text="IMO Product" ButtonType="ToggleButton"
    AutoPostBack="true" ToggleType="CheckBox" OnCheckedChanged="chkIMOPRO_CheckedChanged"
    OnClientCheckedChanged="chkIMOPRO_CheckedChanged">
    <ToggleStates>
        <telerik:RadButtonToggleState Selected="true" />
        <telerik:RadButtonToggleState Selected="false" />
    </ToggleStates>
</telerik:RadButton>

And it worked, the client-side event fires in the two cases (by keyboard space and by mouse click).

We know we can get it to work by activating ajax through javascript, but we think this would be unecessary code.

Is there any bug or approach related to this issue?

Thanks;
Slav
Telerik team
 answered on 28 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?