Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
205 views
Hi,

I'm new to telerik and am getting a weird 'Expression of type 'Boolean' expected '  error when I try to load the following hierarchy page code:
<%--datasource for product radgrid--%> 
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"   
        ContextTypeName="DataClassesDataContext"   
        TableName="Products"   
        Select="new (id, name)" 
        OrderBy="name">  
    </asp:LinqDataSource> 
      
      
    <%--product data grid--%> 
    <telerik:radgrid ID="RadGrid1" runat="server"   
        AllowPaging="True"   
        AllowSorting="True" 
        AutoGenerateColumns="False"   
        GridLines="None"   
        DataSourceID="LinqDataSource1"   
        DataMember="DefaultView"   
        ShowFooter="True" 
        ShowStatusBar="True" > 
        <PagerStyle Mode="NumericPages" AlwaysVisible="true" /> 
        <MasterTableView   
            AutoGenerateColumns="False"   
            DataMember="DefaultView"   
            DataKeyNames="id" 
            DataSourceID="LinqDataSource1"   
            PageSize="10"   
            EditMode="PopUp" 
            HierarchyLoadMode="ServerOnDemand">  
            <NestedViewTemplate> 
                <asp:Panel runat="server" ID="InnerContainer">  
                      
                    <%--datasources for inner radgrid--%>                    
                    <asp:LinqDataSource ID="LinqDataSource2" runat="server"   
                        EnableDelete="True"   
                        EnableUpdate="True" 
                        ContextTypeName="DataClassesDataContext"   
                        TableName="ProductToSpecialOccasions"   
                        Select="new (id, ProductID, SpecialOccasionID)" 
                        OrderBy="ProductID"   
                        Where="ProductID equals @ProductID">  
                        <WhereParameters> 
                            <asp:Parameter Name="ProductID" Type="Int64" /> 
                        </WhereParameters> 
                    </asp:LinqDataSource> 
                  
                   <%--relationship data grid--%> 
                   <telerik:radgrid ID="RadGrid2" runat="server"   
                        AllowPaging="True"   
                        AllowSorting="True" 
                        AllowAutomaticInserts="True" 
                        AllowAutomaticDeletes="True" 
                        AutoGenerateColumns="False"   
                        GridLines="None"   
                        DataSourceID="LinqDataSource2"   
                        DataMember="DefaultView"   
                        ShowFooter="True" 
                        ShowStatusBar="True">  
                        <PagerStyle Mode="NumericPages" AlwaysVisible="true" /> 
                        <MasterTableView   
                            AutoGenerateColumns="False"   
                            DataKeyNames="id" 
                            PageSize="10"   
                            EditMode="InPlace" 
                            CommandItemDisplay="Top">  
                             <DetailTables> 
                                <telerik:GridTableView DataSourceID="LinqDataSource2" Width="100%" runat="server">  
                                    <ParentTableRelation> 
                                        <telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="id" /> 
                                    </ParentTableRelation> 
                                </telerik:GridTableView> 
                            </DetailTables> 
                            <Columns> 
                                <telerik:GridBoundColumn   
                                    UniqueName="id"   
                                    DataField="id"   
                                    DataType="System.Int64"   
                                    HeaderText="id"   
                                    ReadOnly="True"   
                                    SortExpression="id">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn   
                                    UniqueName="ProductID"   
                                    DataField="ProductID"   
                                    DataType="System.Int64"   
                                    HeaderText="ProductID"   
                                    SortExpression="ProductID">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn    
                                    UniqueName="SpecialOccasionID" 
                                    DataField="SpecialOccasionID"   
                                    DataType="System.Int64"   
                                    HeaderText="SpecialOccasionID"   
                                    SortExpression="SpecialOccasionID">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridButtonColumn ConfirmText="Delete this relationship?" ConfirmDialogType="RadWindow" 
                                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                                    UniqueName="DeleteColumn">  
                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                </telerik:GridButtonColumn> 
                            </Columns> 
                        </MasterTableView> 
                    </telerik:radgrid>    
                </asp:Panel> 
            </NestedViewTemplate> 
            <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn   
                    UniqueName="id"   
                    DataField="id"   
                    DataType="System.Int64"   
                    HeaderText="id"   
                    ReadOnly="True"   
                    SortExpression="id">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn   
                    UniqueName="name"   
                    DataField="name"   
                    DataType="System.Int64"   
                    HeaderText="name"   
                    ReadOnly="True"   
                    SortExpression="name">  
                </telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
    </telerik:radgrid> 

Basically I've got a many-to-many table mapping products to special occasions.  I'm trying to have an outter grid with the products and an inner-grid where the users can add or delete the special occasion relationships.  The code works if I remove the parenttablerelation and where clauses from linqdatasource2, but throws that weird bool error when I try to add them back in.  There are no bool values in the linqdatasource2 table so not sure where that value is coming from.

Does anyone see something in my code that could be causing issues?  Or is this scenario just not possible with radgrid and linq?
Janean Angeles
Top achievements
Rank 1
 answered on 05 Aug 2009
1 answer
152 views
Hi,

I have a RadGrid with a template column that doesn't appear properly in Excel after calling ExportToExcel. Currently the column appears, but the only value I see in the fields are the values from the DataField that the column is bound to. I am wanting to see my custom data that gets populated on the databind for this field in each row and does get shown correctly in the browser. This for some reason does not show in the exported excel document.
I also find I can only view anything in Excel after setting the Format to GridExcelExportFormat.ExcelML. If I don't set it to this then I get an excel document with no data in it. Setting MasterTableView.EnableColumnsViewState = true rectifies this, but only if I remove my template column, else I get the "Cannot create column with the specified type name: GridTextBoxColumn" error. So obviously that doesn't help me.

Any help would be greatly appreciated.

Thanks,
-Lindsay

Daniel
Telerik team
 answered on 05 Aug 2009
4 answers
155 views
Hi,

is there a "Show blocks" option in Editor as in FCKEditor? I can only find "Show table borders", but this does not show border of e.g. DIV or P.

Regards
Daniel
Daniel
Top achievements
Rank 1
 answered on 05 Aug 2009
0 answers
78 views
I have a PanelBar that is partially populated (via code behind) with a custom User Control.  When the user clicks on the control, how should I handle the postback and rebind the data (with controls)?  Currently the custom controls are being dropped when the item click event is fired.
Mark
Top achievements
Rank 1
 asked on 05 Aug 2009
1 answer
123 views
I have a radGrid within a radPanelBar.  The grid is loading properly.  How can I get access to the grid when a user clicks an ImageButton within a grid row?  I would typically do this via the ItemCommand event.

I'd also like to run some code during the ItemDataBound event of the grid (to set the CommandArgument).  How can I accomplish this?

Thanks.
Steven Black
Top achievements
Rank 1
 answered on 05 Aug 2009
1 answer
92 views
Hello,

I'm trying to find a way to force my radGrid to display alternating row colors properly after setting some rows visiblity to false.

After setting a row visible to false the rows outside the invisble row connect and displays the same color on neighbor rows.

Thanks so much for your help,

Evan
Evan
Top achievements
Rank 1
 answered on 05 Aug 2009
3 answers
150 views
Hi,

I have a radgrid who need to have the firstcolumn frozen. I set the property allowscroll (true), frozencolumncount (1) and usestaticheader(true).

If i use the scroll manually it works fine.

Also, on key press event of the grid i change my focused cell. But when i'm navigating to the right my first column(the frozen one) desapear like the frozen column isn't working correctly. The first column will be hidding a bit more each time i'll navigate to the right till it deseapear completly.

If i try to navigate back to the left or use the scroll i won't be able to make it reapear completly.

How can i keep the column frozen while i'm using navigation in my grid??

Thx again for your time!!!

Guillaume
Pavlina
Telerik team
 answered on 05 Aug 2009
2 answers
89 views
Hi,
I hope someboby could give me a hint here. I have a tabstrip on a masterpage:
        <telerik:RadTabStrip ID="rtab1" runat="server" AutoPostBack="True">
          <Tabs>
            <telerik:RadTab runat="server" Value="radtab1" Text="1" runat="server"
                NavigateUrl="~/page1.aspx" SelectedIndex="0" Selected="True"  />
            <telerik:RadTab runat="server" Value="radtab2" Text="2" runat="server"
                NavigateUrl="~/page2.aspx" SelectedIndex="1" />           
          </Tabs>
        </telerik:RadTabStrip>
Click to a tab, the page is displayed fine except the selected tab does not show as it is selected (like having new background color).
How to make it look like being selected. I tried the SelectedCssClass but it doesn't work.
Thanks.
d-cpt

d-cpt
Top achievements
Rank 2
 answered on 05 Aug 2009
5 answers
169 views
Hello,
I'm a beginner.
I want to do the job of grid in Filtering Template Columns, like 'Custom TemplateColumn Country' , I have realize the picture and the word, but The drop-down menu can't do. when I copy the whole code,the error like the following:
Server Error in '/Siemens.BPM.Profile.Website' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Unknown server tag 'custom:MyCustomFilteringColumn'.

Source Error:


Line 92:                         </telerik:GridBoundColumn>
Line 93:                           
Line 94:                   <custom:MyCustomFilteringColumn
Line 95:                          DataField="PermissionsNo" HeaderText="PermissionsNo"
Line 96:                             SortExpression="PermissionsNo"                          
 

Source File: /Siemens.BPM.Profile.Website/Demobin/WebForm1.aspx    Line: 94


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433


here is my code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Siemens.BPM.Profile.Website.Demobin.WebForm1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="custom" Namespace="Telerik.GridExamplesCS.Programming.FilteringTemplateColumns" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server" />
    <div>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
            function ShowEditForm(id, rowIndex)
            {
//                var grid = $find("<%= RadGrid1.ClientID %>");
                
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);
                        
                window.radopen("DemoPermissionEdit.aspx?PermissionsId=" + id, "UserListDialog");
                return false;
            }
            function ShowInsertForm()
            {
               window.radopen("DemoPermissionEdit.aspx", "UserListDialog");
               return false;
            }
            function refreshGrid(arg)
            {
             if(!arg)
             {
             $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");             
                }
                else
                {
             $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");             
                }
            }
            function RowDblClick(sender, eventArgs)
            {
             window.radopen("DemoPermissionEdit.aspx?PermissionsId=" + eventArgs.getDataKeyValue("PermissionsId"), "UserListDialog");
            }
            </script>
        </telerik:RadCodeBlock>
        
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadGrid
                OnItemCreated="RadGrid1_ItemCreated"
                ID="RadGrid1"
                runat="server"
                AllowPaging="True"
                Width="97%"
               OnNeedDataSource="RadGrid1_NeedDataSource"
            AllowFilteringByColumn="True" GridLines="None">
                <PagerStyle Mode="NumericPages" />
                <MasterTableView
                    AutoGenerateColumns="False"
                    DataKeyNames="PermissionsId"
                    ClientDataKeyNames="PermissionsId"
                    Width="100%"
                    CommandItemDisplay="Top"
                    PageSize="5">
                    <Columns>
                        <telerik:GridBoundColumn
                            DataField="PermissionsId"
                            HeaderText="PermissionsId"
                            ReadOnly="True"
                            SortExpression="PermissionsId"
                            UniqueName="PermissionsId">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn
                            DataField="PermissionsName"
                            HeaderText="PermissionsName"
                            SortExpression="PermissionsName"
                            UniqueName="PermissionsName">
                        </telerik:GridBoundColumn>
                          
                  <custom:MyCustomFilteringColumn
                         DataField="PermissionsNo" HeaderText="PermissionsNo"
                            SortExpression="PermissionsNo"                          
                         UniqueName="PermissionsNo" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" >
                         <ItemTemplate>
                         <img src='Image/<%# Eval("PermissionsNo") %>.gif' alt="" style="vertical-align:middle;margin-right:7px;"/><%# Eval("PermissionsNo")%>
                         </ItemTemplate>
            </custom:MyCustomFilteringColumn>                                           
                       <%--   <custom:MyCustomFilteringColumn
                         </custom:MyCustomFilteringColumn>
                         <telerik:GridBoundColumn
                            DataField="PermissionsNo"
                            HeaderText="PermissionsNo"
                            SortExpression="PermissionsNo"
                            UniqueName="PermissionsNo">
                        </telerik:GridBoundColumn>   --%>
                      
                        <telerik:GridTemplateColumn
                            UniqueName="TemplateEditColumn">
                             <ItemTemplate>                               
                                <asp:Image ID="EditLink" ImageUrl="../Images/Write2.gif"  runat="server" />
                                  <%--  <img src='Image/<%# Eval("PermissionsNo") %>.gif' alt="" style="vertical-align:middle;margin-right:7px;"/><%# Eval("PermissionsNo")%>     --%>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>

                    </Columns>
                    <CommandItemTemplate>
                        <a href="#" onclick="return ShowInsertForm();">Add New Record</a>
                    </CommandItemTemplate>
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="true" />
                    <ClientEvents OnRowDblClick="RowDblClick" />
                </ClientSettings>
            </telerik:RadGrid>
            
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                <Windows>
                    <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="400px"
                        Width="300px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />
                </Windows>
            </telerik:RadWindowManager>

    </div>
    </form>
</body>
</html>


Pavlina
Telerik team
 answered on 05 Aug 2009
5 answers
139 views
I can't seem to get postbacks working.

I've tried both BeginForm and BeginFormRoute methods around the RadPanelBar.

<% using (Html.BeginRouteForm("AddFilter", FormMethod.Post)) { %> 
        <telerik:RadPanelBar ID="filterAttributes" runat="server" Width="200px" /> 
<% } %> 

I've also tried the postbackurl attribute but to no avail. Is there an example anywhere of the RanPanelBarItem posting back to a controller action?

Cheers
Mac.
Atanas Korchev
Telerik team
 answered on 05 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?