Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
142 views
I have the following requirements:

  1. Access the filter expression on the client.
  2. Save the filter expression to database using AJAX.
  3. Get filter expression from database using AJAX.
  4. Apply saved filter expression to filter.

I know I can do steps 2 and 3, if I can do step 1.  Can I do steps 1 and 4?  If so, can you please provide examples?

John
Mandy
Top achievements
Rank 2
 answered on 09 May 2011
16 answers
557 views
The Internet Explorer 9 beta 1 has caused a lot of misalignment, gaps, and weirdness in my Telerik-based ASP.NET 4 Web application. This is expected as IE moves more towards standards and away from quirks.

For me, the issue is whether I try to compensate for IE 9's rendering standards or whether I wait until Telerik's controls are updated.

Telerik's controls already detect the browser and adjust their output accordingly so that's the preferable approach. Do we have a timeline on when we'll start seeing builds that are IE 9 aware?

I'd like to hear Telerik's advice on how to proceed.

Thanks!

Ken
Marco Piumi
Top achievements
Rank 2
 answered on 09 May 2011
6 answers
743 views
Hi,
the code of a grid with template columns follows:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
            function ShowColumnHeaderMenu(ev, columnName) {
                var grid = $find("<%=RadGrid1.ClientID %>");
                var columns = grid.get_masterTableView().get_columns();
                 
                for (var i=0; i < columns.length; i++)
                {
                    if (columns[i].get_uniqueName() == columnName)
                    {
                        columns[i].showHeaderMenu(ev, 75, 20);
                    }
                }
            }
        </script>
 
    </telerik:RadCodeBlock>
    <div>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
            AllowPaging="True" AllowSorting="True" CellSpacing="0"
            Culture="Italian" DataSourceID="SqlDataSource1" GridLines="None"
            PageSize="20" ShowStatusBar="True" Skin="Office2007"
            Width="99%" EnableHeaderContextFilterMenu="True"
            EnableHeaderContextMenu="True" >
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"
                enableimagepreloading="True"></HeaderContextMenu>
 
            <PagerStyle FirstPageToolTip="Pagina iniziale" LastPageToolTip="Ultima pagina"
                NextPagesToolTip="Pagine successive" NextPageToolTip="Pagina successiva"
                PagerTextFormat="Cambia pagina: {4} &nbsp;Pagina <strong>{0}</strong> di <strong>{1}</strong> - Righe da <strong>{2}</strong> a <strong>{3}</strong> - Numero righe totali <strong>{5}</strong>."
                PageSizeLabelText="Numero righe:" PrevPagesToolTip="Pagine precedenti"
                PrevPageToolTip="Pagina precedente" />
 
            <PagerStyle AlwaysVisible="True" />
            <MasterTableView autogeneratecolumns="False" datakeynames="idContratto" IsFilterItemExpanded="false"
                datasourceid="SqlDataSource1" allowmulticolumnsorting="True">
                 
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                 
                <Columns>
                    <telerik:GridBoundColumn DataField="idContratto" DataType="System.Int64"
                        Display="False" FilterControlAltText="Filtra per idContratto"
                        HeaderText="idContratto" ReadOnly="True" SortExpression="idContratto"
                        UniqueName="idContratto" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="Cliente" SortExpression="Cliente"
                        UniqueName="Cliente" Groupable="False">
                        <HeaderTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="LinkButton_Cliente" runat="server" CommandArgument="Cliente" CommandName="Sort" Text="Cliente"></asp:LinkButton>
                                    </td>
                                    <td>
                                        <img src="img/menu.gif" style="margin-top: 5px; margin-left: 5px; cursor: pointer" onclick='ShowColumnHeaderMenu(event,"Cliente")' alt="Apri menu" />
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblCliente" runat="server" Text='<%#Eval("Cliente") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="Contratto" SortExpression="Contratto"
                        UniqueName="Contratto" Groupable="False">
                        <HeaderTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="LinkButton_Contratto" runat="server" CommandArgument="Contratto" CommandName="Sort" Text="Contratto"></asp:LinkButton>
                                    </td>
                                    <td>
                                        <img src="img/menu.gif" style="margin-top: 5px; margin-left: 5px; cursor: pointer" onclick='ShowColumnHeaderMenu(event,"Contratto")' alt="Apri menu" />
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblContratto" runat="server" Text='<%#Eval("Contratto") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="DataContratto"
                        DataType="System.DateTime" SortExpression="DataContratto"
                        UniqueName="Data Contratto" Groupable="False">
                        <HeaderTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="LinkButton_DataContratto" runat="server" CommandArgument="DataContratto" CommandName="Sort" Text="Data Contratto"></asp:LinkButton>
                                    </td>
                                    <td>
                                        <img src="img/menu.gif" style="margin-top: 5px; margin-left: 5px; cursor: pointer" onclick='ShowColumnHeaderMenu(event,"DataContratto")' alt="Apri menu" />
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblDataContratto" runat="server" Text='<%#Eval("DataContratto") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="StatoContratto"
                        SortExpression="StatoContratto" UniqueName="Stato Contratto" Groupable="False">
                        <HeaderTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="lnkSort" runat="server" CommandArgument="StatoContratto" CommandName="Sort" Text="Stato Contratto"></asp:LinkButton>
                                    </td>
                                    <td>
                                        <img src="img/menu.gif" style="margin-top: 5px; margin-left: 5px; cursor: pointer" onclick='ShowColumnHeaderMenu(event,"StatoContratto")' alt="Apri menu" />
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblStatoContratto" runat="server" Text='<%#Eval("StatoContratto") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="BC" SortExpression="BC"
                        UniqueName="Business Consultant" Groupable="False">
                        <HeaderTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="LinkButton_BC" runat="server" CommandArgument="BC" CommandName="Sort" Text="Business Consultant"></asp:LinkButton>
                                    </td>
                                    <td>
                                        <img src="img/menu.gif" style="margin-top: 5px; margin-left: 5px; cursor: pointer" onclick='ShowColumnHeaderMenu(event,"BC")' alt="Apri menu" />
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblBC" runat="server" Text='<%#Eval("BC") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="PM" SortExpression="PM"
                        UniqueName="Project Manager" Groupable="False">
                        <HeaderTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="LinkButton_PM" runat="server" CommandArgument="PM" CommandName="Sort" Text="Project Manager"></asp:LinkButton>
                                    </td>
                                    <td>
                                        <img src="img/menu.gif" style="margin-top: 5px; margin-left: 5px; cursor: pointer" onclick='ShowColumnHeaderMenu(event,"PM")' alt="Apri menu" />
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblPM" runat="server" Text='<%#Eval("PM") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
            </MasterTableView>
 
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
 
            <clientsettings allowcolumnsreorder="True" reordercolumnsonclient="True">
                <selecting allowrowselect="True" />
                <scrolling allowscroll="True" usestaticheaders="True" />
            </clientsettings>
 
            <FilterMenu EnableImageSprites="False"></FilterMenu>
                <sortingsettings sortedasctooltip="Ordinamento crescente"
                    sorteddesctooltip="Ordinamento decrescente" sorttooltip="Clicca per ordinare" />
        </telerik:RadGrid>

I have two problem:
1) One of the columns is a date. How can I set the its format in dd/MM/yyyy?
2) How can I set EnableVirtualScrollingPaging to "True"? I tried to type such property but nothing happened

Please help me

Thanks
Veli
Telerik team
 answered on 09 May 2011
1 answer
63 views

I found one problem when I am creating ribbon structure by code. If I first fill group with buttons and afterwards add Group to tab, buttons dont have correct reference to tab or ribbon and page rendering fails.

RibbonBarTab tab = new RibbonBarTab();
  
RibbonBarGroup group = new RibbonBarGroup();
  
RibbonBarButton button1 = new RibbonBarButton();
group.Items.Add(button1);
  
RibbonBarButton button2 = new RibbonBarButton();
group.Items.Add(button2);
  
tab.Groups.Add(group);
  
ribbon.Tabs.Add(tab);

This works correctly:
RibbonBarTab tab = new RibbonBarTab();
ribbon.Tabs.Add(tab);
  
RibbonBarGroup group = new RibbonBarGroup();
tab.Groups.Add(group);
  
RibbonBarButton button1 = new RibbonBarButton();
group.Items.Add(button1);
  
RibbonBarButton button2 = new RibbonBarButton();
group.Items.Add(button2);



Nikolay Tsenkov
Telerik team
 answered on 09 May 2011
6 answers
512 views
Hi,

I set "AllowMultiRowSelection" to "true" in the grid, which causes GridClientSelectColumn columns to be added in the first column of the grid. The issue is that when I highlight a row, the checkbox is selected.
Is there any property/event that I can set/remove to prevent checking off the checkbox when I highlight the row?


Thanks in advance,
Mohammad
Veli
Telerik team
 answered on 09 May 2011
1 answer
164 views
Hi,

I can't apply style to callout arrow.

Screenshots attached.

I've tried backcolor attribute of tooltip, and background-image & background-color in stylesheet. backcolor does not change anything (attachment 1 - tooltip1.png), instyle background-color change whole background but callout arrow still gray (attachment 2 - tooltip2.png).

Please help.
Marin Bratanov
Telerik team
 answered on 09 May 2011
2 answers
293 views
Dear Telerik Team,

I am using Telerik Rad Grid with GridDateTimeColumn. Please find below code pasted for reference. When this column as empty values and if user filters this date column it shows an error in IE. Also when user adds string like "test" in date picker in filterbar then nothing happens. Please also find the error message below.

Code:
<telerik:GridDateTimeColumn DataField="dtmTermDate" HeaderText="Termination Date" DataFormatString="{0:MM/dd/yyyy}"
SortExpression="dtmTermDate" UniqueName="dtmTermDate" HeaderTooltip="Termination Date" PickerType="DatePicker" ShowFilterIcon="true" ConvertEmptyStringToNull="true">
</telerik:GridDateTimeColumn>


Error in IE: 

Message: Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.
Line: 4723
Char: 21
Code: 0
URI: http://localhost/Test/ScriptResource.axd?d=6gQs4Ep8lZdvCRTPnRQh8ewwwsj0oRdqcYcj0780GUlE7uHPItLaQBPSqRnOCJ6nFZOBafLdJr9TM4kY6q2ceFVLqoVgM5Nu1uJkbrcLvcU1&t=ffffffffec2d9970

Please help. Thank you.

Regards

Pathan L.
L. M. Pathan
Top achievements
Rank 1
 answered on 09 May 2011
4 answers
470 views
Hi:

I have a RadGrid where I have set EnablePostBackOnRowClick="true".  On special situation, however, when a user click on a specific row (e.g.: if the value on a key is "xyz"), then I don't want the postback to take place. 

I have tried to trap the OnRowSelecting event and was hoping that the following 2 lines of codes could cancel the postback.  However, they don't. The postback occur anyway.
            
eventArgs.set_cancel(true);
return false;

Is there a way to cancel a postback when EnablePostBackOnRowClick="true"?

Justin
Vasssek
Top achievements
Rank 1
 answered on 09 May 2011
6 answers
199 views
I have one form with multiple RadWindows. Each RadWindow has a Radgrid. The grids settings are similar and each is added to an RadAjaxManger.

Grid 1 has it's next / previous buttons renders as follows:

<input name="AccountSearchControl$RadGridSearchResults$ctl01$ctl07$ctl03$ctl20" tabIndex="0" title="Next Page" class="rgPageNext" onclick="return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$MainContentPlaceHolder$radWinAccountSearch$C$AccountSearchControl$RadGridSearchResults$ctl01$ctl07$ctl03$ctl20", "", true, "", "", false, true))" type="button" jQuery1304623369855="88" value=" "/>


Grid 2 has it's next / previous buttons renders as follows:

<input name="PayeeHistoryControl$RadGridPayeeHistory$ctl00$ctl03$ctl01$ctl12" title="Next Page" class="rgPageNext" type="submit" value=" "/>

Why does grid 2 render its button as a submit and grid 1 doesn't? This is causing the RadAjaxLoadingPanel to not appear for grid 2.

Here is grid 2 declaration:

<telerik:RadGrid ID="RadGridPayeeHistory" Skin="Telerik" AllowSorting="True" AllowPaging="True"
           AllowFilteringByColumn="True" AutoGenerateColumns="False" runat="server" GridLines="None"
           CssClass="radgrid" AllowMultiRowSelection="False" Width="100%" PageSize="50" EnableLinqExpressions="false"
           OnNeedDataSource="RadGridPayeeHistory_NeedDataSource"
           OnInit="RadGridPayeeHistory_Onit"   
           OnPreRender="RadGridPayeeHistory_PreRender"
           OnSortCommand="RadGridPayeeHistory_OnSortCommand" 
           OnItemCommand="RadGridPayeeHistory_OnItemCommand"                       
        >
           <MasterTableView AllowNaturalSort="false" CommandItemDisplay="Top" ClientDataKeyNames="DescriptionLineOne, ImportedPaymentMethod.PaymentDescLine3"
               DataKeyNames="DescriptionLineOne, DescriptionLineTwo, ImportedPaymentMethod.AddressLineOne, ImportedPaymentMethod.AddressLineTwo,
               ImportedPaymentMethod.City, ImportedPaymentMethod.State, ImportedPaymentMethod.Zip, ImportedPaymentMethod.PaymentDescLine1,
               ImportedPaymentMethod.PaymentDescLine2, ImportedPaymentMethod.PaymentDescLine3, ImportedPaymentMethod.AccountType">
               <SortExpressions>
                           <telerik:GridSortExpression FieldName="DescriptionLineOne" SortOrder="Ascending" />                           
               </SortExpressions>
               <CommandItemTemplate>
                   <div class="commandLeft">                                                   
                       <asp:Button ID="btnPHClearFilters" runat="server" Text="Clear Filters" OnClick="OnClearFiltersClick"></asp:Button>                                  
                   </div>                   
                   <div class="commandRight">                                                   
                       <span class="labelA">CMS History</span>
                   </div>       
               </CommandItemTemplate>
               <NoRecordsTemplate>
                   <span class="noRecords">No CMS history found for the Accounts.</span>
               </NoRecordsTemplate>
               <Columns>
            
           ...
                    
               </Columns>
           </MasterTableView>
           <PagerStyle AlwaysVisible="true" />
           <GroupingSettings CaseSensitive="False" />
           <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="false">
               <Selecting AllowRowSelect="True" />
               <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ScrollHeight="275px" />
           </ClientSettings>
       </telerik:RadGrid>

BrianS
Top achievements
Rank 1
 answered on 09 May 2011
1 answer
139 views
I am creating a RadGrid dynamically based on data that comes through.  The number of grids can vary.  What I want to do is allow for the collapsing of these grids.  For example, if 10 grids are created, the length is unwieldy and I would like to collapse all but the first, and have the user be able to expand them on click.  I have looked around and do not see a solution within the grid itself.  I would like to keep the header row as the column names, and use something above it sort of detailing the grid like "Number of Customers: #".

My theoretical solution was to use a RadPanelBar, inserting the grid into a RadPanelItem, and then into the PanelBar.  Looking at the demo of the calendar shows:

<telerik:RadPanelBar  runat="server" ID="RadPanelBar1" Height="380px" ExpandMode="FullExpandedItem">
            <Items>
                <telerik:RadPanelItem Text="Calendar" ImageUrl="Img/calendar.gif">
                    <Items>
                        <telerik:RadPanelItem>
                            <ItemTemplate>
                                <telerik:RadCalendar runat="server" ID="Calendar1" Style="margin: 6px auto 0" />
                            </ItemTemplate>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
             </Items>
</telerik:RadPanelBar>

However, I am required to create this from the codebehind.  I've gone through quite a few iterations and can't seem to find the syntax.  I am guessing it has to do with ItemTemplate.InstantiateIn(grid), but do I have to extend the ITemplate or something?
Dimitar Terziev
Telerik team
 answered on 09 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?