Telerik Forums
UI for ASP.NET AJAX Forum
18 answers
279 views
Hello,
I'd like to add google-like filtering to my grid just like it is in the example.
Here are my current radgrid columns:
<MasterTableView TableLayout="Fixed" CommandItemDisplay="Top" DataKeyNames="indeks">
                <CommandItemTemplate>
                    <asp:Button ID="DownloadPDF" runat="server" Width="64px" CommandName="ExportToPdf" CssClass="pdfButton" />
                    <asp:Image ID="Image1" runat="server" ImageUrl="/Images/banner.png" AlternateText="York" Width="100%" />
                </CommandItemTemplate>
                    <Columns>
                        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="indeks" Display="false"
                            DataType="System.String" FilterListOptions="VaryByDataType" ForceExtractValue="None"
                            HeaderText="Indeks" ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn Aggregate="Count"
                            HeaderText="Indeks" HeaderStyle-HorizontalAlign="Center"
                            DataField="indeks" UniqueName="indeks"
                            SortExpression="indeks"
                            FilterControlWidth="100%" HeaderStyle-Width="50px" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                            AutoPostBackOnFilter="true"
                            ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:HyperLink ID="targetControl" runat="server" Enabled="false" Text='<%# Eval("indeks") %>'></asp:HyperLink>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn HeaderText="EAN" DataField="EAN" HeaderStyle-HorizontalAlign="Center" UniqueName="EAN"
                            SortExpression="EAN" HeaderStyle-Width="60px" FilterControlWidth="100%"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" ItemStyle-HorizontalAlign="Center" />
                        <telerik:GridNumericColumn HeaderText="Sztuk w kartonie" DataField="sztwkart" HeaderStyle-HorizontalAlign="Center" UniqueName="sztwkart" SortExpression="sztwkart"
                            FilterControlWidth="100%" HeaderStyle-Width="30px" ShowFilterIcon="false" ItemStyle-HorizontalAlign="Center" AutoPostBackOnFilter="true" />
                        <telerik:GridBoundColumn HeaderText="Rozmiar kartonu" DataField="rozmiarkart" HeaderStyle-HorizontalAlign="Center"
                            UniqueName="rozmiarkart" SortExpression="rozmiarkart" HeaderStyle-Width="70px"
                            FilterControlWidth="100%" ShowFilterIcon="false" ItemStyle-HorizontalAlign="Center" AutoPostBackOnFilter="true" />
                        <telerik:GridTemplateColumn HeaderText="ZdjÄ™cia" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="Center"
                         ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                            <ItemTemplate>
                                <telerik:RadRotator runat="server" ID="itemsRotator" OnDataBinding="RadRotator_OnDataBinding" Width="168px" Height="128px"
                                 ItemWidth="128px" ItemHeight="128px">
                                    <ItemTemplate>
                                        <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("zdjecie") %>'
                                           AutoAdjustImageControlSize="false" Width="128px" Height="128px" ResizeMode="Fit" ImageAlign="Middle"/>
                                    </ItemTemplate>
                                </telerik:RadRotator>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn AllowFiltering="false" AllowSorting="false" DataField="Fiszka" HeaderStyle-HorizontalAlign="Center" UniqueName="fiszka" HeaderText="Fiszka"
                            HeaderStyle-Width="60px" ItemStyle-HorizontalAlign="Center" ShowFilterIcon="false" />
                    </Columns>
                </MasterTableView>

I can't do google-like filtering like in the example because it would clean my current columns (non-standard ones as you can see).
Also using FilterTemplate somehow didn't work for me. Maybe I did something wrong, but currently I don't have any idea what should my approach be. 

Also please note that all my data for the grid is from asp:SqlDataSource .
I saw many threads about it but I couldn't use any of the solutions.

Any ideas how should I start without losing my current columns if I want to achieve same effect as in the example?

Regards
Darek
Iana Tsolova
Telerik team
 answered on 09 Nov 2011
1 answer
78 views
HI,
I have set EnableHeaderContextMenu= true in the rad grid. In this ContextMenu I am getting all the Column names which are in the grid.
My requirement is , I want only those coulmns for which i have set Visible = true. I do not want the columns for which i have set Display=False. I do not want to set Visible = False for those particular columns as i want those coulmns to be rendered.
Kindly help me resolving this issue as early as possible.

Thanks,
Sudha.

Mira
Telerik team
 answered on 09 Nov 2011
1 answer
269 views
Is there some place i can download the icon images from?
Duncan
Top achievements
Rank 2
 answered on 09 Nov 2011
3 answers
146 views
I am experiencing a problem with column resizing and the Grid itself not resizing correctly.

If I resize a column by dragging one side of the column left or right and then resize the whole browser window, the grid does not conform to the Width="100%" attribute.

The grid needs to expand and contract along withthe width of the browser window.  After resizing a column, the grid remains at the original width and is then fixed until the page is refreshed.

The grid behaves properly before the column is resized.

        <telerik:RadGrid ID="grdRules" runat="server"                               
                AllowPaging="true"
                AutoPostBack="true"
                AllowSorting="false"
                EnableViewState="true"
                AutoGenerateColumns="false" 
                GridLines="None" 
                PagerSettings-Visible="true"
                HeaderStyle-CssClass="GridHeader" 
                RowStyle-CssClass="GridShade"
                AlternatingRowStyle-CssClass="AltGridShade"
                OnItemDataBound="grdRules_OnItemDataBound"
                OnPageIndexChanged="grdRules_OnPageIndexChanged"
                OnPageSizeChanged="grdRules_OnPageSizeChanged"
                OnRowCommand="grdRules_OnRowCommand"
                Width="100%" 
                PageSize="20"
                AllowFilteringByColumn="false"
                BorderStyle="None"
                Skin="Default"
                >
                    <PagerStyle Position="TopAndBottom" Mode="NextPrevAndNumeric" />
                    <ClientSettings 
                        Resizing-AllowResizeToFit="true" 
                        Scrolling-AllowScroll="false" 
                        Resizing-AllowColumnResize="true"
                        />
                    <MasterTableView  TableLayout="Auto"  >
                    <Columns>
                        <telerik:GridBoundColumn DataField="RuleName" HeaderText="Name" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true"  />
                        <telerik:GridBoundColumn DataField="TargetCategoryDescription" HeaderText="Category" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" />
                        <telerik:GridBoundColumn DataField="TargetCompany" HeaderText="Manufacturer" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" />
                        <telerik:GridBoundColumn DataField="TargetModel" HeaderText="Model" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" />
                        <telerik:GridBoundColumn DataField="RuleTypeDescription" HeaderText="Action" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" />
                        <telerik:GridBoundColumn DataField="EntityCount" HeaderText="Attachments" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" />
                        <telerik:GridBoundColumn DataField="RuleCriteriaID" HeaderText="ID" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" />
                        <telerik:GridTemplateColumn Resizable="false" ItemStyle-HorizontalAlign="Right" >
                            <ItemTemplate>
                                <asp:Image ID="btnPopup" runat="server" ImageUrl="images/Expand.jpg" CssClass="gridMenuIcon" />
                                <telerik:RadContextMenu 
                                        ID="mnuRow" 
                                        runat="server" 
                                        OnItemClick="RulesContextMenu_Click" 
                                        OnClientItemClicking="OnDeleteItemClicking" 
                                        CollapseAnimation-Duration="100" 
                                        ExpandAnimation-Duration="100" 
                                        ExpandDelay="0">
                                        <Targets>
                                            <telerik:ContextMenuControlTarget ControlID="btnPopup" />
                                        </Targets>
                                </telerik:RadContextMenu>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                </Columns>
        </MasterTableView>
</telerik:RadGrid>

 

 

 

 

 

Pavlina
Telerik team
 answered on 09 Nov 2011
5 answers
364 views
On the update event, i am trying to populate myu object with the new values entered:

GridEditableItem UpdateItem = (GridEditableItem)e.Item;

I then do the following to try and get the new value (this works on other pages) from the input control, in this case in column "SDTest"

fmsdupdate.SD = Convert.ToDecimal((UpdateItem["SDtest"].Controls[0] as TextBox).Text.Trim());


This only returns me the original value in the field, not the updated one that i have just input. Any help would be greatly appreciated.
Michael
Pavlina
Telerik team
 answered on 09 Nov 2011
1 answer
131 views
I am having trouble reading this xml file into Telerik  Ajax RadGrid. The problem is that the xml file is in a weird format that Telerik does not seem to recognize.  Here is an example from the xml file that I want to read into my grid. Does anyone have any suggestions? Thanks
 

<Attribute>
     <Object>
         <Id>27</Id>
         <Type>212</Type>
    </Object>
   <AttributeDef>
        <Id>38</Id>
  </AttributeDef>
  <RowId>0</RowId>
  <StringValue/>
  <DecimalValue xsi:nil="true"/>
  <DateTimeValue xsi:nil="true"/>
  <LongStringValue/>
  <IsLinked>Y</IsLinked>
  <MayModify>Y</MayModify>
  <ValueDescription/>
</Attribute>
Daniel
Telerik team
 answered on 09 Nov 2011
1 answer
101 views
Hello,

I'm quite new with Telerik and I really like the look and functionality of a RadGrid, so I would really like to make my wishes come true with the use of a RadGrid.

My wishes are the following:
-I would like to add a hyperlink and some text in 1 cell, but both are gathered from different datafields. 
-between the hyperlink and the the text I would like an <br />
-and I would like to all handle this in the .cs 

I don't know if this is even possible, I really hope so.

Yours,
Folmer



Princy
Top achievements
Rank 2
 answered on 09 Nov 2011
2 answers
157 views
Dear Telerik,

Currently I have 4 different RadDockZone each with a RadDock in it. On the bottom of my page I have a RadRotator with 10 RadDockZone each with a RadDock too. Inside each RadDock I have the RadChart to display the chart from my SQL database. Currently I'm using these code to drag and exchange RadDock between zones, and it's working great.

<script type="text/javascript">


    // Javascript for swapping between DockZones
    var initialZone;
    var initialIndex;
    function OnDragStart(dock, args) 
    {
        initialIndex = dock.get_index();
        initialZone = dock.get_dockZone();
    }


    function OnClientDockPositionChanged(dock, args) 
    {
        var currentZone = dock.get_dockZone();
        var dockToBeDocked = currentZone.get_docks()[dock.get_index() + 1];
        if (dockToBeDocked != null && initialZone != null && currentZone != initialZone) 
        {
            initialZone.dock(dockToBeDocked, initialIndex);
        }
    }

</script>

I would like that whenever I drag a RadDock into the rotator, the dock would display an Image instead of the RadChart's graph. Each of the raddock should has its own image.The initial RadDock in the Rotator on page load only display the image too. Is this something possible to do using Javascript, or I have to do with code behind and autopostback? 

I've been trying to figure out without success. Please help me on this problem.

Thank you,
Loc Huynh
Loc
Top achievements
Rank 1
 answered on 09 Nov 2011
3 answers
159 views
I have the following definition for a RadToolBar:
<telerik:RadToolBarDropDown  Text="Export Options">
    <Buttons>
        <telerik:RadToolBarButton runat="server" ImageUrl="~/_assets/images/report/excel.png" ToolTip="Export to Excel" />
        <telerik:RadToolBarButton runat="server" ImageUrl="~/_assets/images/report/csv.png" ToolTip="Export to CSV (Raw Data Dump)" />
    </Buttons>
</telerik:RadToolBarDropDown>

For some reason these items won't show up (see attachment). The parent RadToolBar instance is using the Windows7 skin, although I also tried the Vista skin and no luck there either. There is no data binding on this toolbar - all items are static and the RadToolBarDropDown in question is at the root level (inside the main <Items> collection). I'm on Q2 2011.

Thoughts?
digitall
Top achievements
Rank 1
 answered on 09 Nov 2011
2 answers
151 views
Hi All,

I am using the technique show in this forum to refresh a RadGrid on a RadWindow close:

http://www.telerik.com/community/forums/aspnet-ajax/window/refresh-radgrid-on-close-of-radwindow.aspx

This works like a charm.  :)  My challenge is, however, while the grid refreshes itself beautifully, the context menu targeting the grid "disables" itself.  Specifically, when the user right-clicks, nothing happens at all.

When I refresh the page, the context menu "re-enables" itself, and I'm back off to the races.  

To resolve this, I've tried to DataBind the context menu in the Code Behind (in the AjaxRequest procedure as show in the forum post above).  But, that did not help.

So, I think my specific question is how do I "reactivate" a context menu targeting a RadGrid after I run the procedure shown in the forum post above?  

Thanks you very much for any help that you can provide.

Jim
James
Top achievements
Rank 1
 answered on 09 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?