Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
79 views
Is it possible to use the image editor and the file explorer together.

I want to be able to click an image in the file explorer and then edit the selected image in the image editor.  I have to say I have been struggling with this concept.  If someone could share some code or guide me to where this has already been done please do.

Thank you for your time

Simon
Vessy
Telerik team
 answered on 05 Jan 2015
1 answer
56 views
Hello,

when i paste some content from word in editor html tags are replaced with br.

eg as i paste this from word:

Some Text
Some Text
Some Text

.Vishy1
·Vishy2
·Vishy3

Some Text
Some Text
Some Text


1.vishy1
2.vishy2
3.vishy3

Some Text
Some Text
Some Text

It is converted as:


Some Text
Some Text
Some Text

Vishy1 (list replaced with  br)
Vishy2
Vishy3

Some Text
Some Text
Some Text

vishy1 (list replaced with  br)
vishy2
vishy3

Some Text
Some Text
Some Text

they all are inside a p tag

I want them to split by list tags as content before lists in a paragraph tag and content after lists in a paragraph tag.

Ianko
Telerik team
 answered on 05 Jan 2015
6 answers
258 views
I am just starting with the TreeList.
I have a button column and several boundColumns.
How do I get the value of a column on button click in the same row?

thanks
Felice
Konstantin Dikov
Telerik team
 answered on 05 Jan 2015
1 answer
358 views
I have a very simple test scenario that I am trying to work out and have found a very strange behavior that is keeping it from working.

Here is my basic scenario: I want to display a modal window with a single user control in it. The user control only contains a RadGrid for editing some basic data. If I put a copy of the RadWindow code on a test host aspx page, it works just fine. If I put the *exact same code* into a new bare bones user control, and desposit that on a different test page, the RadWindow no longer displays.

Here is my RadWindow definition:

<telerik:RadWindow ID="modalPopup" runat="server" Modal="true" OffsetElementID="main" OpenerElementID="btnShowWindow" Height="525px" Width="525px" InitialBehaviors="Resize">
    <ContentTemplate>
        <uc3:MissingLocationPremiumEditor ID="ctlMissingLocationPremiumEditor" runat="server" />
    </ContentTemplate>
</telerik:RadWindow>
<asp:Button ID="btnShowWindow" runat="server" Text="Show Window" />

If I put this on my test page, it works fine. If I put it into this user control (with no code behind), it no longer displays. When I click the button the screen flickers and nothing shows.

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="windowdummy.ascx.vb" Inherits="McRating.windowdummy" %>
<%@ Register Src="../controls/ClientPicker.ascx" TagName="ClientPicker" TagPrefix="uc2" %>
<%@ Register Src="../protected/controls/ClientDetail.ascx" TagName="ClientDetail" TagPrefix="uc1" %>
<%@ Register Src="../protected/controls/MissingLocationPremiumEditor.ascx" TagName="MissingLocationPremiumEditor" TagPrefix="uc3" %>
<telerik:RadWindow ID="modalPopup" runat="server" Modal="true" OffsetElementID="main" OpenerElementID="btnShowWindow" Height="525px" Width="525px" InitialBehaviors="Resize">
    <ContentTemplate>
        <uc3:MissingLocationPremiumEditor ID="ctlMissingLocationPremiumEditor" runat="server" />
    </ContentTemplate>
</telerik:RadWindow>
<asp:Button ID="btnShowWindow" runat="server" Text="Show Window" />

Why would I get different behaviors?? My test pages have nothing more than a RadScriptManager on them because I was trying to strip this all done to the absolute bare minimum to get it working.

That is the basic issue, but I did a little more extensive troubleshooting. I created a test page that had the basic RadWindow code input right on it, and right below it, a reference to the user control - effectively giving me both ways of doing it on the same page. 

Here is where things got interesting. If I clicked the user control embedded version, the screen flashed and nothing else happened. It doesn't matter if I click that button first or not. Once I click the local page version of the RadWindow then I see the modal dialog as I should. HOWEVER, I accidentally noticed that in fact the user control embedded version is actually right underneath the one I see. If I move the local embedded RadWindow out of the way, I can see the window created by the user control, as shown in the attached image.

So, what is going on here anyway, and how can I fix it?
Marin Bratanov
Telerik team
 answered on 05 Jan 2015
8 answers
176 views
Hi Team,

I have problems to fire templatesID added as markups at runtime using demo samples. The TemplateID MondayTemplate are not fired but the item is marked as Special days in render. TemplateId are only working if specialDays are added as markup in the initial page like DateTemplate. Special days(as markup or runtime) are lost after paging need some event to reload?. Could you reproduce and help us? Regards

 <telerik:RadCalendar  ID="RadCalendar1" runat="server" Skin="Special" EnableMultiSelect="true" FirstDayOfWeek="Monday" UseRowHeadersAsSelectors ="true" 
            EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false" EnableMonthYearFastNavigation="false" DayNameFormat="Short" 
            ShowRowHeaders="true" ShowOtherMonthsDays="false" OnDefaultViewChanged="RadCalendar1_DefaultViewChanged"
            <ClientEvents OnDateSelecting="DateSelected" /> 
            <HeaderTemplate> 
                <asp:Image ID="HeaderImage" runat="server" Width="757" Height="94" Style="display: block" /> 
            </HeaderTemplate> 
            <FooterTemplate> 
                <asp:Image ID="FooterImage" runat="server" Width="757" Height="70" Style="display: block" /> 
            </FooterTemplate> 
            <SpecialDays> 
            <telerik:RadCalendarDay Date="2010/06/16" Repeatable="DayInMonth" TemplateID="DateTemplate" /> 
            </SpecialDays> 
            <CalendarDayTemplates> 
                <telerik:DayTemplate  ID="DateTemplate" runat="server"
                    <Content> 
                        <div class="rcTemplate rcDayDate"
                            date 
                        </div> 
                    </Content> 
                </telerik:DayTemplate> 
                <telerik:DayTemplate ID="MondayTemplate" runat="server" > 
                    <Content> 
                        <div class="rcTemplate rcMondayDate"
                            date 
                        </div> 
                    </Content> 
                </telerik:DayTemplate> 


 protected  void Page_Load(object  sender, EventArgs e) 
 if (!IsPostBack) 
 { 
    RadCalendarDay NewDay = new RadCalendarDay(RadCalendar1); 
    NewDay.Date = new DateTime(2010, 6, 20); <--Fire
    NewDay.Repeatable = RecurringEvents.DayAndMonth;<--Fire
    NewDay.TemplateID = "MondayTemplate"; <---------------NOT FIRED
    NewDay.ToolTip = "Tip";    <---Fire or ItemStyle.CssClass = "MyClass"; is ok.
    RadCalendar1.SpecialDays.Add(NewDay); 
 } 
}  

The Result is like no template added
<td title="Tip">
<div class="radTemplateDay_Special">18</div>
</td>

SpecialDays are lost after paging to next or prev month if added or not as markup.
Maria Ilieva
Telerik team
 answered on 05 Jan 2015
8 answers
114 views
I have an interesting problem that I have never had before.  I have a radgrid that has it's datasource created in the NeedDataSource method. 

protected void CompletedLineProductionGoalGrid_NeedDataSource(object sender, EventArgs e)
{
    GetDataSource();
    List<LineProductionGoal> myCompletedGoals = new List<LineProductionGoal>();
    myCompletedGoals.AddRange(listOfGoals.Where(i => i.StatusID == 5));
    CompletedLineProductionGoalGrid.DataSource = myCompletedGoals.OrderBy(i => i.LineName);
}
 
private void GetDataSource()
{
    if (listOfGoals == null)
    {
        listOfGoals = new LineProductionGoal().SelectAllLineProductionGoalsByUserIDNotDeleted(((User)Session["User"]).UserID);
    }
}
<telerik:RadGrid ID="CompletedLineProductionGoalGrid" runat="server">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn DataField="LineName" HeaderText="Line" UniqueName="LineName" />
            <telerik:GridBoundColumn DataField="TargetUnitCount" HeaderText="Target" UniqueName="TargetUnitCount" />
            <telerik:GridBoundColumn DataField="ActualUnitCount" HeaderText="Actual" UniqueName="ActualUnitCount" />
            <telerik:GridBoundColumn DataField="SubmittedByName" HeaderText="Submitter" UniqueName="SubmittedByName" />
            <telerik:GridBoundColumn DataField="ApprovedByName" HeaderText="Approver" UniqueName="ApprovedByName" />
            <telerik:GridBoundColumn DataField="StatusType" HeaderText="Status" UniqueName="LineStatusType" />
            <telerik:GridDateTimeColumn DataField="StartDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Start" UniqueName="StartDate" />
            <telerik:GridDateTimeColumn DataField="EndDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="End" UniqueName="EndDate" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

What happens is that if I put in the full url (http://localhost:5100/test/default.aspx) then everything works as expected.  However if I go to (http://localhost:5100/test/) then it throws an error.  Has anyone seen this behavior before. 
Viktor Tachev
Telerik team
 answered on 05 Jan 2015
3 answers
92 views
I'm attempting to use the latest version of the Telerik controls, I have added my references in the ASP.NET project as shown in the attached image, but keep getting the errors in the 2nd attached image. Can someone help me with that
Angel Petrov
Telerik team
 answered on 05 Jan 2015
1 answer
90 views
I've stripped down my project to the barest of minimums - you can open this with no code behind and find that the left sliding zone works properly however the second set does not. I've found that ( in this particular case ) commenting the <br / > s out - lets the sliding zone work again ? I am having the same issues in my full project and this does not correct the sliding pane issues there but does here - after stripping out all other code and controls.

I'm testing using Chrome's emulator = iPAD simulation
Note that when using a real iPAD it exhibits identical behavior - 

Also noteable:   all of my radsliders are un-responsive as well in iPAD mode

You'll also see I've tried both old and new Html and Doctype declarations - no differences found 

Currently
Using VS 2012 - target framework is 4.5
     Referencing Telerik v 2014.2.724.45  Web.Design / Web.Device.Detection / Web.UI / Web.UI.Skins

A better understanding of these anomalies might help me discover why my real app will not perform on the iPAD.



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchView.aspx.cs" Inherits="Views.SearchView" Async="true" %>
<%@ 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">--%>
<%--<html xmlns="http://www.w3.org/1999/xhtml">--%>

<!DOCTYPE html>
<html>
    

<head id="Head1" runat="server">
    <title></title>
</head>


<body class="bodystyle">

    <form id="form1" runat="server">
        
        
       
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" EnablePageMethods="True">
            
        </telerik:RadScriptManager>

            Set Chrome emulation mode to Apple iPad 3 / 4 then -- comment the 3 < br / >  out / uncomment to see the effects 
            
            <telerik:RadSplitter runat="server" ID="RadSplitter1" Height="100%" Width="100%" Orientation="Vertical">

                <telerik:RadPane runat="Server" ID="radpane1" Width="10px" MinWidth="10" MaxWidth="300" Scrolling="None" CssClass="radpane1" ShowContentDuringLoad="False">

                    <telerik:RadSlidingZone ID="slidingzone1" runat="server" Width="25px" DockedPaneId="pane1" ClickToOpen="True" RenderMode="Classic">

                        <telerik:RadSlidingPane ID="pane1" Title="ABC Works fine" runat="server" Width="275" MinWidth="25" MaxWidth="275">

                            <asp:Panel runat="server" ID="panelAroundMenu">

                            </asp:Panel>

                        </telerik:RadSlidingPane>

                    </telerik:RadSlidingZone>

                </telerik:RadPane>

                <telerik:RadSplitBar ID="RadSplitbar1" runat="server">
                </telerik:RadSplitBar>
                
                <telerik:RadPane runat="Server" ID="radpane22">
                    
                    <div id="divBody" runat="server" class="divBody">

                        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">

                            <telerik:RadPageView ID="rpvCreate" runat="server">

                                <telerik:RadSplitter runat="server" ID="RadSplitter2" Orientation="Horizontal" >

                                    <telerik:RadPane runat="Server" ID="radpane11" Height="20px" MaxWidth="980" Scrolling="None" ShowContentDuringLoad="False">


                                        <telerik:RadSlidingZone ID="ListMetricsSlidingZone" runat="server" Width="25px"
                                            DockedPaneId="ListMetricsPane" RenderMode="Auto" ClickToOpen="True" SlideDirection="Bottom"
                                            BorderStyle="Dotted" BorderWidth="1px" BorderColor="Black">

                                            <telerik:RadSlidingPane ID="ListMetricsPane" Title="DEF" runat="server" Height="340">
                                                
                                                Cannot collapse in iPAD emulation UNTIL the three < br / > 's below are commented out

                                            </telerik:RadSlidingPane>

                                          
                                              <telerik:RadSlidingPane ID="ListHistorySlidingPane1" Title="XYZ" Font-Size="X-Large" runat="server" Height="340">
                                              
                                                    Cannot expand - in iPAD emulation UNTIL the three < br / > 's below are commented out

                                            </telerik:RadSlidingPane>


                                        </telerik:RadSlidingZone>

                                    </telerik:RadPane>




                                    <telerik:RadPane runat="Server" ID="radpane33" Scrolling="None" ShowContentDuringLoad="False">

                                        <table class="maintable">
                                            <tr>
                                                <td style="vertical-align: top;">
                                                    <div id="divWrapper" runat="server">
                                                        <div id="dfssfddfsfdfd" runat="server" style="display: block">
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>

                                    </telerik:RadPane>

                                </telerik:RadSplitter>

                            </telerik:RadPageView>
                            
                        </telerik:RadMultiPage>
                        
                        
                        <br />
                        <br />
                        <br />
                        

                    </div>
                
                        <%--                     
                        <br />
                        <br />
                        <br />
                            fails here as well -- when uncommented
                        --%>

                </telerik:RadPane>
                
            </telerik:RadSplitter>
        
        

    </form>

</body>


</html>

Vessy
Telerik team
 answered on 05 Jan 2015
2 answers
219 views
Hi, hows it going?

I have a RadGrid control (2014.3.1024.45) that has paging, filtering, sorting and editing by template enabled. If I enter a filter value, the filter row in the grid disappears after the post back. The user is then unable to remove/change the filtering. Here my code:

<telerik:RadGrid runat="server" ID="rgdAddresses" AutoGenerateColumns="false" ShowStatusBar="true" AllowSorting="True" AllowFilteringByColumn="true"
        OnItemCommand="rgdAddresses_ItemCommand"
        OnNeedDataSource="rgdAddresses_NeedDataSource"
        OnInit="rgdAddresses_Init"
        OnItemDataBound="rgdAddresses_ItemDataBound"
        OnSortCommand="rgdAddresses_SortCommand">
        <MasterTableView DataKeyNames="Id, STACode" CommandItemDisplay="Top">
            <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
                ShowExportToCsvButton="true" ShowExportToPdfButton="false"
                ShowRefreshButton="false" ShowAddNewRecordButton="true" AddNewRecordText="New STA Address" />
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" ItemStyle-Width="20px"  HeaderText="Edit" UniqueName="Edit" />
                <telerik:GridBoundColumn UniqueName="STACode" HeaderText="STA Code" DataField="STACode"  AllowFiltering="true" />
                <telerik:GridBoundColumn UniqueName="Name" HeaderText="Name" DataField="Name" AllowFiltering="true" />
                <telerik:GridBoundColumn UniqueName="AddressLine1" HeaderText="Address Line 1" DataField="AddressLine1" AllowFiltering="true" />
                <telerik:GridBoundColumn UniqueName="AddressLine2" HeaderText="Address Line 2" DataField="AddressLine2" Visible="false" />
                <telerik:GridBoundColumn UniqueName="AddressLine3" HeaderText="Address Line 3" DataField="AddressLine3" Visible="false" />
                <telerik:GridBoundColumn UniqueName="AddressLine4" HeaderText="Address Line 4" DataField="AddressLine4" Visible="false" />
                <telerik:GridBoundColumn UniqueName="City" HeaderText="City" DataField="City" AllowFiltering="true" />
                <telerik:GridBoundColumn UniqueName="Postcode" HeaderText="Postcode" DataField="Postcode" AllowFiltering="true" />
                <telerik:GridBoundColumn UniqueName="CountryCode" HeaderText="Country Code" DataField="CountryCode" Visible="false" />
                <telerik:GridBoundColumn UniqueName="TRNNumber" HeaderText="TRN Number" DataField="TRNNumber" AllowFiltering="true" />
                <telerik:GridBoundColumn UniqueName="DepotNumber" HeaderText="Depot Number" DataField="DepotNumber" Visible="false" />
                <telerik:GridBoundColumn UniqueName="DeliveryDayIndicator" HeaderText="Delivery Day Indicator" DataField="DeliveryDayIndicator"  />
                <telerik:GridTemplateColumn HeaderText="Active" UniqueName="Active" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center">                   
                    <ItemTemplate>
                        <asp:Image ID="imgActive" runat="server" ImageUrl="<%# GetBindingActiveImage() %>" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn UniqueName="ActiveExport" HeaderText="Active" DataField="Active" Visible="false" />
                <telerik:GridTemplateColumn HeaderText="Mixed Marker" UniqueName="MixedMarker" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Image ID="imgMixedMarker" runat="server" ImageUrl="<%# GetBindingMixedMarkerImage() %>" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn UniqueName="MixedMarkerExport" HeaderText="Mixed Marker" DataField="MixedMarker" Visible="false" />
                 
            </Columns>
            <EditFormSettings EditFormType="Template">
                <FormTemplate>
                    <table class="tableStyle">
                        <tr>
                            <td colspan="5">
                                <asp:Label ID="lblInstruction" runat="server" CssClass="subTitle" Text='<%# (Container is GridEditFormInsertItem) ? "Add a new STA Address" : "Edit existing STA Address" %>' />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px">
                                <asp:Label ID="lblSTACode" runat="server" CssClass="labelStyle" Text="STA Code:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtSTACode" runat="server" CssClass="textBoxStyle" Text='<%# Bind("STACode") %>' MaxLength="30"  TabIndex="1"/>
                            </td>
                            <td style="width: 30px"></td>
                            <td style="width: 120px">
                                <asp:Label ID="lblActive" runat="server" CssClass="labelStyle" Text="Active:" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkActive" runat="server" Checked='<%# (Container is GridEditFormInsertItem) ? true : Eval("Active")  %>' TabIndex="9" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblName" runat="server" CssClass="labelStyle" Text="Name:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtName" runat="server" CssClass="textBoxStyle" Text='<%# Bind("Name") %>' MaxLength="50" TabIndex="2" />
                            </td>
                            <td></td>
                            <td>
                                <asp:Label ID="lblTRNNumber" runat="server" CssClass="labelStyle" Text="TRN Number:" />
                            </td>
                            <td>
                               <asp:TextBox ID="txtTRNNumber" runat="server" CssClass="textBoxStyle" Text='<%# Bind("TRNNumber") %>' MaxLength="6" TabIndex="10" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblAddressLine1" runat="server" CssClass="labelStyle" Text="Address Line 1:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtAddressLine1" runat="server" CssClass="textBoxStyle" Text='<%# Bind("AddressLine1") %>' MaxLength="50" TabIndex="2" />
                            </td>
                            <td></td>
                            <td>
                                <asp:Label ID="lblDepotNumber" runat="server" CssClass="labelStyle" Text="Depot Number:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtDepotNumber" runat="server" CssClass="textBoxStyle" Text='<%# Bind("DepotNumber") %>' MaxLength="5" TabIndex="11"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblAddressLine2" runat="server" CssClass="labelStyle" Text="Address Line 2:"  />
                            </td>
                            <td>
                                <asp:TextBox ID="txtAddressLine2" runat="server" CssClass="textBoxStyle" Text='<%# Bind("AddressLine2") %>' MaxLength="30" TabIndex="3" />
                            </td>
                            <td></td>
                            <td>
                                <asp:Label ID="lblMixedMarker" runat="server" CssClass="labelStyle" Text="Mixed Marker:" />
                            </td>
                            <td>
                                <asp:Label ID="lblMixedMarkerValue" runat="server" CssClass="labelStyle" Text='<%# (Container is GridEditFormInsertItem) ? "True" : Eval("MixedMarker") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblAddressLine3" runat="server" CssClass="labelStyle" Text="Address Line 3:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtAddressLine3" runat="server" CssClass="textBoxStyle" Text='<%# Bind("AddressLine3") %>' MaxLength="30" TabIndex="4"/>
                            </td>
                            <td></td>
                            <td>
                                <asp:Label ID="lblDeliveryDay" runat="server" CssClass="labelStyle" Text="Delivery Day Indicator:" />
                            </td>
                            <td>
                                <asp:Label ID="lblDeliveryDayValue" runat="server" CssClass="labelStyle" Text='<%# (Container is GridEditFormInsertItem) ? "0" : Eval("DeliveryDayIndicator") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblAddressLine4" runat="server" CssClass="labelStyle" Text="Address Line 4:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtAddressLine4" runat="server" CssClass="textBoxStyle" Text='<%# Bind("AddressLine4") %>' MaxLength="30" TabIndex="5" />
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblCity" runat="server" CssClass="labelStyle" Text="City:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtCity" runat="server" CssClass="textBoxStyle" Text='<%# Bind("City") %>' MaxLength="30" TabIndex="6" />
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblPostcode" runat="server" CssClass="labelStyle" Text="Postcode:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtPostcode" runat="server" CssClass="textBoxStyle" Text='<%# Bind("Postcode") %>' MaxLength="10" TabIndex="7" />
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblCountryCode" runat="server" CssClass="labelStyle" Text="Country Code:" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtCountryCode" runat="server" CssClass="textBoxStyle" Text='<%# Bind("CountryCode") %>' MaxLength="5" TabIndex="8" />
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
 
                    </table>
                    <table class="tableStyle">
                        <tr>
                            <td>
                                <telerik:RadButton ID="btnSave" runat="server" Text="Save"
                                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                            </td>
                            <td>
                                <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel" />
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>


What am I doing wrong?

Thanks in advance,

Matt
Matt
Top achievements
Rank 1
 answered on 05 Jan 2015
1 answer
163 views
I have a database nvarchar field which stores the phone number.  I would like to add a column in the grid to display the formatted phone number and add a hyperlink.  Some of the cellphone fields can be null, so I am trying to check for that before converting to Int64.

The error I am getting is The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments.  If I set the ItemTemplate to just Eval("CellPhone") the grid properly displays the cellphone numbers as an unformatted string.

What is the best approach here?  Once I get the basic ItemTemplate working, I was going to try to add a hyperlink so users can click on the phone number and invoke the dialing app.  ie. tel://2055551234 


<telerik:GridTemplateColumn DataField="CellPhone" FilterControlAltText="Filter CellPhoneNumber column" HeaderText="Cell Phone" UniqueName="CellPhoneNumber">
 
    <ItemTemplate>
        <%#  !string.IsNullOrWhiteSpace(Eval("CellPhone")) ? string.Format("{0:(###)###-####}", Convert.ToInt64(Eval("CellPhone"))) : "" %>
    </ItemTemplate>
 
</telerik:GridTemplateColumn>
Viktor Tachev
Telerik team
 answered on 05 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?