Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
250 views
Hello!

I have a simple grid with a sql data source attached and when I filter my decimal column with a value like .01 it returns an error message that I will paste below, but if I try filtering by 0.01 it works. Is this intentional and if not, is there a fix for this?

Thanks!


Expression expected
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: Telerik.Web.UI.ParseException: Expression expected
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
 
[ParseException: Expression expected]
   Telerik.Web.UI.ExpressionParser.ParsePrimaryStart() +245
   Telerik.Web.UI.ExpressionParser.ParsePrimary() +47
   Telerik.Web.UI.ExpressionParser.ParseUnary() +404
   Telerik.Web.UI.ExpressionParser.ParseMultiplicative() +54
   Telerik.Web.UI.ExpressionParser.ParseAdditive() +54
   Telerik.Web.UI.ExpressionParser.ParseComparison() +128
   Telerik.Web.UI.ExpressionParser.ParseLogicalAnd() +49
   Telerik.Web.UI.ExpressionParser.ParseLogicalOr() +49
   Telerik.Web.UI.ExpressionParser.ParseExpression() +74
   Telerik.Web.UI.ExpressionParser.ParseParenExpression() +68
   Telerik.Web.UI.ExpressionParser.ParsePrimaryStart() +169
   Telerik.Web.UI.ExpressionParser.ParsePrimary() +47
   Telerik.Web.UI.ExpressionParser.ParseUnary() +404
   Telerik.Web.UI.ExpressionParser.ParseMultiplicative() +54
   Telerik.Web.UI.ExpressionParser.ParseAdditive() +54
   Telerik.Web.UI.ExpressionParser.ParseComparison() +69
   Telerik.Web.UI.ExpressionParser.ParseLogicalAnd() +49
   Telerik.Web.UI.ExpressionParser.ParseLogicalOr() +49
   Telerik.Web.UI.ExpressionParser.ParseExpression() +74
   Telerik.Web.UI.ExpressionParser.Parse(Type resultType) +76
   Telerik.Web.UI.DynamicExpression.ParseLambda(ParameterExpression[] parameters, Type resultType, String expression, Object[] values) +92
   Telerik.Web.UI.DynamicExpression.ParseLambda(Type itType, Type resultType, String expression, Object[] values) +132
   Telerik.Web.UI.GridDynamicQueryable.Where(IQueryable source, String predicate, Object[] values) +235
   Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +3948
   Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +1078
   Telerik.Web.UI.GridResolveEnumerable.Initialize() +58
   Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +45
   Telerik.Web.UI.GridResolveEnumerable.get_DataTable() +36
   Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, DataView dataView, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +244
   Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +109
   Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +755
   Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +257
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +733
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +1287
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +123
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138
   Telerik.Web.UI.GridTableView.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
   Telerik.Web.UI.GridTableView.DataBind() +388
   Telerik.Web.UI.GridTableView.Rebind() +108
   Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source) +1105
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +205
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +71
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +147
   Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) +88
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +12376
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9528682
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724


Shinu
Top achievements
Rank 2
 answered on 01 Aug 2014
1 answer
233 views
When I Edit one of my RadGrid rows, or 'Add New Record', RadGrid displays all the fields in the table stacked on top of each other by default. How can I change the layout for those input controls -- say if I want to display in two columns of input controls?
Shinu
Top achievements
Rank 2
 answered on 01 Aug 2014
1 answer
207 views
I have this Grid with ajax settings, the grid have some pages, when i click export to excel onle the first page get exported even i have this in the export event 
GrdDetalle.ExportSettings.IgnorePaging = true; also i populate the grid with the event NeedDataSource

hope someone can help me.

 private void GrdResumen_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            string StrSqlRes;

            if (Session["StrSqlRes"] == null)
                StrSqlRes = "Select Nombre_Producto,Codigo_especie,Sum(Volumen) as Volumen from itema a, det_itema_mat_prima b, Producto_Madera c, Especie d where a.id_rfn = b.id_rfn and a.Periodo = b.periodo and a.AÑO = b.AÑO and b.Codigo_Producto = c.Codigo_producto and b.Id_Especie = d.Id_Especie and RegistroRFN =  '0' group by Nombre_Producto,Codigo_especie order by Nombre_Producto,Codigo_especie";
            else
                StrSqlRes = Session["StrSqlRes"].ToString();

            Util.LlenaGrid(StrSqlRes, GrdResumen);

        }

Here is a sample of my Code
protected void imgbExport_Click(object sender, ImageClickEventArgs e)
        {
            GrdDetalle.ExportSettings.ExportOnlyData = true;
            GrdDetalle.ExportSettings.IgnorePaging = true;
            GrdDetalle.ExportSettings.FileName = "Reporte de Ingresos de Materia Prima";
            GrdDetalle.ExportSettings.OpenInNewWindow = true;
            GrdDetalle.MasterTableView.ExportToExcel();
        }

HTML
Grid

<telerik:RadGrid runat="server" ID="GrdResumen" PageSize="5"
                AutoGenerateColumns="false" Width="100%" AllowSorting="true" 
                    AllowPaging="true" GridLines="None" >
                <PagerStyle Mode="NextPrevAndNumeric" NextPageText="Siguiente" 
                  PrevPageText="Anterior" Position="Bottom" 
                  PagerTextFormat="Change page: {4} &amp;nbsp;Pagina &lt;strong&gt;{0}&lt;/strong&gt; de &lt;strong&gt;{1}&lt;/strong&gt;, registros &lt;strong&gt;{2}&lt;/strong&gt; a &lt;strong&gt;{3}&lt;/strong&gt; de &lt;strong&gt;{5}&lt;/strong&gt;." 
                  PageSizeLabelText="Regitros"/>
                <MasterTableView DataKeyNames="Nombre_Producto,Codigo_especie,Volumen" NoMasterRecordsText="No Hay Registros" ShowFooter="true" CommandItemDisplay="Top">
                <CommandItemTemplate>
                        <table>
                            <tr>
                                <td align="center">
                                    <asp:ImageButton ID="imgbExport" ImageUrl="~/Imagenes/xls.png" ToolTip="Exportar a Excel" runat="server" AlternateText="Export" OnClick="imgbExport2_Click" />
                                </td>
                                
                            </tr>
                            <tr>
                                <td align="center">
                                    <asp:Label ID="Label8" runat="server" Text="Exportar a Excel"></asp:Label>
                                </td >
                            </tr>
                        </table>
                        <br />
            
                        <br />
            
                    </CommandItemTemplate>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Nombre_Producto"   FooterText="Volumen Total (m³)" FooterStyle-Font-Bold="true" HeaderText="Producto" HeaderStyle-Width="225px">
                            <HeaderStyle Width="225px"></HeaderStyle>
                        </telerik:GridBoundColumn>  
                        <telerik:GridBoundColumn DataField="Codigo_especie" HeaderText="especie" HeaderStyle-Width="225px">
                            <HeaderStyle Width="225px"></HeaderStyle>
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Volumen" DataFormatString="{0:#,##0.00}" Aggregate="Sum" FooterStyle-Font-Bold="true" FooterAggregateFormatString="{0:#,##0.00}" HeaderText="Volumen (m³)" HeaderStyle-Width="225px">
                            <HeaderStyle Width="225px"></HeaderStyle>
                        </telerik:GridBoundColumn>
                    </Columns>        
                </MasterTableView>
                <FilterMenu EnableTheming="true">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </FilterMenu>
                </telerik:RadGrid>

This is the ajax configuration
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  EnableSkinTransparency="true" BackgroundPosition="Top" Skin="">
        <asp:Image ID="Image1" runat="server" ImageUrl="~/Imagenes/cargando.gif" AlternateText="cargando" />
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="mngRequestStarted">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="GrdDetalle">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GrdDetalle" />
                    <telerik:AjaxUpdatedControl ControlID="TblUno" />
                    <telerik:AjaxUpdatedControl ControlID="LoginControl1" />
                    <telerik:AjaxUpdatedControl ControlID="GrdDetalle" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CmdGen">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GrdDetalle" />
                    <telerik:AjaxUpdatedControl ControlID="GrdResumen" />
                    <telerik:AjaxUpdatedControl ControlID="LblMensaje" />
                    <telerik:AjaxUpdatedControl ControlID="LnlNRF" />
                    <telerik:AjaxUpdatedControl ControlID="LblNomEmpresa" />
                    <telerik:AjaxUpdatedControl ControlID="LblDireccion" />
                    <telerik:AjaxUpdatedControl ControlID="LblActiva" />
                    <telerik:AjaxUpdatedControl ControlID="LblDia" />
                    <telerik:AjaxUpdatedControl ControlID="LblRegion" />
                    <telerik:AjaxUpdatedControl ControlID="LblSubregion" />
                    <telerik:AjaxUpdatedControl ControlID="LblPeriodo" />
                    <telerik:AjaxUpdatedControl ControlID="LblUsuario" />
                    <telerik:AjaxUpdatedControl ControlID="LblNIT" />
                    <telerik:AjaxUpdatedControl ControlID="LblFecIng" />
                    <telerik:AjaxUpdatedControl ControlID="TblUno" />
                    <telerik:AjaxUpdatedControl ControlID="LoginControl1" />
                    <telerik:AjaxUpdatedControl ControlID="TxtMostro" />
                    <telerik:AjaxUpdatedControl ControlID="CmdGen" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="imgbExport">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GrdDetalle" />
                    <telerik:AjaxUpdatedControl ControlID="GrdResumen" />
                    <telerik:AjaxUpdatedControl ControlID="imgbExport" />
                    <telerik:AjaxUpdatedControl ControlID="GrdDetalle" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="GrdResumen">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GrdResumen" />
                    <telerik:AjaxUpdatedControl ControlID="imgbExport" />
                    <telerik:AjaxUpdatedControl ControlID="GrdResumen" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
        </telerik:AjaxSetting>
        </AjaxSettings>
        <ClientEvents OnRequestStart="mngRequestStarted" />
    </telerik:RadAjaxManager>

function to disabled ajax on grid button
function mngRequestStarted(ajaxManager, eventArgs) {
            if (eventArgs.get_eventTarget().indexOf("imgbExport") != -1)
                eventArgs.set_enableAjax(false);
        }





Hector Hernandez
Top achievements
Rank 2
 answered on 01 Aug 2014
1 answer
147 views
Hi all,
 i display images in a binaryimage control in a listview as an item template. Is there a possibility to rotate the image.

Thanks in advance
Shinu
Top achievements
Rank 2
 answered on 01 Aug 2014
2 answers
167 views
Hi .
i have a radgrid and one level detail table.
i want hide detail button in specific condition.
for example row 1 has detail table but row 2 doesn't and ......
how it's possible ?
Princy
Top achievements
Rank 2
 answered on 01 Aug 2014
3 answers
231 views
Hi,
I have this template column which is calculating and showing the result of cost x quantity or alternatively quantity x Alternative Cost.
I would like to make this column sortable by clicking on the header but all I have tried up to now does not work.
I have tried to set the SortExpression but still does not sort, the header gets activated but there is no sorting.
Any help will be appreciated.
Thanks,
Felice


<telerik:GridTemplateColumn FilterControlAltText="Filter TotalCost column" HeaderText="Total Cost" UniqueName="TotalCost">
  <HeaderStyle Width="70px" />
  <ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
 
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
      if (e.Item is GridDataItem)
        {
            #region Calculate Total Cost
            //Get the special cost. If the value does not exist, it means the special cost is 0
            double specialcost = ((cell.Text.Trim()) != " " && !String.IsNullOrWhiteSpace(cell.Text.Trim())) ? double.Parse(cell.Text.Trim()) : 0;
            double cost = ((dataBoundItem["Cost"].Text.Trim()) != " " && !String.IsNullOrWhiteSpace(dataBoundItem["Cost"].Text.Trim())) ? double.Parse(dataBoundItem["Cost"].Text.Trim()) : 0;
            //If the special cost is 0 than total cost = cost * quantity
            if (specialcost == 0)
            {
                dataBoundItem["TotalCost"].Text = (cost * (Convert.ToDouble(dataBoundItem["Quantity"].Text))).ToString("N0");
            }
            else //If special cost exists than total cost = special cost * quantity
            {
                dataBoundItem["TotalCost"].Text = ((Convert.ToDouble(dataBoundItem["AlternCost"].Text)) * (Convert.ToDouble(dataBoundItem["Quantity"].Text))).ToString("N0");
            }
            #endregion
}
}
Shinu
Top achievements
Rank 2
 answered on 01 Aug 2014
1 answer
70 views
I have a radcombobox and a button control, i want to select a particular item in radcombo box on button click,completely through client side, can any one give me an example on how to implement it using javascript or jquery.If not possible then on server side.







Thanks

Sandeep
Shinu
Top achievements
Rank 2
 answered on 01 Aug 2014
3 answers
135 views
I am trying to not display(or remove or hide, etc.) a record when the nested grid for that record contains a certain value. How would I do this in the cs? If it does not contain that value then I would like to display it like it normally would. I have attached a screenshot to better display what I am trying to achieve.
Princy
Top achievements
Rank 2
 answered on 01 Aug 2014
2 answers
224 views
i have a series of "nested" child controls in a .net site.  i need to be able to use the client side api against telerik controls that are layered down in the nested controls from both the aspx page, and "parent' level controls - hope that makes sense.

I have done the same api work down one level, but not successful to date with multiple layers of nesting. 

thanks
Shinu
Top achievements
Rank 2
 answered on 01 Aug 2014
2 answers
182 views
Hello,

I'm trying to implement a pretty simple 3 level RadGrid(Master + 2 Detail) and no matter what I try I can't get it to display the 3rd level.  The first two levels expand properly, but the third just expands blank.  I'm sure I'm just missing something simple but wasn't sure where to look.  

Here's my Code:

01.<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" ShowFooter="True" Skin="Forest" DataSourceID="SqlDataSourceRegion">
02.                <MasterTableView AutoGenerateColumns="true" DataKeyNames="region_id" ShowFooter="False">
03.                    <DetailTables>
04.                        <telerik:GridTableView runat="server" DataKeyNames="region_id" DataSourceID="SqlDataSourceCommunity" ShowFooter="False" AllowMultiColumnSorting="True" AllowSorting="True">
05.                            <DetailTables>
06.                                <telerik:GridTableView runat="server" DataKeyNames="community_id" DataSourceID="SqlDataSourceHomes" AllowSorting="True">
07.                                    <ParentTableRelation>
08.                                        <telerik:GridRelationFields DetailKeyField="community_id" MasterKeyField="community_id" />
09.                                    </ParentTableRelation>
10.                                </telerik:GridTableView>
11.                            </DetailTables>
12.                            <ParentTableRelation>
13.                                <telerik:GridRelationFields DetailKeyField="region_id" MasterKeyField="region_id" />
14.                            </ParentTableRelation>
15.                        </telerik:GridTableView>
16.                    </DetailTables>
17.                </MasterTableView>
18.            </telerik:RadGrid>
19.        </div>
20.        <br />
21.        <asp:SqlDataSource ID="SqlDataSourceRegion"
22.            ConnectionString="<%$ ConnectionStrings:LEAD %>"
23.            ProviderName="System.Data.SqlClient"
24.            SelectCommand="SELECT region_id, region_name FROM all_communities_regions_types " runat="server"></asp:SqlDataSource>
25. 
26.         <asp:SqlDataSource ID="SqlDataSourceCommunity"
27.            ConnectionString="<%$ ConnectionStrings:LEAD %>"
28.            ProviderName="System.Data.SqlClient"
29.            SelectCommand="SELECT c.community_id, c.name, r.region_id FROM all_communities c INNER JOIN all_communities_regions r ON c.community_id=r.community_id WHERE r.region_id=@region_id"
30.             runat="server">
31.            <SelectParameters>
32.                <asp:SessionParameter Name="region_id" SessionField="region_id" Type="string"/>
33.            </SelectParameters>
34.         </asp:SqlDataSource>
35.         
36.         <asp:SqlDataSource ID="SqlDataSourceHomes"
37.            ConnectionString="<%$ ConnectionStrings:LEAD %>"
38.            ProviderName="System.Data.SqlClient"
39.            SelectCommand="SELECT TOP 5 home_id, beds, bath, community_id FROM homes WHERE community_id = @community_id" runat="server">
40.            <SelectParameters>
41.                <asp:SessionParameter Name="community_id" SessionField="community_id" Type="string" />
42.            </SelectParameters>
43.        </asp:SqlDataSource>

Any thoughts?
-Jeff
Jeff
Top achievements
Rank 1
 answered on 31 Jul 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?