Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
117 views
I have this code:

sb.Append(RadDatePicker1.SelectedDate.Value.Date);

How Can I do to remove only hour. I need date part only.

Thanks.

Princy
Top achievements
Rank 2
 answered on 07 May 2012
2 answers
295 views
I have a simple grid and I want to have links to files and just show an image based on their file extension. The code below gets me close but the image is static.
<telerik:GridHyperLinkColumn AllowFiltering="False" DataNavigateUrlFields="Application_Key, File_Title, File_Name, FileExt" DataNavigateUrlFormatString="att/{0}/{2}" DataTextField="File_Title" ImageUrl="img/doc.png" ShowSortIcon="False" Target="_blank" UniqueName="FileCol">
</telerik:GridHyperLinkColumn>

The GridImageColumn has a property that would work perfectly DataImageUrlFormatString="IMG/{0}.png" but it does not have DataNavigateUrlFormatString  :(

How can I do this?

Thanks
Najid Hanif
Top achievements
Rank 2
 answered on 07 May 2012
1 answer
85 views
Hey Guys,

I have a curious issue. I have a RadMenu sitting in a RadPanelBar, which sits in a HTML table cell. It is the only item in the cell. When I expand the RadMenu, it is cropped by the border of the table cell. So you never see the expansion beyond the table cell borders. Is this the default behaviour? If so, was that intended? If so, does this mean that I have to redesign my page? Z-index won't rectify this issue since it's not rendering under any other control.

Thanks in advance.
Jonathan
Jonathan
Top achievements
Rank 1
 answered on 06 May 2012
0 answers
59 views
that's what i did:

1. create asp.net web application (.net 3.5)
2. create ashx hanler wich generate excel file using Open XML SDK

It is work. I can download excel file and open it.

3. I add to my application telerik ajax control. 

It is not work. I can download excel file but cant open it.

if i try generate and download excel file by button click or .aspx insted .ashx that it is work.


Петряков
Top achievements
Rank 1
 asked on 06 May 2012
3 answers
101 views
Hi, I try using jquery function in content page,$telerik functions that shown in master page is OK, but it doesn't show in content page ?
Any help?
 
Duy
Top achievements
Rank 1
 answered on 06 May 2012
1 answer
96 views
Hi, I want to combine Rotator with ticker and Menu. 
As exapmle I want to insert http://demos.telerik.com/aspnet-ajax/rotator/examples/ticker/defaultcs.aspx this example into http://demos.telerik.com/aspnet-ajax/menu/examples/megadropdown/defaultcs.aspx this example's one of the dropdowns (For Example News part).

<telerik:RadMenuItem Text="Spor" PostBack="false">
                   <Items>
                        <telerik:RadMenuItem CssClass="News" Width="640px">
                            <ItemTemplate>
                                <div id="NewsWrapper" class="Wrapper">
                                    <h3>
                                        Spor Etkinlikleri & Haberler</h3>
                                    <div class="newsLeft">
                                        <telerik:RadRotator ID="RadRotator1" DataSourceID="XmlDataSource1"
                                        runat="server" Width="400" ItemWidth="400" Height="250" 
                                        ItemHeight="250" FrameDuration="10000" ZIndex="5000">
                                            <ItemTemplate>
                                                <div class="jewelryImage">
                                                    <img src="<%# XPath("Image") %>" height="250" width="150" alt="Image"  />
                                                </div>
                                                <div class="jewelryRightPane">
                                                    <div class="jewelryDescription">
                                                        <div class="jewelryDescription_Text">
                                                            <telerik:RadTicker ID="RadTicker1" runat="server">
                                                                <Items>
                                                                    <telerik:RadTickerItem Text='<%# XPath("Title")%>' />
                                                                </Items>
                                                            </telerik:RadTicker>
                                                        </div>
                                                    </div>
                                                    <div class="jewelryName">
                                                        <asp:Label ID="Label1" runat="server" Text='<%# XPath("ItemName") %>'  height="35" width="250" alt="" Font-Names="Consolas"></asp:Label>
                                                    <div class="addToCart">
                                                        <a href="#" onclick="return false;">
                                                            <img src="images/HaberinDevami.png" height="22" width="250" style="border: 0px" alt="Haberin Devamı"
                                                                title="Haberin Devamı" />
                                                        </a>
                                                    </div>
                                                </div>
                                            </ItemTemplate>
                                        </telerik:RadRotator>
                                    </div>
                                    <a class="moreLink" href="#">Hepsini Gör &raquo;</a>
                                </div>
                            </ItemTemplate>
                        </telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenuItem>

İt seems fine, I can see the images or other stuff in page's source code but i can't see it in menu there is a white blank. When i put rotator outside of the menu it works well but in menu not. I have tried to put zindex=5000 to rotator but didnt work.
You can want any further information.
Barışcan
Top achievements
Rank 2
 answered on 05 May 2012
1 answer
313 views
I have a radgrid with a datepicker and I can bind the raddatepicker when a dae exists in the database, but the date to start out is always NULL and can be left null, right now I get an error on bind when trying to bind if the db is null, how can I bind if a date exists but if nothing exists show no date.   In my sql code I can do a
Case when dtRecoverTemp IS NULL then '' ELSE dtRecoverTemp END dtRecoverTemp,

but what happens then is it puts in 1900-01-01 for date and I want it to show nothing.

<telerik:GridTemplateColumn HeaderText="TEMP_DT">
                                                                    <ItemTemplate>
                                                                            <telerik:RadDatePicker ID="DatePicker" runat="server" PopupDirection="BottomRight" AutoPostBack="false" Width="120px" EnableShadows="true" ShowPopupOnFocus="true" 
                                                                            DatePopupButton-Visible="false" DateInput-CssClass="pointer" SkinID="Web20" SelectedDate='<% #bind ("dtRecoverTemp") %>' >
                                                                            <DateInput runat="server" DisplayDateFormat="yyyy/MM/dd" DateInput-CssClass="pointer"></DateInput></telerik:RadDatePicker>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>


Kevin
Top achievements
Rank 1
 answered on 05 May 2012
1 answer
719 views
Hi,

I am using telerik radgrid and binding the data to it. I have a separate button named 'Export To Excel'. When I click on that button it needs to

export all the records from the grid to excel. For huge datasets when I try to export it gives me out of memory exception error.

Is there anyway I can capture this exception error in my web page.

The function that I use to export to excel is below. I would like to capture that exception in the below function.

Could you please help me to achieve this.

Private Sub btnPrintAll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrintAll.Click
        Try
            Dim radGridExport As RadGrid
            If Me.Parent.Page.Title = "Database Circle Search" Then
                strCallingPage = "CIR"
            ElseIf Me.Parent.Page.Title = "Database Search" Then
                strCallingPage = "SEA"
            End If

            If Not Session("MILUSER") Is Nothing Then
                IsMilUser = CType(Session("MILUSER"), Boolean)
            Else
                IsMilUser = False   ' If object not in session then make it false
            End If

            Dim blnfromSrchUsrCtl As Boolean = True
            Dim blnfromCustGrid As Boolean = False
            Dim blnFromPrintAll As Boolean = True
   

            Dim startTick As Long = DateTime.Now.Ticks
            Dim endTick As Long
            Dim tick As Long
            Dim milliseconds As Long
            Dim microseconds As Long

            strColOrder = ViewState("Column Order")

            If Me.Parent.Page.Title = "Database Search" Then
                Dim objPage As SearchDB
                objPage = CType(MyBase.Page, Page)
                If Not objPage Is No
                    objPage.CustomizeGridColumns(strColOrder, blnfromSrchUsrCtl)
                Else
                    Exit Sub
                End If
            ElseIf Me.Parent.Page.Title = "Database Circle Search" Then
                 If Not IsMilUser Or Not IsEASearch Then
                    Dim objPage As CircleSearchDB
                    objPage = CType(MyBase.Page, Page)
                    If Not objPage Is Nothing Then
                        objPage.CustomizeGridColumns(strColOrder, blnfromSrchUsrCtl)
                    Else
                        Exit Sub

                    End If
                End If
            End If

            radGridExport = CType(Me.FindControl("grdExport"), RadGrid)
            If IsMilUser And strCallingPage = "CIR" And IsEASearch Then
                radGridExport.ExportSettings.IgnorePaging = True
                radGridExport.ExportSettings.OpenInNewWindow = True
                radGridExport.ExportSettings.ExportOnlyData = True
                radGridExport.MasterTableView.ExportToExcel()
            Else
              
                grdResult.MasterTableView.GetColumn("SEL").Display = False
                grdResult.ExportSettings.IgnorePaging = True
                grdResult.ExportSettings.OpenInNewWindow = True
                grdResult.ExportSettings.ExportOnlyData = True
                grdResult.MasterTableView.ExportToExcel()

                If grdResult.MasterTableView.GetColumn("FRQ").Visible = True Then
                    grdResult.MasterTableView.GetColumn("FREQ").Visible = True
                Else
                    grdResult.MasterTableView.GetColumn("FREQ").Visible = False
                End If
             

            End If
          
        Catch ex As Exception
            AFMCommonUtils.LogError(CType(Me.Session("User"), AFMBusinessLogicLayer.UserBL).USERNAME, "UsrSearchResult", "btnPrintAll_Click", ex.Message, ex.StackTrace)
            ClearModuleTracker()
            Response.Redirect("~/ErrorDisplay.aspx")
        End Try
    End Sub

 

Jayesh Goyani
Top achievements
Rank 2
 answered on 05 May 2012
1 answer
84 views
Hello!
I've been searching for many eons it seems, to get a solution to something that shouldn't be that hard.  i have a radgrid with a formtemplate that saves nicely.  On display in the radgrid header are some fields useful to the user but not all data is in the header.  on editing a row, there are listboxes that need to bind to the proper id - this is my issue - they don't bind by themselves on edit.  Again, the id's for these listboxes are not in the header.

I'm showing a sample of the form here.  (i've noticed there are a lot of uses of "Itemid" as the key to the grid and the listbox, but that shouldn't be an issue since they use different data sources.)
<telerik:RadGrid ID="RadGridPlantedPlants" runat="server"  >
<PagerStyle Mode="NumericPages" AlwaysVisible="true" />
 
<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="ItemId"  >
<Columns>
            
    <telerik:GridBoundColumn UniqueName="anItem" HeaderText="ItemId" DataField="ItemId">
        <HeaderStyle Width="60px"></HeaderStyle>
    </telerik:GridBoundColumn>
     
    <telerik:GridBoundColumn UniqueName="uName" HeaderText="name" DataField="name">
    </telerik:GridBoundColumn>
     
</Columns>
 
<EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit ItemId: {0}"
    CaptionDataField="ItemId" EditFormType="Template" PopUpSettings-Modal="true"
     FormTableItemStyle-HorizontalAlign="Justify">
     
    <FormTemplate>
     
                 
      <table id="TableLayout"  cellspacing="3" cellpadding="5" width="340" border="0">
    
        <tr>
            <td>
                Location:<br />(Largest geographical area)<br />
                <telerik:RadComboBox ID="plantingLocationsCombo" runat="server"       
                    DataTextField="name"
                    DataValueField="ItemId"
                    DataSourceID="Objectdata_plantingLocations"
                    Width="200px">
                </telerik:RadComboBox>
             
        </tr>
         
    </table>    
        
    </FormTemplate>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowDblClick="RowDblClick" />
</ClientSettings>
</telerik:RadGrid>

So, of the many examples i've come across, this below seems to be the closest to getting what i need done.  It works fine when there is no formtemplate.  Most of the pieces are in place, but i just can't get my hands on the data in order to tie the listboxes to the data. 

What is really frustrating, is that editformitem.DataItem is available in the debugger and shows all the values from the database but I cannot get my hands on them.

I've seen examples making use of GridDataKeyArray DataKeyValues , parentTables, DataRow[] and hashtable but something is just not clicking.  The example here crashes on examining the GetDataKeyValue.

protected void RadGridPlantedPlants_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
GridEditFormItem editFormItem = e.Item as GridEditFormItem;
//editFormItem.DataItem in debugger shows everything - but I can't get a handle to it
RadComboBox plantingLocationsCombo = (RadComboBox)editFormItem.FindControl("plantingLocationsCombo");
if (editFormItem.ItemIndex != -1) //when = -1 is a new item
{
plantingLocationsCombo.SelectedValue = editFormItem.GetDataKeyValue("pcat_tbllu_location_id").ToString();
}
}
}


Someone's help is greatly appreciated!!!

T
Top achievements
Rank 1
 answered on 05 May 2012
1 answer
343 views
Can somebody help me to integrate this source code into a Telerik asp.net ajax?

http://zeeshanumardotnet.blogspot.mx/2010/11/how-to-keep-session-alive-in-aspnet.html

I need to have an intranet with no session timeout lost.
John
Top achievements
Rank 1
 answered on 05 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?