Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
153 views
I have a pop-up that works with the radgrid and on past grid it owrks fine, when I scroll the pop-up shows next to the line that i mouse over.  Fro some reason on this grid as soon as I scroll the pop-up always shows near the top of the screene of the grid instead of next to the row I am highlighting the label, at this point I ma lost as to what i could be.  the service works and the popup works, it just when I scroll down the grid the pop-up returns the correct info but shows always at top of the screen and grid half shown instead of next to row I am mousing over.

telerik Grid.
<telerik:GridTemplateColumn HeaderText="DMOS">
                                <ItemTemplate>
                                    <asp:Label ID="lblDMOS" runat="server" Text='<%#Bind("DMOS")%>'></asp:Label>
                                    <asp:PopupControlExtender ID="popInfo" runat="server" PopupControlID="pnlPop" TargetControlID="lblDMOS" DynamicContextKey='<% #Eval("DMOS")%>'
                                    DynamicControlID="pnlpop" DynamicServiceMethod="GetMOS" Position="Right"></asp:PopupControlExtender>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
 
 
Pop-up that it calls
 <asp:Panel ID="pnlPop" runat="server" style="display:none"></asp:Panel>
 
 
Item created event of the Radgrid
 Protected Sub myRadVacancy_ItemCreated(sender As Object, e As GridItemEventArgs) Handles myRadVacancy.ItemCreated
        If TypeOf e.Item Is GridDataItem Then
            Dim pce As PopupControlExtender = TryCast(e.Item.FindControl("popInfo"), PopupControlExtender)
 
            Dim behaviorID As String = "pce_" + e.Item.RowIndex.ToString
            pce.BehaviorID = behaviorID
 
            Dim lbl As Label = DirectCast(e.Item.FindControl("lblDMOS"), Label)
 
            Dim OnMouseOverScript As String = String.Format("$find('{0}').showPopup();", behaviorID)
            Dim OnMouseOutScript As String = String.Format("$find('{0}').hidePopup();", behaviorID)
 
            lbl.Attributes.Add("onmouseover", OnMouseOverScript)
            lbl.Attributes.Add("onmouseout", OnMouseOutScript)
        End If
    End Sub
 
Sergvice that it all calls
 
 'Serice for the MOS
    <System.Web.Services.WebMethod(), System.Web.Script.Services.ScriptMethodAttribute()> _
    Public Shared Function GetMOS(contextKey As String) As String
 
        Dim sb As New StringBuilder()
 
        sql = "Select strMOS, strJobTitle, strRemarks from MOSDescription where SUBSTRING(strMOS, 1,3) like '" & contextKey.Substring(0, 3) & "'"
 
        myDataTable = New DataTable
        myDataTable = getData(sql)
 
        If myDataTable.Rows.Count > 0 Then
            sb.Append("<table style='background-color:#f3f3f3; border: #ADC9F7 3px solid; ")
            sb.Append("width:260px; font-size:10pt; font-family:Verdana;' cellspacing='0' cellpadding='3'>")
            sb.Append("<tr><td colspan='3' style='background-color:#ADC9F7; color:white;'>")
            sb.Append("<b>MOS " + myDataTable.Rows(0)(0).ToString() + "</b>")
            sb.Append("</td></tr>")
            sb.Append("<tr><td style='width:400px;'> " + myDataTable.Rows(0)(1).ToString() + "</td></tr>")
            sb.Append("<tr><td style='width:400px;'> " + myDataTable.Rows(0)(2).ToString() + "</td></tr>")
            sb.Append("</table>")
        End If
        Return sb.ToString()
    End Function

Pavlina
Telerik team
 answered on 30 Jul 2013
1 answer
57 views
When I try to bullet the list of selected items, the bulleting is behaving fine. When I try to do the same by typing another list of items below the existing bulleted list, it behaving in a different manner. How to solve it.

https://skydrive.live.com/redir?resid=36645CBDE9D2F8C6!310&authkey=!AAC_PBnFU0QSIBw
Joana
Telerik team
 answered on 30 Jul 2013
2 answers
277 views
Hi folks

There is a radfileexplorer in my webpage which works ok but I am trying to display a local disk also in that control. Given physical path like  D:\  but in vain. What can I do to achieve this?

Thanks
Merin
Vessy
Telerik team
 answered on 30 Jul 2013
1 answer
87 views
hi, i use telerik version Q1 2013 . my combobox with MarkfirstMatch = true. i had list value. example :
"Hoàng"
"Hồng"
"Hanh"
So, when i try to type "Hồng" then my combobox always focus to "Hoàng". the only way i can do is choose that index. please tell me what i should do. thank you !
Nencho
Telerik team
 answered on 30 Jul 2013
1 answer
126 views
I'm trying to use the Ajaxtoolkit's ModalPopup functionality in a project where I am already using radTreeViews but whenever I add a reference to the DLL I get runtime javascript errors such as 0x800a138f - JavaScript runtime error: Unable to set property 'control' of undefined or null reference

I tried using the Radwindow control, but frankly, I dislike it due to how it doesn't get along with ajax postbacks. I just want to use the ModalPopup control. it's simple and effective.

why can I not have a reference to the telerik.web.ui (v4.0.30319) and have it work when I also include the AjaxContolToolkit dll referenced in my project?
Plamen
Telerik team
 answered on 30 Jul 2013
7 answers
584 views
Hi.
In the help-documentation it stand that RadGrid supports built-in localization through Global resources and the follow steps are:

  1. Create a new resource file or copy an existing one from the App_GlobalResources in your installation folder
  2. Add the resource file (resx) file to the App_GlobalResources folder in your application. Note that you should have two files as a bare minimum - RadGrid.Main.resx and the localization file itself - for example RadGrid.Main.en-GB.resx
  3. Set the Culture property to the corresponding language (for example: it-IT, en-GB, ja-JP and so on)

I want to take a copy of of RadGrid.Main.resx. But where can I get this file? I have look in the directory C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q1 2010\App_GlobalResources and can not find it there. To make a new resource file, it stand in the documentation also to take a copy of this file. I could of course make a new resource file with out take a copy but than i have to spend time to find out what the names should be. (I am also interest to make others resources file for other controllers so it will be much easier to make copies of this files.)

In step 3 I should set the culture property to the relevant language but RadGrid have no Culture property. For others contollers like RadEditor it is the language property and others have a CulturInfo but RadGrid does not have this properties. So what am I missing?

Hope anyone can help me.


Ceci


Daniel
Telerik team
 answered on 30 Jul 2013
2 answers
88 views
Greetings,

I'm experiencing a problem exporting a grid to Excel while testing with the Azure Emulator.  I have not deployed to Azure, so I'm not sure the problem exists once deployed.  The problem isn't related to the grid at all, or so it appears.  I'm hoping someone has experienced a similar problem and can point me in the right direction.  The funny thing is that if the grid is bound to an empty generic list the exception doesn't occur.  It only occurs when there are rows present in the grid.  The error I receive is as follows:

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 7/24/2013 10:05:45 AM

Event time (UTC): 7/24/2013 5:05:45 PM

Event ID: bd332a71f6e44a9690da782e0ebcadb6

Event sequence: 135

Event occurrence: 1

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1273337584/ROOT-1-130191590609111328

Trust level: Full

Application Virtual Path: /

Application Path: C:\Users\Administrator\Desktop\Flowtivity\Flowtivity.Web\

Machine name: EPGSA-CPD-2010

Process information:

Process ID: 5192

Process name: iisexpress.exe

Account name: CPD2010\administrator

Exception information:

Exception type: HttpException

Exception message: Cannot use a leading .. to exit above the top directory.

at System.Web.Util.UrlPath.ReduceVirtualPath(String path)

at System.Web.Util.UrlPath.Reduce(String path)

at System.Web.VirtualPath.Combine(VirtualPath relativePath)

at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)

at System.Web.HttpServerUtility.MapPath(String path)

at Telerik.Web.UI.ExportInfrastructure.Image.GetImageFromUrl()

at Telerik.Web.UI.ExportInfrastructure.Image.GetImage()

at Telerik.Web.UI.ExportInfrastructure.XlsBiffRenderer.CreateWorksheet(Table tbl, Workbook wb)

at Telerik.Web.UI.ExportInfrastructure.XlsBiffRenderer.Render()

at Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderForm(HtmlTextWriter nullWriter, Control form)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)

at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderPage(HtmlTextWriter nullWriter, Control page)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Page.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Page.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any feedback is greatly appreciated!

Paul
Top achievements
Rank 1
 answered on 30 Jul 2013
9 answers
400 views
I'm having a hard time figuring what's happening behind the scene when Chart height is changed proportionate to number of items displayed in it.

I tried to maintain the height of each bar to 25px and set the height of the chart to numOfItems * 25 + XXX where XXX is a constant throughout the test to accommodate the chart title, and any padding. I have also set fixed margins instead of the default percentage margin of some elements' Appearance.Dimension such as:

  1. Chart
  2. PlotArea
  3. ChartTitle

Legend, Y-Axis label & item labels are all hidden.

But no matter what I set the constant XXX is, the chart height did follow the formula, but not the PlotArea's height.

Please see the attached screen shots where:

chartImage10.png - numOfItems is 10
chartImage30.png - numOfItems is 30
chartImage70.png - numOfItems is 70

As you can see, the gaps gets wider (as pointed out with the arrows) when the chart's height is larger. I know that the PlotArea's dimension is automatically determined but there must be a way to make it of certain height by modifying the chart's height, without the gaps affecting the height of the PlotArea at the end.
Petar Kirov
Telerik team
 answered on 30 Jul 2013
16 answers
420 views

I dynamically  build my  RadGrid, but it lost sorting and paging functionality.

How can I program it?

This is my code;

Aspx page:


<telerik:RadGrid ID="RadGrid1" runat="server" Style="margin-bottom: 0px" 

            EnableViewState="true"   Width="1145px" AllowPaging="True" AllowSorting="True" Skin="Gray"

            DataSourceID="SqlDataSource1" AutoGenerateColumns="False" >

            <HeaderContextMenu>

                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

            </HeaderContextMenu>

            <MasterTableView>                      

                <RowIndicatorColumn>

                    <HeaderStyle Width="20px"></HeaderStyle>

                </RowIndicatorColumn>

                <ExpandCollapseColumn>

                    <HeaderStyle Width="20px"></HeaderStyle>

                </ExpandCollapseColumn>

            </MasterTableView>

            <FilterMenu>

                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

            </FilterMenu>

        </telerik:RadGrid>

    </div>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ></asp:SqlDataSource>

 

Vb page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If (Not IsPostBack) Then

            Loaddata()

        End If

    End Sub

 

    Private Sub Loaddata()

        Dim strSQl As String

        strSQl = "Select Pro ,ShipperName as [Shipper Name],BL as [Bill of Lading],convert(varchar(10),PUDate,101) as [Pickup Date]," & _

           " ConsigneeName as Consignee, PO as [Purchase Order],convert(varchar(10),DELDate,101) as [Delivery Date]," & _

           " convert(varchar(10),convert(money,charge))as Charge, ConsigneeCode,ShipperCode,DateInvoiced,BillToCode,PmtType,t.COMPANY," & _

           " c.ThirdPartyFlag as thirdPartyFlag from ShipmentTracking.dbo.ltlprodata3 as t with (nolock) " & _

           " inner join CustomerMaster.dbo.MainframeCustomers as c with (nolock) " & _

           " on (c.company = t.company and t.billtocode = c.[cust no]) " & _

           " where ( DELDATE >= '5/26/2009' and DELDATE <= '6/26/2009' and t.company='p1')  and " & _

           " ((pmttype ='P' and (ShipperCode = 'FEED84' or BillToCode = 'FEED84') and c.ThirdPartyFlag = 0) " & _

           " or (pmttype ='C' and (ConsigneeCode = 'FEED84' or BillToCode = 'FEED84') and c.ThirdPartyFlag = 0) " & _

           " or (pmttype <> 'F' and BillToCode = 'FEED84' and c.ThirdPartyFlag = 1)) " & _

           " ORDER BY Pro;"

 

        FillGrid(strSQl)

    End Sub

 

Sub FillGrid(ByVal strSQL As String)

 

        Dim dbcon As New SqlConnection

        Dim dbCommand As New SqlCommand

        Dim strConnectionString As String

        Dim errHandler As New ErrorHandler

        Dim SQLEscape As New SQLEscape

        Dim rdr As SqlDataReader

        strConnectionString = System.Configuration.ConfigurationManager.AppSettings.Get("GenericDB")

        dbcon.ConnectionString = strConnectionString

        dbcon.Open()

        'cmd = New SqlCommand

        dbCommand.Connection = dbcon

 

        dbCommand.CommandType = CommandType.Text

        dbCommand.CommandText = strSQL

 

        rdr = dbCommand.ExecuteReader()

 

 

        'RadGrid1.Columns.Clear()

 

 

        SqlDataSource1.ConnectionString = strConnectionString

        SqlDataSource1.SelectCommand = strSQL

 

        Dim Pro As New GridHyperLinkColumn

        Dim dataNavigateUrlFields() As String = {"Pro"}

        Pro.DataTextField = "Pro"

        Pro.DataNavigateUrlFields = dataNavigateUrlFields

        Pro.HeaderText = "Pro"

        Pro.SortExpression = "Pro"

        Pro.DataNavigateUrlFormatString = "../MyPyle/MyPyleLTLTracking.aspx?Pro={0}"

        '***************

 

 

        Dim Shipper As New GridHyperLinkColumn

        Dim dataNavigateUrlFields1() As String = {"Shipper", "ShipperCode"}

        Shipper.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        Shipper.DataTextField = "[Shipper Name]"

        Shipper.SortExpression = "Shipper"

        Shipper.DataNavigateUrlFields = dataNavigateUrlFields1

        Shipper.HeaderText = "Shipper"

        Shipper.Target = "_blank"

        Shipper.DataNavigateUrlFormatString = "../publicdocs/WhoAmI.aspx?Account=P1{0}"

 

 

        Dim ShipperCode As New GridBoundColumn

        ShipperCode.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        ShipperCode.DataField = "ShipperCode"

        ShipperCode.HeaderText = "ShipperCode"

        Shipper.DataNavigateUrlFormatString = "../publicdocs/WhoAmI.aspx?Account=P1{1}"

 

        Dim Consignee As New GridHyperLinkColumn

        Dim dataNavigateUrlFields2() As String = {"Consignee", "ConsigneeCode"}

        Consignee.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        Consignee.DataTextField = "Consignee"

        Consignee.SortExpression = "Consignee"

        Consignee.DataNavigateUrlFields = dataNavigateUrlFields2

        Consignee.HeaderText = "Consignee"

        Consignee.Target = "_blank"

        Consignee.DataNavigateUrlFormatString = "../publicdocs/WhoAmI.aspx?Account=P1{0}"

 

        Dim ConsigneeCode As New GridBoundColumn

        ConsigneeCode.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        ConsigneeCode.DataField = "ConsigneeCode"

        ConsigneeCode.HeaderText = "ConsigneeCode"

        Consignee.DataNavigateUrlFormatString = "../publicdocs/WhoAmI.aspx?Account=P1{1}"

 

        Dim BillofLading As New GridBoundColumn

        BillofLading.DataField = "Bill of Lading"

        BillofLading.SortExpression = "Bill of Lading"

        BillofLading.HeaderText = "Bill of Lading"

        BillofLading.ItemStyle.HorizontalAlign = HorizontalAlign.Left

 

        Dim PickupDate As New GridBoundColumn

        PickupDate.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        PickupDate.DataField = "Pickup Date"

        PickupDate.HeaderText = "Pickup Date"

        PickupDate.SortExpression = "Pickup Date"

 

        Dim PurchaseOrder As New GridBoundColumn

        PurchaseOrder.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        PurchaseOrder.DataField = "Purchase Order"

        PurchaseOrder.HeaderText = "Purchase Order"

        PurchaseOrder.SortExpression = "Purchase Order"

 

        Dim DeliveryDate As New GridBoundColumn

        DeliveryDate.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        DeliveryDate.DataField = "Delivery Date"

        DeliveryDate.SortExpression = "Delivery Date"

        DeliveryDate.HeaderText = "Delivery Date"

 

        Dim charge As New GridHyperLinkColumn

        charge.ItemStyle.HorizontalAlign = HorizontalAlign.Left

        Dim dataNavigateUrlFields3() As String = {"charge"}

        charge.DataTextField = "Charge"

        charge.SortExpression = "Charge"

        charge.DataNavigateUrlFields = dataNavigateUrlFields

        charge.HeaderText = "Charge"

        charge.Target = "_blank"

        charge.DataNavigateUrlFormatString = "../MyPyle/InvoicePDFGenerator.aspx?Pro={0}"

 

        Me.RadGrid1.MasterTableView.Columns.Add(Pro)

        Me.RadGrid1.MasterTableView.Columns.Add(ShipperCode)

        Me.RadGrid1.MasterTableView.Columns.Add(Shipper)

        Me.RadGrid1.MasterTableView.Columns.Add(BillofLading)

        Me.RadGrid1.MasterTableView.Columns.Add(PickupDate)

        Me.RadGrid1.MasterTableView.Columns.Add(Consignee)

        Me.RadGrid1.MasterTableView.Columns.Add(PurchaseOrder)

        Me.RadGrid1.MasterTableView.Columns.Add(DeliveryDate)

        Me.RadGrid1.MasterTableView.Columns.Add(charge)

 

 

        Dim objDR As System.Data.DataRow

        Dim objDT As System.Data.DataTable

        Dim srtDV As System.Data.DataView

        objDT = New System.Data.DataTable("Charges")

 

        ' create data table

        objDT.Columns.Add("Pro", GetType(String))

        objDT.Columns.Add("shippercode", GetType(String))

        objDT.Columns.Add("Shipper", GetType(String))

        objDT.Columns.Add("Bill of Lading", GetType(String))

        objDT.Columns.Add("Pickup Date", GetType(String))

        objDT.Columns.Add("ConsigneeCode", GetType(String))

        objDT.Columns.Add("Purchase Order", GetType(String))

        objDT.Columns.Add("Delivery Date", GetType(String))

        objDT.Columns.Add("charge", GetType(String))

        objDT.Columns.Add("consignee", GetType(String))

 

        If rdr.HasRows Then

            Do While rdr.Read

                objDR = objDT.NewRow

                objDR("Pro") = rdr(0)

                objDR("shippercode") = rdr(9)

                objDR("Shipper") = rdr(1)

                objDR("Bill of Lading") = rdr(2)

                objDR("Pickup Date") = rdr(3)

                objDR("ConsigneeCode") = rdr(8)

                objDR("Purchase Order") = rdr(5)

                objDR("Delivery Date") = rdr(6)

                If IsDBNull(rdr(7)) Then

                    objDR("charge") = 0

                Else

                    objDR("charge") = rdr(7)

                End If

                objDR("consignee") = rdr(4)

 

                objDT.Rows.Add(objDR)

                'End If

            Loop

        End If

 

        srtDV = objDT.DefaultView

        srtDV.Sort = "Pro"

        Session("dt") = objDT         

 

        RadGrid1.DataBind()

 

    End Sub

Someone suggested to create datatable and dataview, because you can only sort on dataview, I tried  to add some code on, but nothing happened  

    Protected Sub RadGrid1_SortCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridSortCommandEventArgs) Handles RadGrid1.SortCommand

        Response.Write("Sort")

 

 

        'Dim tableView As GridTableView = e.Item.OwnerTableView

 

        'If tableView.DataSourceID = "SqlDataSource1" AndAlso e.SortExpression = "Pro" Then e.Canceled = True

 

        'Dim expression As New GridSortExpression()

 

        'expression.FieldName = "Pro"

        'If tableView.SortExpressions.Count = 0 OrElse _

        '   tableView.SortExpressions(0).FieldName <> "Pro" Then

        '    expression.SortOrder = GridSortOrder.Descending

        'ElseIf tableView.SortExpressions(0).SortOrder = GridSortOrder.Descending Then

        '    expression.SortOrder = GridSortOrder.Ascending

        'ElseIf tableView.SortExpressions(0).SortOrder = GridSortOrder.Ascending Then

        '    expression.SortOrder = GridSortOrder.None

        'End If

        'tableView.SortExpressions.AddSortExpression(expression)

        'tableView.Rebind()

 

        'Loaddata()      

 

    End Sub

Thank you.
Galina

Pavlina
Telerik team
 answered on 30 Jul 2013
5 answers
182 views
Lets say I have the following GridTemplateColumn, I use a LinkButton for Custom Sorting and I handle that sorting in the ItemCommand event of the Grid (CommandName="cmdSortBySender")


   <telerik:GridTemplateColumn HeaderStyle-Width="160px" ShowSortIcon="true"  >
    <HeaderTemplate>
        <asp:LinkButton ID="lnkSortBySender" runat="server" CommandName="cmdSortBySender" >
        </asp:LinkButton>
    </HeaderTemplate>
    <ItemTemplate>
        <asp:Label Text='<%# DataBinder.Eval(Container,"DataItem.SenderName") %>' runat="server" />
    </ItemTemplate>
    </telerik:GridTemplateColumn>


Since I'm clicking on the LinkButton the Sort Image is not showing up, Is there anyway I can make the Sort Image appear the way I'm doing this custom sorting?

Thank you.
Min-Jie
Top achievements
Rank 1
 answered on 30 Jul 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?