Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
63 views
In my asp.net solution i am trying to use Listbox drag and drop capabilyties (like in this example : http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/draganddrop/defaultcs.aspx). But the problem ive got now is that drag and drop doesnt work. instead of draging its marking items... i tryed to copy html directly to my page and it still doesnt work. any ideas what can be wrong?
Timothi
Top achievements
Rank 1
 asked on 12 Apr 2012
2 answers
123 views

I have a couple of dropdownlists on my forTemplate but the fucntionality I need is the following.  On Insert I need them to be avialable to pick data, but on Edit mode I want to disable them so that they cannot mess with them becuase they are not editable in edit mode.  i thought the follwoing code would work but appears not.  On insert mode or what i thought was insertmode it fills the ddl and it works for soem reason, but on edit or insert it disables my dropwdownlists. 

Protected Sub myPOGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myPOGrid.ItemDataBound
       If (TypeOf e.Item Is IGridInsertItem AndAlso e.Item.IsDataBound) Then
           Dim gr As DropDownList = DirectCast(e.Item.FindControl("ddlPOFund"), DropDownList)
           sql = "Select intFundID, strPGMCDnum + ' \ ' + CASE WHEN intSourceId = 1 then 'FEDERAL' ELSE 'STATE' END + ' \ ' + strEorNum FUND from Drat_fundSource where bitArchive IS NULL"
           gr.Items.Add(New ListItem("Pick Funding Source", "0"))
           buildDD(sql, gr)
       End If
       If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
           Dim editedItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
           Dim PoFund As DropDownList = DirectCast(editedItem.FindControl("ddlPOFund"), DropDownList)
           Dim FundS As DropDownList = DirectCast(editedItem.FindControl("ddlFundSource"), DropDownList)
           PoFund.Enabled = False
           FundS.Enabled = False
       End If
   End Sub
Kevin
Top achievements
Rank 1
 answered on 12 Apr 2012
1 answer
184 views
We have a timer event that asks to extend the session using a radconfirm dialog. However, it's possible that some other event may have caused a radconfirm to be currently displayed. We've had difficulty getting the two to not overlap (e.g. the title bar message gets changed for the wrong one, content gets mixed). So, the approach we are currently trying to pursue is to force a close of the previously displayed dialog before displaying the next one.

It would be nice if radconfirm returned a handle to the dialog then all we would need to do is:
var dlg=radconfirm(...);
....
dlg.close();

But, no such luck. Is there some jScript selector we can use to get the dialog?

More detail:
The basic html layout we are using is:
<ConfirmTemplate>
	<div id="dlg1" style="display:none">
		Dialog content
	</div>
	<div id="dlg2" style="display:none">
		Dialog content
	</div>
</
ConfirmTemplate>

Where just before the call to radconfirm we set the display to the appropriate dialog.
Marin Bratanov
Telerik team
 answered on 12 Apr 2012
17 answers
368 views
Hi, i've successfully created tests in webui studio that i have exported to vs2010, and can see the test in the solution, however trying to create a load test, in vs, it does not see the .aii file as a suitable test to run.  Therefore i can create the load test framework, but cannot add any webui tests into it, is this possible or not?

Kind Regards

David
Kate
Telerik team
 answered on 12 Apr 2012
19 answers
587 views
Is there any way to have GridDateTimeColumn filtering work without having to custom code anything?  I get the nice datepicker, but it never works out of the box (I assume becasue of the time being part of the datetime type?)


sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 12 Apr 2012
3 answers
383 views
Hi!

We have a grid that contains a date-time column where we are displaying hours and minutes. We want to use only the date portion of the selected value for our filter, and on the SQL side of this, we are able to parse the value using the C# code below.

The problem we are seeing is that when we stick the data back into the grid, no rows are showing. We suspect the grid is filtering the data still on the date-time value as designated in the aspx code. Is there a way to accomplish this?

Thanks!

<telerik:GridDateTimeColumn DataField="AssignDate" DataFormatString="{0:MM/dd/yyyy hh:mm tt}"
                                HeaderText="Assign Date" PickerType="DatePicker" SortExpression="AssignDate"
                                UniqueName="AssignDate" />
 
 
 
 
if (filter.Contains("[AssignDate]"))
            {
                int index = filter.IndexOf("([AssignDate]");
                int firstQuote = filter.IndexOf("'", index);
                int lastQuote = filter.IndexOf("'", firstQuote + 1);
 
                string stringToExcise = filter.Substring(index, lastQuote - index + 2);
                string dateToParse = filter.Substring(firstQuote + 1, lastQuote - firstQuote - 1);
                DateTime dateTime = DateTime.Parse(dateToParse);
 
                assignDate = "(convert(varchar(10), [AssignDate], 101) = '" + dateTime.Month.ToString("0#") + "/" + dateTime.Day.ToString("0#") + "/" + dateTime.Year + "')";
 
            }


Michael O'Flaherty
Top achievements
Rank 2
 answered on 12 Apr 2012
4 answers
121 views
Hi,

I have a RadComboBox nested inside of a RadContextMenu.  When I select/change an option from the combobox, the combobox selects the item correctly, but then the RadContextMenu disappears as well.  How can I force the RadContextMenu to remain open after this selection?

Thanks for the help.

Steve
Steve
Top achievements
Rank 1
 answered on 12 Apr 2012
3 answers
308 views
I've been battling the best way to handle filters on a grid date field to get them to work properly.  The date/time is coming from an MSSQL database which the date fields have been populated with date and time.  I do not currently have anything special for the field column in the grid:

 

<telerik:GridDateTimeColumn datafield="ExportedDate" DataFormatString="{0:MM/dd/yyyy}" datatype="System.DateTime"
        
headertext="Exported"  sortexpression="ExportedDate" uniquename="EXPORTED" FilterControlWidth="75px">

 

 

    <HeaderStyle HorizontalAlign="Center" Width="90px"/>

 

 

    <ItemStyle HorizontalAlign="Right" Width="90px"/>

 

 

</telerik:GridDateTimeColumn>

What I have found is that the date will not work correctly on fields unless the data coming from the database has the time essentially set  to 00:00:00.  All the filtering is done by the specified date with the time set to midnight.

For example: if my date field from the database is 3/25/2009 06:30:12 and I'm filtering on the date 3/25/2009, then the following results ocurr:
        Comparison                        Expected Result        Actual Result
        --------------------------          -----------------------     --------------------
        EqualTo                              Match                        No match
        NotEqualTo                         No Match                   Match
        GreaterThan                       No Match                   Match
        LessThan                            No Match                   No Match
        GreaterThanOrEqualTo      Match                        Match
        LessThanOrEqualTo           Match                        No Match

As you can see, only 2 comparisons return results as expected.  It all stems around the issue with the time component being used in the comparison.

Work arounds include adding custom filtering, changing every database access procedure or call to remove the time component in the results, and limiting the filter functions to only what works.

None are very attractive when considering the extent of work involved.  This system that the Telerik controls are used was initially developed 10 years ag0 and has grown to have at one site alone, 300,000 registered users, hundreds of web pages, thousands of queries, and, needless to say, an extremely large amount of accumulated data.

I believe I shouldn't have to add code to make the date filter work as logically expected.  The filtering logic should automatically strip off the TimeOfDay and not be used in the comparisons.  Because the System.DateTime has a resolution down to the milliseconds, anyone searching for any equality based on the date will not find a match.  This is especially true when picking a date from the calendar icon or when typing in a date; you do not specifiy the time and it is implied to be midnight.

Any assistance, comments, or improvements is greatly appreciated.

Ed Lamprecht

Michael O'Flaherty
Top achievements
Rank 2
 answered on 12 Apr 2012
2 answers
44 views
How or when can we get feedback/progress for uploaded files in the media manager. At present, when the upload button is clicked, it does not appear to do anything to the user, and you kind of have to hope that it is uploading. Is there a way around this, or will some feedback/progress be added to the control in the near future?
Quintin
Top achievements
Rank 1
 answered on 12 Apr 2012
1 answer
94 views
Problem:
I use a Dynamic RadComboBox having EnableLoadOndemand feature. After entering the search value , I tab out to go to the next control. Sometimes when I tab out, the drop down does not close .

Other Details: I tried using OnClientBlur event to close Dropdown, does not work.

It appears that when the RadComboBox_ItemsRequested server event is being processed, the key stroke (in my case tab) is not being grabbed/recognized. At all other times , the drop down closes.

Code:
  Public Class TempComboBox
        Inherits RadComboBox
  
        Const BACK_SPACE = "8"
  
        Private Sub CompanyInfoComboBox_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
  
            Dim oHeaderTemplate
            Dim oItemTemplate
  
            Me.Height = 200
            Me.EnableTextSelection = True
            Me.MarkFirstMatch = False
            Me.EnableViewState = True
            Me.DropDownWidth = 500
  
            Me.OnClientDropDownOpening = "DropDownOpening"
            Me.EmptyMessage = "Type  Code"
            Me.EnableLoadOnDemand = True
            Me.ShowMoreResultsBox = False
            Me.ShowDropDownOnTextboxClick = True
            Me.HighlightTemplatedItems = True
            Me.OnClientItemsRequested = "HighlightItem"
            Me.OnClientItemsRequesting = "HandleKeyPress"
            Me.OnClientKeyPressing = "HandleTab"
            Me.OnClientFocus = "HandleOnFocus"
            Me.CloseDropDownOnBlur = True
            Me.ChangeTextOnKeyBoardNavigation = True
            Page.ClientScript.RegisterStartupScript(Me.GetType, "TelerikHandleKeyPressScript", TelerikHandleKeyPressScript())
            Page.ClientScript.RegisterStartupScript(Me.GetType, "TelerikHandleTabScript", TelerikHandleTabScript())
            Page.ClientScript.RegisterStartupScript(Me.GetType, "TelerikDropDownOpeningScript", TelerikDropDownOpeningScript())
            Page.ClientScript.RegisterStartupScript(Me.GetType, "TelerikHandleOnFocusScript", TelerikHandleOnFocusScript())
            Page.ClientScript.RegisterStartupScript(Me.GetType, "TelerikHighlightItemScript", TelerikHighlightItemScript())
  
            AddHandler Me.ItemsRequested, AddressOf RadComboBox_ItemsRequested
  
            oHeaderTemplate = New MasterHeaderTemplate
            oItemTemplate = New MasterItemTemplate
            Me.Width = 75
  
            Me.HeaderTemplate = oHeaderTemplate
            Me.ItemTemplate = oItemTemplate
  
        End Sub
  
  
        Function TelerikHighlightItemScript() As String
            Dim sJscript As String = "<script language=""javascript""> " & _
            "            function HighlightItem(combo,e){" & _
            "           var item=combo.get_items().getItem(0);  " & _
               "           if (item){  " & _
                "           if (item.get_value() != '0'){  " & _
            "           item.highlight() ;  " & _
           "           } } " & _
        "       }  </script>"
  
            Return sJscript
        End Function
  
        Function TelerikDropDownOpeningScript() As String
            Dim sJscript As String = "<script language=""javascript""> " & _
            "            function DropDownOpening(combo,e){" & _
             "           combo.requestItems(combo.get_text(), false);  " & _
         "       }  </script>"
  
            Return sJscript
        End Function
  
        Function TelerikHandleTabScript() As String
            Dim sJscript As String = "<script language=""javascript""> " & _
            "            function HandleTab(combo,e){" & _
             "           if (event.keyCode == 9) { " & _
               "           combo.hideDropDown(); " & _
                "           if (combo.get_value() == ''){" & _
                 "           if (combo.get_items().get_count()  > 0){" & _
             "                 combo.set_value(combo.get_text()); } else { combo.set_value(combo.get_text()); } } }" & _
"       }  </script>"
  
            Return sJscript
        End Function
  
        Function TelerikHandleOnFocusScript() As String
            Dim sJscript As String = "<script language=""javascript""> " & _
            "            function HandleOnFocus(combo,e){" & _
                    "         var attrib = combo.get_attributes().getAttribute('OriginalFieldID');      " & _
                    "         var firstCombo = $find('FilterType_'+attrib+'');      " & _
                    "       if (firstCombo){       " & _
                     "        combo.requestItems(firstCombo.get_value()+'_FilterType', false); }       " & _
         "       }  </script>"
  
            Return sJscript
        End Function
  
        Function TelerikHandleKeyPressScript() As String
            Dim sJscript As String = "<script language=""javascript""> " & _
            "            function HandleKeyPress(combo,e){" & _
            "            try {if (keypressed == 9)  { combo.hideDropDown(); " & _
            "            }} catch(e) {}" & _
           "            try {if (keypressed == 8)  { var context = e.get_context();" & _
            "           context[""keyPressed""] = keypressed+''; }} catch(e) {}" & _
            "       }  </script>"
  
            Return sJscript
        End Function
  
  
        Protected Sub RadComboBox_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
  
  
            If (e.Context.TryGetValue("keyPressed", BACK_SPACE)) Then
                'do nothing
            Else
                If e.Text.Trim.Length > 3 Then
                    GetDataIntoCombo(e.Text)
                End If
            End If
        End Sub
  
  
        Public Sub GetDataIntoCombo(ByVal txtCode As String)
            Dim dt As DataTable = GetComboBoxDataFROMDATABASE(txtCode)
  
            If dt.Rows.Count = 0 Then
                Dim item As New RadComboBoxItem()
                Dim hl As New HyperLink()
                hl.ID = "hl"
                hl.Text = " There were no matches. Please click on this link for further information."
  
                item.Value = "0"
                item.DataBind()
                Me.Items.Add(item)
  
                item.DataBind()
  
            ElseIf dt.Rows.Count < 51 Then
                SetDisplayItemsForRefInfo(dt)
  
                Dim item As New RadComboBoxItem()
  
                item.Text = String.Empty
                item.Value = "0"
                Me.Items.Add(item)
            Else
  
                Dim item As New RadComboBoxItem()
  
                item.Text = "Too many codes have been found. Please enter more characters."
                item.Value = "0"
  
                Me.Items.Add(item)
  
            End If
  
            Me.DataBind()
        End Sub
  
  
  
        Private Sub SetDisplayItemsForRefInfo(ByVal dt As DataTable)
            For Each dataRow As DataRow In dt.Rows
                Dim item As New RadComboBoxItem()
                Dim Code As String = String.Empty
                item.Text = DirectCast(dataRow("Code"), String)
                item.Value = dataRow("Code").ToString()
  
                Dim Name As String = String.Empty
  
  
                Try
                    Name = DirectCast(dataRow("Name"), String)
                    Code = DirectCast(dataRow("Code"), String)
  
                Catch ex As Exception
  
                End Try
  
                item.Attributes.Add("Code", Code.ToString)
                item.Attributes.Add("Name", Name.ToString())
  
  
                Me.Items.Add(item)
                item.DataBind()
  
  
            Next
        End Sub
  
  
  
        Private Function GetComboBoxDataFROMDATABASE(ByVal UserText As String) As DataTable
            Try
                'code to get from DB
                Return New DataTable
            Catch ex As Exception
                Return Nothing
  
            End Try
        End Function
  
  
    End Class
Ivana
Telerik team
 answered on 12 Apr 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?