Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
30 views
Hi,
       I want to set UseStaticHeader true/false to grid on  button click using java-script. Please Provide help full Solution.



Thanks,
Rahul
Eyup
Telerik team
 answered on 18 Mar 2014
1 answer
288 views
I have a RadGrid with client-side binding similar to the "ODataDataSource - Filtering, Sorting and Paging with RadGrid" example.  I have been able to add multiple filter conditions in the past by calling args.set_filterExpressions(filter); multiple times in the "requesting" function (see scripts.js in the example).  However, now I have a specification where I need to search multiple fields for a value (in addition to the other filters on the grid).  So the value might appear in column1,  column2, or column3.  An example of this kind of complex filtering is shown in the list view client-side filtering example

What is the recommended way for a client-side bound RadGrid to have complex filtering expressions?  When calling args.set_filterExpressions(filter), any previous expression uses "AND" logic with the existing expressions.  My resulting filter would be an OData URL as in the list view OData filtering example:
((UnitPrice gt 25 and UnitsInStock lt 40) or (Discontinued ne true and startswith(ProductName,'I') eq true))


Thanks.
Radoslav
Telerik team
 answered on 18 Mar 2014
3 answers
189 views
Hi to all
Good Day

I have created a grid in the usercontrol.
Grid uses NestedViewTemplate, also, on the Placeholder on Line 41, i am creating a dynamic button options but it seems that the created button event is not firing.

Please help me out on this. Thanks.

01.<telerik:RadGrid EnableViewState="true" AllowPaging="true" runat="server" AutoGenerateColumns="false" ID="rgNotification" Skin="Metro" CssClass="rgRadGridPanelBar" ShowHeader="false" OnNeedDataSource="rgNotification_NeedDataSource" OnItemDataBound="rgNotification_ItemDataBound" OnItemCommand="rgNotification_ItemCommand">
02.                    <MasterTableView PageSize="10" Name="Master" HierarchyLoadMode="ServerBind" DataKeyNames="ClientID" AllowPaging="true">
03.                        <PagerStyle Mode="NextPrevAndNumeric" />
04.                        <Columns>
05.                            <telerik:GridTemplateColumn>
06.                                <ItemTemplate>
07.                                    <div style="border: 1px solid #E5E5E5; padding: 10px; background-color: #F3F3F3; margin: 0;">
08.                                        <div class="row">
09.                                            <div class="col-md-6">
10.                                                <div class="tagCss_grid" style="background-color: #1C3278; margin-right: 5px">
11.                                                    <asp:Label runat="server" ID="lblCount" Text='<%# Bind("Count") %>'></asp:Label>
12.                                                </div>
13.                                                <asp:Label runat="server" ID="lblClient" Text='<%# Bind("ClientName") %>' Style="text-transform: uppercase;"></asp:Label> 
14.                                            </div>
15.                                            <div class="col-md-6 text-right">
16.                                                <asp:PlaceHolder ID="plHolder" runat="server"></asp:PlaceHolder>
17.                                            </div>
18.                                        </div>
19.                                    </div>
20.                                </ItemTemplate>
21.                            </telerik:GridTemplateColumn>
22.                        </Columns>
23.                        <NestedViewTemplate>
24.                            <div style="margin: 10px">
25.                                <telerik:RadGrid CssClass="rgRadGridPanelBarDetail" OnItemDataBound="rgDetails_ItemDataBound" OnItemCommand="rgDetails_ItemCommand" AutoGenerateColumns="false" runat="server" OnNeedDataSource="rgDetails_NeedDataSource" ID="rgDetails" ShowHeader="false">
26.                                    <MasterTableView Name="Details" DataKeyNames="ColorHex,AlertType,AlertTriggerId,ProjectId">
27.                                        <Columns>
28.                                            <telerik:GridTemplateColumn ItemStyle-Width="75%">
29.                                                <ItemTemplate>
30.                                                    <asp:PlaceHolder ID="plHolderDetail" runat="server"></asp:PlaceHolder>
31.                                                    <%# Eval("Message") %>
32.                                                </ItemTemplate>
33.                                            </telerik:GridTemplateColumn>
34.                                            <telerik:GridTemplateColumn ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Right">
35.                                                <ItemTemplate>
36.                                                    <div class="btn-group">
37.                                                        <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
38.                                                            Select Action <span class="caret"></span>
39.                                                        </button>
40.                                                        <ul class="dropdown-menu pull-right" role="menu">
41.                                                            <asp:PlaceHolder runat="server" ID="plMenu"></asp:PlaceHolder>
42.                                                        </ul>
43.                                                    </div>
44.                                                </ItemTemplate>
45.                                            </telerik:GridTemplateColumn>
46.                                        </Columns>
47.                                    </MasterTableView>
48.                                    <ClientSettings EnablePostBackOnRowClick="false">
49.                                        <ClientEvents OnRowClick="RowSelecting" />
50.                                    </ClientSettings>
51.                                </telerik:RadGrid>
52.                            </div>
53.                        </NestedViewTemplate>
54.                    </MasterTableView>
55.                    <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true">
56.                        <Selecting AllowRowSelect="true" />
57.                    </ClientSettings>
58.                </telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 18 Mar 2014
17 answers
552 views

Hi,

I have problem for RadGrid filtering, even I set CurrentFilterFunction="StartsWith", but filtering always filter as "contains", here is my code for RadGrid, is anything wrong?

thanks

 

<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1"

 

 

Width="800px" AllowFilteringByColumn="True" AllowSorting="True"

 

 

ShowFooter="True" AllowPaging="True" runat="server"

 

 

GridLines="None" EnableLinqExpressions="false">

 

 

<GroupingSettings CaseSensitive="false" />

 

 

<MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"

 

 

ShowFooter="True" TableLayout="Fixed">

 

 

<Columns>

 

 

<telerik:GridBoundColumn FilterControlWidth="60px" DataField="DONOR" HeaderText="DONOR" SortExpression="DONOR"

 

 

UniqueName="DONOR" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" ShowFilterIcon="false">

 

 

</telerik:GridBoundColumn>

........

 

Viktor Tachev
Telerik team
 answered on 18 Mar 2014
3 answers
67 views
Following this documentation:
http://www.telerik.com/help/aspnet-ajax/combobox-custom-attributes.html

There is no Attributes property for the RadComboBoxItem class... Why?  (See attached.)

Thanks.
Boyan Dimitrov
Telerik team
 answered on 18 Mar 2014
10 answers
147 views
Like in this example DEMO, my grid has the ability to show a menu to select and deselect columns. But on the demo, the columns resize to the grid size. Mine doesnt unless some postback is done. How do you resize grid on selecting columns checkbox from the menu?

Edit:
I got this function in javascript that calculate all column width, then apply the width to the grid style. That works well when all columns are there.
Each column must remain at a fixed size (a switch i added with the UniqueName of each column) that way i get the right width. Since i can remove a column, orderIndex can't work here.
So when i click the drop down menu and uncheck a column to hide it, the resize function doesnt work anymore because i can't find the "visible" property of the column, so i get a width containing all columns.
My tableView has a tableLayout fixed.

So, what i need here, is a way to get the visibility of the column to properly resize my grid with it.
Eyup
Telerik team
 answered on 18 Mar 2014
1 answer
52 views
Como hago para llenar el radfilter por una function por el codebehind.

Tengo una conexion ya creada a la bd, y estoy buscando por columnas para el lado del cliente, y quisiera obtener estos valores
Viktor Tachev
Telerik team
 answered on 18 Mar 2014
4 answers
106 views
Is there a way to get an event when the user scrolls from one combobox item to another? I know there are events when the user selects an item, but what about when the highlight comes on?
I'd like to display some additional data related to the item that is highlighted.

Thanks,

Ken
Hristo Valyavicharski
Telerik team
 answered on 18 Mar 2014
3 answers
165 views
Hi. I have a radGrid with several columns. Some of them are comboboxes and two are RadTextBox. When user type something and press enter it processes the filter and when user clear the TextBox and press enter it clear the filter.
I am using the fuction below which was provided by Telerik.
function TitleKey(event, sender) {
     if (event.keyCode == 13) {
              var filterValue = "";
              var filterFunction = "NoFilter";
              var s = sender.value;
              if (s != "") {
                  filterValue = s;
                  var filterFunction = "Contains";
              }
     var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
     tableView.filter("title", filterValue, filterFunction);
     }
}
However everytime I clear the filter and press enter two steps occur. First it brings the grid as first loaded without any filter, than it brings the right grid with the right result if one or more filter are on.
I have tried to debug it and I cannot find why it is bringing a full grid as first Step.
The other thing is the AjaxPanal does not work properly for this textbox filter compared with the combobox. In the combobox the loading icon is on all post back process. With txtbox you rarely notice it on but when it is gone the application is still processing the grid.
Viktor Tachev
Telerik team
 answered on 18 Mar 2014
9 answers
632 views
How do i add autonumber to the RadGrid.
i can do in grid like this
<asp:TemplateField SortExpression="displayedname">
                    <HeaderTemplate>
                        Rec #</HeaderTemplate>
                    <ItemTemplate>
                        <%#Container.DataItemIndex+1%></ItemTemplate>
                </asp:TemplateField>

how do i add in radgrid.
Mohamad
Top achievements
Rank 1
 answered on 18 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?