Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
52 views
I have Search pages using treelist for results.
the user have results expanded already with new search after the user left some of results expanded with first search.

whenever user dose search with new options in, SearachHandler fires and then databind() with new result.
the some of result are already expanded as if attachments.

thanks you for helps in advance.
code-behind:
 protected void SearchHandler(object sender, CriteriaController criteriaController)
        {
            if (radTreeResults.Visible)
            {
                if (DtGrid == null) DoSearch();

                DataView dv = new DataView(DtGrid, "", "", DataViewRowState.CurrentRows);
                //DataView dv = new DataView(DtGrid, "ParentID is null", "", DataViewRowState.CurrentRows);
                radTreeResults.DataSource = dv;
                radTreeResults.DataBind();
            } 
            else
                radTreeResults.Visible = true;
        }
        
        protected void TreeListDataSourceNeeded(object sender, EventArgs e)
        {
            if (DtGrid == null) DoSearch();
            DataView dv = new DataView(DtGrid, "", "", DataViewRowState.CurrentRows);
            //DataView dv = new DataView(DtGrid, "ParentID is null", "", DataViewRowState.CurrentRows);
            radTreeResults.DataSource = dv;
        }

in aspx

<asp:Content ID="Content3" ContentPlaceHolderID="RightColumnContentPlaceHolder" runat="server">
    <div id="gridViewContainer" style="height: 100%;">
        <telerik:RadTreeList ID="radTreeResults" runat="server" ParentDataKeyNames="ParentID" Visible="False"
            DataKeyNames="StandardID" Skin="Office2010Silver"  Width="100%" Height="100%"
            AutoGenerateColumns="False" OnNeedDataSource="TreeListDataSourceNeeded" 
            OnItemCommand="radTreeResults_ItemCommand" OnItemDataBound="radTreeResults_ItemDataBound" ShowTreeLines="false">
            <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                <Resizing ResizeMode="AllowScroll" AllowColumnResize="true" EnableRealTimeResize="true" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" ScrollHeight="560px" />
                <ClientEvents OnTreeListCreated="TreeListCreated" />
            </ClientSettings>
            <Columns>
                <telerik:TreeListSelectColumn HeaderStyle-Width="40px" UniqueName="SelectColumn">
                </telerik:TreeListSelectColumn>
                <telerik:TreeListTemplateColumn HeaderStyle-Width="120px" DataField="NameDisplayText"
                    UniqueName="NameDisplayText" HeaderText="Name" >
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkExpandAll" runat="server" CommandName="ExpandCollapse"
                            CommandArgument="ExpandAll" Text="+" Visible="true"></asp:LinkButton>
                        <asp:LinkButton ID="lnkCollapseAll" runat="server" CommandName="ExpandCollapse"
                            CommandArgument="CollapseAll" Text="-" Visible="false"></asp:LinkButton>
                        <asp:HyperLink ID="lnkStandardName" runat="server" Target="_blank" NavigateUrl='<%#"~/Record/StandardsPage.aspx?xID=" + Eval("EncryptedID") %>'
                            Visible="True" Style="color: Blue;" StandardID='<%# Eval("EncryptedID") %>' StandardName='<%# Eval("StandardName") %>' ><%# Eval("NameDisplayText")%></asp:HyperLink>                        
                    </ItemTemplate>
Andrey
Telerik team
 answered on 10 Jun 2013
3 answers
263 views
I have created asp webpage with rad grid . i have used Telerik.Web.UI.dll  version 2008.01.0415.35 .
In here i change data source according to drop down list change.
Issue is when i change display page and change data source rad grid still showing lastly i selected displaying page.

I have attached image
In here data source consists with 10 records. when i change display page by clicking go button on rad grid it will show first page with records.
In here i need to set fist page when data source change in rad grid
Eyup
Telerik team
 answered on 10 Jun 2013
7 answers
820 views
Hi,

We are exporting the rad grid data in pdf format where data is not getting center aligned, attaching the code, please have a look and let us know what's the solution for this problem.

This is really urgent to resolve, please reply asap.

PFA  -  Snap shot of presently exported pdf file where data is not center aligned.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PDFXLDownload.aspx.cs"
    Inherits="PDFXLDownload.PDFXLDownload" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptCombine="false">
    </telerik:RadScriptManager>
     <telerik:RadGrid runat="server" ID="RadGrid2" EnableEmbeddedSkins="false" GridLines="None"
        ShowFooter="false" AllowPaging="false" OnPdfExporting="TestGrid2_PDFExporting" OnItemCreated="RadGrid2_ItemCreated" >
        <ExportSettings OpenInNewWindow="true">
            <Pdf PageHeight="210mm" PageWidth="297mm" PageBottomMargin="20mm" PageTopMargin="20mm"
                PageLeftMargin="20mm" PageRightMargin="20mm"></Pdf>
        </ExportSettings>
        <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Bottom">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="InvName">
                    <HeaderTemplate>
                        <asp:Label ID="labelHInvName" runat="server" Text="Inv Name"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                    <asp:Label ID="label1" runat="server" Text="AC Test Data One"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="label2" runat="server" Text="AC Test Data Two"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelInvName" runat="server" Text='<%# Bind("InvName") %>'></asp:Label>  
                                    <asp:Label ID="labelShortName" runat="server" Text='<%# Bind("ShortName") %>'></asp:Label>  
                                    <asp:Label ID="labelStatus" runat="server" CssClass="FundStatus" Text='<%# Bind("Status") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="Symbol">
                    <HeaderTemplate>
                        <asp:Label ID="labelHSymbol" runat="server" Text="Symbol"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelSymbol" runat="server" Text='<%# Bind("Symbol") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="MSRating">
                    <HeaderTemplate>
                        <asp:Label ID="labelHMSRating" runat="server" Text="MSRating"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelMSRating" runat="server" Text='<%# Bind("MSRating") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="NERatio">
                    <HeaderTemplate>
                        <asp:Label ID="labelHNERatio" runat="server" Text="NERatio"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelNERatio" runat="server" Text='<%# Bind("NERatio") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="GERatio">
                    <HeaderTemplate>
                        <asp:Label ID="labelHGERatio" runat="server" Text="GERatio"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelGERatio" runat="server" Text='<%# Bind("GERatio") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="OneQ">
                    <HeaderTemplate>
                        <asp:Label ID="labelHOneQ" runat="server" Text="OneQ"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelOneQ" runat="server" Text='<%# Bind("OneQ") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="YT">
                    <HeaderTemplate>
                        <asp:Label ID="labelHYT" runat="server" Text="YTenure"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelYT" runat="server" Text='<%# Bind("YT") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="OneY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHOneY" runat="server" Text="OneY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelOneY" runat="server" Text='<%# Bind("OneY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="ThreeY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHThreeY" runat="server" Text="ThreeY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelThreeY" runat="server" Text='<%# Bind("ThreeY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="FiveY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHFiveY" runat="server" Text="FiveY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelFiveY" runat="server" Text='<%# Bind("FiveY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="TenY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHTenY" runat="server" Text="TenY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table >
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelTenY" runat="server" Text='<%# Bind("TenY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="ThreeYR">
                    <HeaderTemplate>
                        <asp:Label ID="labelHThreeYR" runat="server" Text="ThreeYR"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <colgroup>
                               <col  />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelThreeYR" runat="server" Text='<%# Bind("ThreeYR") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
            <CommandItemStyle HorizontalAlign="Left" Wrap="true" Width="100%" />
            <CommandItemTemplate>
                <asp:Label ID="lblText" runat="server" Visible="false" Width="100%"></asp:Label>
            </CommandItemTemplate>
        </MasterTableView>
    </telerik:RadGrid>
  
    <asp:Button ID="DownloadPDFButton" runat="server" OnClick="DownloadPDFButton_Click"
        Text="Download PDF" Width="184px" />
    <asp:Button ID="DownloadXLButton" runat="server" OnClick="DownloadXLButton_Click"
        Text="Download Exel" Width="157px" />
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.IO;
using System.Text.RegularExpressions;
using System.Globalization;
  
namespace PDFXLDownload
{
    public partial class PDFXLDownload : System.Web.UI.Page
    {
        bool isPdfExport = false;
        protected void Page_Load(object sender, EventArgs e)
        {
            RadGrid2.DataSource = MyDataSource;
            RadGrid2.DataBind();
        }
  
    
        protected void RadGrid2_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (isPdfExport)
            {
                FormatGridCells(e.Item);
            }
        }
          
        private void FormatGridCells(GridItem item)
        {
            if (item is GridHeaderItem)
            {             
                
                foreach (TableCell cell in item.Cells)
                {
                    cell.Style["text-align"] = "center";
                }
            }
            if (item is GridItem)
            {              
                foreach (TableCell cell in item.Cells)
                {
                    cell.Style["text-align"] = "center";
                }               
            }
            item.PrepareItemStyle();
        }
  
              protected void DownloadPDFButton_Click(object sender, EventArgs e)
        {
            // RadGrid2.GridLines = GridLines.Both; //We can set the grid lines while exporting data to pdf file.
            RadGrid2.ExportSettings.OpenInNewWindow = true;
            RadGrid2.ExportSettings.IgnorePaging = true;
            RadGrid2.ExportSettings.ExportOnlyData = true;
  
            RadGrid2.ExportSettings.FileName = "PDFExportDemo";
  
            //Landscape 
            RadGrid2.ExportSettings.Pdf.PageHeight = Unit.Parse("10in");
            RadGrid2.ExportSettings.Pdf.PageWidth = Unit.Parse("16in");
  
            //// 1/2 inch margins 
            RadGrid2.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("0.5in");
            RadGrid2.ExportSettings.Pdf.PageRightMargin = Unit.Parse("0.5in");
            RadGrid2.ExportSettings.Pdf.PageTopMargin = Unit.Parse("0.5in");
            RadGrid2.ExportSettings.Pdf.PageBottomMargin = Unit.Parse("0.5in");
  
            isPdfExport = true;
  
          
  
            //RadGrid2.MasterTableView.PrepareExport();
            RadGrid2.MasterTableView.GetColumn("InvName").HeaderStyle.Width = Unit.Pixel(200);
            RadGrid2.MasterTableView.GetColumn("InvName").ItemStyle.Wrap = true;
  
            RadGrid2.MasterTableView.ExportToPdf();
            //RadGrid2.MasterTableView.Columns.FindByUniqueName("InvName").ItemStyle.Width = Unit.Pixel(200);
        }
  
           }
}

Kostadin
Telerik team
 answered on 10 Jun 2013
3 answers
67 views
Hi,
We have a RadScheduler instance with a user option to show or hide weekends. Server-Side
we then set FirstDayOfWeek and LastDayOfWeek for the scheduler. The issue is in
MonthView. When we have the week set to Monday through Friday, we would like the
scheduler to not show rows if the only visible days would be from another month. For
example:  June 2013 starts on a Saturday and ends on a Sunday, so we would like to have
only the weeks of June 3, 10, 17 & 24 showing. However, the scheduler also shows the week
of May 27.

Specifically, when on MonthView for June 2013 and showing weekends VisibleRangeStart is
5/26/2013 and VisibleRangeEnd is 7/7/2013 and six rows show. However, when not showing
weekends VisibleRangeStart is 5/27/2013 and VisibleRangeEnd is 6/29/2013 and five rows
show. What we want in this scenario is VisibleRangeStart to be 6/3/2013 and
VisibleRangeEnd to be 6/29/2013 with four rows showing. Particularly odd is that the
VisibleRangeEnd seems to be working as desired while VisibleRangeStart does not.

Unfortunately, VisibleRangeStart and VisibleRangeEnd are get only properties.

Is there any way I can make the scheduler remove that undesired row?

Thanks,
Danny
Nencho
Telerik team
 answered on 10 Jun 2013
2 answers
372 views
Hi,

I have a scenario where in edit mode when user selects a particular value of control radCmbAxis ,checkbox cbIsSameAxis should be disabled and i want to implement it through javascript. Following is my javascript function and grid.

I am unable to figure how to access the checkbox through this method and make it disable. 

function OnClientSelectedIndexChangedEventHandler(sender, eventArgs) {
                 var selectedAxis=sender.get_selectedItem().get_text();             
                   
                 // how to access the checkbox control here???????
  
        }


<telerik:RadGrid ID="rgXAxisDetails" Skin="Windows7" GridLines="Both" runat="server"
               AutoGenerateColumns="False" SelectedItemStyle-BackColor="blue" OnUpdateCommand="rgXAxisDetails_UpdateCommand"
               OnItemCommand="rgXAxisDetails_ItemCommand" OnEditCommand="rgXAxisDetails_EditCommand"
               OnItemDataBound="rgXAxisDetails_ItemDataBound" OnNeedDataSource="rgXAxisDetails_NeedDataSource" OnInsertCommand="rgXAxisDetails_InsertCommand" OnItemCreated="rgXAxisDetails_ItemCreated">
               <MasterTableView InsertItemDisplay="Bottom" HorizontalAlign="NotSet" EditMode="InPlace"
                   TableLayout="Fixed" CommandItemDisplay="Bottom">
                   <Columns>
                       <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn">
                           <ItemStyle CssClass="MyImageButton" />
                       </telerik:GridEditCommandColumn>
                       <telerik:GridTemplateColumn UniqueName="tcColumnName" HeaderText="Column Name">
                           <ItemTemplate>
                               <asp:Label ID="lblColumnName" runat="server"></asp:Label>
                           </ItemTemplate>
                           <EditItemTemplate>
                               <telerik:RadComboBox ID="radCmbColumnName" runat="server" >
                               </telerik:RadComboBox>
                               <asp:RequiredFieldValidator ID="rfvColName" runat="server" ErrorMessage="*" ControlToValidate="radCmbColumnName" InitialValue="--Select--"></asp:RequiredFieldValidator>                                
                           </EditItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn UniqueName="tcAxis" HeaderText="Axis">
                           <ItemTemplate>
                               <asp:Label ID="lblAxis" runat="server"></asp:Label>
                           </ItemTemplate>
                           <EditItemTemplate>
                               <telerik:RadComboBox ID="radCmbAxis" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChangedEventHandler">
                                   <Items>
                                       <telerik:RadComboBoxItem Text="--Select--" Value="--Select--" />
                                       <telerik:RadComboBoxItem Text="Primary Top" Value="Primary Top" />
                                       <telerik:RadComboBoxItem Text="Primary Bottom" Value="Primary Bottom" />
                                       <telerik:RadComboBoxItem Text="Secondary Top" Value="Secondary Top" />
                                       <telerik:RadComboBoxItem Text="Secondary Bottom" Value="Secondary Bottom" />
                                   </Items>
                               </telerik:RadComboBox>
                               <asp:RequiredFieldValidator ID="rfvAxis" runat="server" ErrorMessage="*" ControlToValidate="radCmbAxis" InitialValue="--Select--"></asp:RequiredFieldValidator>
                           </EditItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn UniqueName="tcIsSameAxis" HeaderText="Is Same Axis">
                           <ItemTemplate>
                               <asp:CheckBox ID="cbIsSameAxisDisplay" runat="server" Enabled="false" />
                           </ItemTemplate>
                           <EditItemTemplate>
                               <asp:CheckBox ID="cbIsSameAxis" runat="server" />
                           </EditItemTemplate>
                       </telerik:GridTemplateColumn>
                   </Columns>
                     <CommandItemTemplate>
                       <table class="rgXAxisCommandTable">
                           <tr>
                               <td align="left">
                                   <asp:Button ID="AddNewRecordButton" CommandName="InitInsert" runat="server" CssClass="rgAdd" />
                                   <asp:LinkButton ID="lnkAddNewRow" runat="server" CommandName="InitInsert" Text="Add new record"></asp:LinkButton>
                                    
                               </td>
                           </tr>
                       </table>
                   </CommandItemTemplate>
                     
                   <PagerStyle AlwaysVisible="True" />
                   <HeaderStyle Font-Bold="True" BackColor="#BDBDBD" ForeColor="Black" />
               </MasterTableView>
               <SelectedItemStyle BackColor="Blue" />
                 
           </telerik:RadGrid>

Thanks in advance.

Satbir
Satbir
Top achievements
Rank 1
 answered on 10 Jun 2013
2 answers
134 views
Hi,

I am not getting visual clue for non-visible appointment of scheduler.

As shown in attachment "dayView.png", i can not get visual clue while for weekview as shown in "weekView.png" i can get visual clue.

What properties do i need to set for dayview to show visual clue?

Regards,
Nehal
Nehal
Top achievements
Rank 1
 answered on 10 Jun 2013
3 answers
363 views
Hello,

I'm trying to access a checkbox within the header of my RadGrid via javascript.  Is there a way to do this?  Thank you.
Shinu
Top achievements
Rank 2
 answered on 10 Jun 2013
3 answers
256 views
Hi guys. I have implemented a RadGrid with Edit and Insert Mode and filter capabilities.

When filtering the RadGrid while in edit mode, the edited row seems to be based on the row number, eg, when I'm editing row number 3, and while editing, the grid is filtered, the edited row remains at row number 3 even though the row of the record I'm currently editing may have changed.

For Example, if I'm doing auto CRUD on this table with in place editing

[id] [code]
-----------------------
[01] codeX
[02] codeY
[03] codeY

and the row being edited is the 2nd one ([02] codeY)

if a filter (using the RadGrid default filter) is done on Code "EqualTo" 'codeY' such that the result becomes

[id] [code]
-----------------------
[02] codeY
[03] codeY

the edited row is still the 2nd one ([03] codeY) even though the row originally being edited is ([02] codeY)

Is this the expected behaviour, or is there are way to instruct the RadGrid to look for the record to set the edit mode on that particular record again? If not, is there a way to automatically cancel edit mode/insert mode just before filtering? Or to disable all filtering controls while user is in edit/insert mode? Thanks for reading.

(this is a repost of http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-cancel-edit-mode-when-filtering.aspx, i couldn't figure out how to change the topic title or delete that post, sorry)
Joey
Top achievements
Rank 1
 answered on 10 Jun 2013
8 answers
823 views
Hi there,

I am not able to obtain desiderd format of the TimeSpan when the grid bounds to a IList<T>. It seems there is no way to get rid of the seconds fraction of the TimeSpan, even using DataFormatString={0:t} (or  {0:HH:mm}). The column is bound to a TimeSpan property, of curse.

Furthermore, using EditMode=InPlace, the TimePiker does not pop-up nor display its list - but no error is raised either server nor client side.

I don't know what's going on, but when I set the TimePiker to limit the range of time and reduce the interval, I can no longer go to EditMode because of an error pretending the value is outside the limits. It is not so, as for the TimeSpan is passed in, however maybe that internally the TimeSpan is formatted in such a way it become no longer valid (eg: seconds wich I want to get rid of may be taken as minutes) - it is a mere speculation of curse.

Exactly how is to be managed this scenario?
Have a class with two TimeSpan (classical Start-Stop pair), have it bound to two different columns in the RadGrid, hiding the "seconds" part of the time. Let it be edited In Place with a TimePiker which range goes from 08.00 to 20.00 stepping by 30 minutes.
It shoud not be so difficult, isn't it? Evidently I do some mistake.

Thanks in advance,
Marco

Brady
Top achievements
Rank 1
 answered on 09 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?