Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
158 views

Hi,

 

I'am using the RadGrid with a GridDateTimeColumn with rangefiltering. The custom lay-out is to put both calender filters next to each other. I need to display them below each other and therefor I've used the solution to rearange them in the ItemDataBound event.

However when I use the nested view in the grid, the filter resets to it's original lay-out.

 

The problem is the nestedview triggers the databound event with the GridNestedViewItem and not the GridFilteringItem.

 

Could you please help?

 

Code:

<telerik:RadGrid ID="rgdLaadOrder" runat="server" CellSpacing="0" DataSourceID="qOverview" GridLines="None" Skin="AlfonsFreriks" EnableEmbeddedSkins="false"
   PageSize="10" ClientSettings-EnableRowHoverStyle="True" AllowPaging="true" OnItemCommand="rgdLaadOrder_ItemCommand" Width="1124px" OnInit="rgdLaadOrder_Init"
   AllowFilteringByColumn="True" AutoGenerateColumns="False" EnableLinqExpressions="False" OnItemDataBound="rgdLaadOrder_ItemDataBound" OnItemCreated="rgdLaadOrder_ItemCreated">
   <PagerStyle Mode="NextPrevAndNumeric" />
   <ExportSettings OpenInNewWindow="true" FileName="Export">
     <Pdf ContentFilter="Ascii85" BorderType="AllBorders" PageWidth="297mm" PageHeight="210mm">
       <PageHeader>
         <LeftCell TextAlign="Left" />
         <MiddleCell TextAlign="Left" />
         <RightCell TextAlign="Left" />
       </PageHeader>
     </Pdf>
   </ExportSettings>
   <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="True">
     <Selecting AllowRowSelect="true" />
   </ClientSettings>
   <MasterTableView NoMasterRecordsText="Er zijn geen laadorders te tonen" AutoGenerateColumns="false" TableLayout="Auto" HierarchyLoadMode="ServerOnDemand"
     DataKeyNames="LaadOrderNummer, LAADADRESNUMMER, LOSADRESNUMMER">
     <NestedViewSettings DataSourceID="qItem">
       <ParentTableRelation>
         <telerik:GridRelationFields DetailKeyField="LaadOrderNummer" MasterKeyField="LaadOrderNummer" />
         <telerik:GridRelationFields DetailKeyField="LaadAdresNummer" MasterKeyField="LAADADRESNUMMER" />
         <telerik:GridRelationFields DetailKeyField="LosAdresNummer" MasterKeyField="LOSADRESNUMMER" />
       </ParentTableRelation>
     </NestedViewSettings>
     <NestedViewTemplate>
       <asp:Repeater ID="rptAgendaItem" runat="server" DataSourceID="qItem">
       <ItemTemplate>
         <div class="cellLinks">
           <%# Eval("Titel") %>
         </div>
         <div class="cellRechts">
           <%# Eval("Waarden") %>
         </div>
       </ItemTemplate>
       <SeparatorTemplate>
         <br style="clear:both;" />
       </SeparatorTemplate>
     </asp:Repeater>
     </NestedViewTemplate>
     <Columns>
       <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="ncr" HeaderText="NCR" Display="false">
         <HeaderStyle Width="28px" />
         <ItemStyle Width="28px" />
         <ItemTemplate >
           <asp:Image runat="server" ID="imgStatus" ImageUrl="~/Assets/Images/status/INFO_RED.png" Visible='<%# (int)Eval("AANTALNCR") > 0 %>' />
         </ItemTemplate>
       </telerik:GridTemplateColumn>
       <telerik:GridBoundColumn DataField="LaadOrderNummer" HeaderText="Nummer" UniqueName="LaadOrderNummer" AllowFiltering="false" Display="false"/>
       <telerik:GridBoundColumn DataField="LaadInfoDefinitiefJN" HeaderText="LaadInfoDefinitiefJN" UniqueName="LaadInfoDefinitiefJN" AllowFiltering="false" Display="false"/>
       <telerik:GridBoundColumn DataField="LosInfoDefinitiefJN" HeaderText="LosInfoDefinitiefJN" UniqueName="LosInfoDefinitiefJN" AllowFiltering="false" Display="false"/>
       <telerik:GridBoundColumn DataField="LAADADRESNUMMER" HeaderText="LAADADRESNUMMER" UniqueName="LAADADRESNUMMER" AllowFiltering="false" Display="false"/>
       <telerik:GridBoundColumn DataField="LOSADRESNUMMER" HeaderText="LOSADRESNUMMER" UniqueName="LOSADRESNUMMER" AllowFiltering="false" Display="false"/>
 
       <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="link" HeaderText="" Exportable="false">
         <HeaderStyle Width="44px" />
         <ItemTemplate >
           <asp:Image runat="server" ID="imgLink" ImageUrl="~/Assets/Images/afje_wit.png" />
         </ItemTemplate>
       </telerik:GridTemplateColumn>
       <telerik:GridBoundColumn DataField="OPDRACHTNUMMERKLANT" HeaderText="Klant ref." UniqueName="OPDRACHTNUMMERKLANT"
         AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" FilterControlWidth="100%">
         <HeaderStyle Width="180px" />
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="LAADORDERDISPLAYNUMMER" HeaderText="Laadordernr" UniqueName="LAADORDERDISPLAYNUMMER"
         AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" FilterControlWidth="100%">
         <HeaderStyle Width="120px" />
       </telerik:GridBoundColumn>
       <telerik:GridDateTimeColumn DataField="LAADDATUM" HeaderText="Laaddatum" UniqueName="LAADDATUM"
         AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" DataType="System.DateTime"
         DataFormatString="{0:dd-MM-yyyy}" FilterControlWidth="106px" EnableTimeIndependentFiltering="true" EnableRangeFiltering="true">
         <HeaderStyle Width="160px" />
       </telerik:GridDateTimeColumn>
       <telerik:GridBoundColumn DataField="LAADADRESPLAATS" HeaderText="Laadplaats" UniqueName="LAADADRESPLAATS"
         AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" FilterControlWidth="100%">
         <HeaderStyle Width="200px" />
       </telerik:GridBoundColumn>
       <telerik:GridDateTimeColumn DataField="LOSDATUM" HeaderText="Losdatum" UniqueName="LOSDATUM"
         AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" DataType="System.DateTime"
         DataFormatString="{0:dd-MM-yyyy}" FilterControlWidth="106px" EnableTimeIndependentFiltering="true" EnableRangeFiltering="true">
         <HeaderStyle Width="160px" />
       </telerik:GridDateTimeColumn>
       <telerik:GridBoundColumn DataField="LOSADRESPLAATS" HeaderText="Losplaats" UniqueName="LOSADRESPLAATS"
         AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" FilterControlWidth="100%">
         <HeaderStyle Width="200px" />
       </telerik:GridBoundColumn>
       <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="ncr" HeaderText="NCR" Exportable="false">
         <HeaderStyle Width="40px" />
         <ItemTemplate >
           <asp:ImageButton runat="server" ID="imgStatusRed" ImageUrl="~/Assets/Images/status/bullet_ball_glass_red.png" Visible='<%# (int)Eval("AANTALNCR") > 0 %>' CommandName="NCR_Click" />
           <asp:Image runat="server" ID="imgStatusGreen" ImageUrl="~/Assets/Images/status/bullet_ball_glass_green.png" Visible='<%# (int)Eval("AANTALNCR") == 0 %>' />
         </ItemTemplate>
       </telerik:GridTemplateColumn>
     </Columns>
     <PagerStyle PageSizes="10, 25, 50, 75, 100" PagerTextFormat="{4} Er zijn <strong>{5}</strong> laadorders die overeenkomen met de zoekcriteria"
       PageSizeLabelText="Resultaten per pagina:" AlwaysVisible="true" />
   </MasterTableView>
 </telerik:RadGrid>

 

    protected void rgdLaadOrder_ItemDataBound(object sender, GridItemEventArgs e)
    {
      if (e.Item is GridFilteringItem)
      {
        GridFilteringItem filterItem = e.Item as GridFilteringItem;
 
        (filterItem["LAADDATUM"].Controls[0] as LiteralControl).Text = "<span style='width:45px; display:inline-block;'>" + WebTranslate.GetTranslation("rgdLaadOrderVanFilter") + "</span>";
        (filterItem["LAADDATUM"].Controls[3] as LiteralControl).Text = "<br /><span style='width:45px; display:inline-block;'>" + WebTranslate.GetTranslation("rgdLaadOrderTotFilter") + "</span>";
 
        (filterItem["LOSDATUM"].Controls[0] as LiteralControl).Text = "<span style='width:45px; display:inline-block;'>" + WebTranslate.GetTranslation("rgdLaadOrderVanFilter") + "</span>";
        (filterItem["LOSDATUM"].Controls[3] as LiteralControl).Text = "<br /><span style='width:45px; display:inline-block;'>" + WebTranslate.GetTranslation("rgdLaadOrderTotFilter") + "</span>";
      }
}

 

Eyup
Telerik team
 answered on 26 Apr 2016
9 answers
1.2K+ views
Hi

I have implemented custom paging on one of my Telerik RadGrid's
I did this making use of a Sql Stored Procedure to return only the number of records - same amount as the PageSize as set on the RadGrid.

The problem is that my stored procedure only returns say 15 records of the possible 360 records, then when this is bound to the grid which has the PageSize property set to 15 then of course the pager shows 15 records and page 1 of 1. I know that there are 360 records and thus 24 pages of 15 records each, my questions is how to I set the PageCount property to 24 manually so that the user can use the prev/next buttons to get to the next 15 records?

Thanks



Viktor Tachev
Telerik team
 answered on 26 Apr 2016
0 answers
89 views

I am using RAD GRID. I have more than 1000 rows in Grid. I have kept 50 row per page.

If click on Page Size = "ALL" grid takes 5 minutes to display all the rows.

This happens only in Internet Explorer. Can anyone help me to get resolved?

Govindon
Top achievements
Rank 1
 asked on 25 Apr 2016
1 answer
414 views
All we are using Telerik Web UI controls version 2011.1.315.40.  Is there any foreseeable comparability issues if we change our underlying Target Framework to version 4.6.1
Marin Bratanov
Telerik team
 answered on 25 Apr 2016
2 answers
125 views
Hi,
        I am using RadTreeList control. I used the EditFormSetting with EditFormType='Template'. In that template I am bounding the values to server control with the help of Bind function. When I click on edit button, edit form is coming fine but when i try to click on add a record, it throws an exception which is "DataBinding: 'Telerik.Web.UI.TreeListInsertionObject' does not contain a property with the name 'Title'."

1) And more important when we will add a new record, how we get to know that the newly added record is a child of which parent?

Regards,
Imran Ahmad
Pavlina
Telerik team
 answered on 25 Apr 2016
6 answers
161 views

Hi,

In a SharePoint 2013 publishing site, I've a web application page which has a RadGrid. The grid is setup to use RadAjax for CRUD operations. The problem is that when the page is left idle for a minute or so, and any postback operations is performed on the grid (e.g. clicking the add new button [grid command]) then the page's state is somehow lost. In the code behind, IsPostBack is found to be false. It behaves as if the page was refreshed.

I found something about the same issue here. As suggested, I disabled Forms Authentication but it started causing other problems in the publishing site, e.g. Access denied error for some resources.

Is there a proper solution provided to this issue? Any help will be highly appreciated.

 

Regards,
Farjad

Maria Ilieva
Telerik team
 answered on 25 Apr 2016
1 answer
130 views

I am using the java script function below to highlight a row on the client side once a control in the row was selected.   It appears to be working but the the styles look like the picture below..  a very thin border around the row that is barely noticeable is selected.   How can I made it so the whole row will change color when the row is selected

 

           var grid = $find("<%=GridView_InboxDocuments.ClientID %>");
            var masterTable = $find("<%=GridView_InboxDocuments.ClientID%>").get_masterTableView();
            var dataItems = masterTable.get_dataItems();
            var count = dataItems.length;
            var link;
                       
            for (var i = 0; i < count; i++) {
                link = dataItems[i].findElement(controlName);
                if (link.text == eFilingId) {
                    grid.set_activeRow(dataItems[i].get_element());              
                }                
            } 

Eyup
Telerik team
 answered on 25 Apr 2016
1 answer
93 views

I have a dependency I need to show online; the problems I am facing seem to be better developed in other versions on the tool set than this. There also seems to be a lack of example code in vb.net as well as c# (unless I am missing something)

1. Browser size/resizing - I need to be able to resize the diagram view port based on the window size. Nothing about this at all? This seems strange as the client side API for other controls are very rich in what you can do with them using JavaScript.

2. My diagram is very large and does not fit the whole map in the viewport. I can user Ctrl + Move mouse to pan; but ideally this needs scroll bars. This can be achieved through other implementations of diagram Silverlight for instance. But not here?

3. Need to be able to attach a context menu to each shape and/or connection; also a context menu on the other space would be nice.

4. Can the connections be attached to a centre point whilst disabling the abilities to...

    a. Disable the deletion of a diagram shape and connection

    b. All connections start and end at centre points, all other connection points are removed

    c. Disable the creation of connections between points.

 

Really the diagram tool is great honestly; but lacks a lot of features that you have done for other versions of the telerik toolset.

Danail Vasilev
Telerik team
 answered on 25 Apr 2016
6 answers
200 views
Hello,
I have a gridboundcolumn with attribute FilerDelay set to 1. The filter works correctly, after 1 second the autopostback is done and the filter command is "EqualTo".  The problem is that if I wish to remove the filter by selecting from the filter list the "NoFilter" voice, on ItemCommand method, the argument of the command remains "EqualTo" instead of "NoFilter". So I can't remove the filter set before.  Every other choises(GreaterThen, Less.....etc) apart from "NoFilter" work correctly and are 'recognised' inside the ItemCommand method.
Could you please help me with this problem?
Thank you very much.
Marina
Maria Ilieva
Telerik team
 answered on 25 Apr 2016
1 answer
133 views

For some reason, when I add the option to use checkboxes on my listbox, the text for the items become bold. Is there any way to prevent the text from becoming bold? I'm using the Bootstrap theme.

Thanks!

Veselin Tsvetanov
Telerik team
 answered on 25 Apr 2016
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?