Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
334 views
I'm trying to have a user be able to hover over the week and it select the week instead of selecting the day.   I'm trying to do this without the UseRowHeadersAsSelectors.  Then take the selected week range for the SelectedWeek. 

I saw this post but it's over 3 years old and it is WinForms so is there a work around for asp.net ajax?

http://www.telerik.com/community/forums/winforms/calendar-and-datetimepicker/row-selection-only.aspx

Thanks in advance
Sonia
Top achievements
Rank 1
 answered on 09 Jul 2014
2 answers
159 views
Hi i am using this code  
it is working fine if i set MaxDate or MinDate time as 9:00,5:00,(One hour Difference)
It doesn't work if i set Max time or MinTime in minutes  (9:45) (Manual Entry )

                   var maxDate = new Date(reqJobDate[0].EstEndDate);
                    var minDate = new Date(reqJobDate[0].StartDate);
                    
                    rdpWOItemStartDate.set_maxDate(new Date(maxDate.getTime()));
                    rdpWOItemStartDate.set_minDate(new Date(minDate.getTime()));
                    rdpWOItemEndDate.set_maxDate(new Date(maxDate.getTime()));
                    rdpWOItemEndDate.set_minDate(new Date(minDate.getTime()));
                    rdpWOItemStartDate.set_selectedDate(new Date(rdpWOItemStartDate.get_minDate()));
                    rdpWOItemEndDate.set_selectedDate(new Date(rdpWOItemEndDate.get_maxDate()));
Phanindra
Top achievements
Rank 1
 answered on 09 Jul 2014
1 answer
248 views
I think I found a possible bug with the Drop Down Tree and setting the default selected value.  I followed this link I created a few months ago and just found this issue now.

I have a tree that looks like this:
- Grades          //ID: 0, Parent: null, Value: 0
-- Random          //ID: 1, Parent: 0, Value: 2
--- J          //ID: 2, Parent: 1, Value: 7
--- Prime          //ID: 3, Parent: 1, Value: 8
--- A          //ID: 4, Parent: 1, Value: 9
--- 2 & Better          //ID: 5, Parent: 1, Value: 10
--- 2          //ID: 6, Parent: 1, Value: 11
--- Select          //ID: 7, Parent: 1, Value: 12
-- Fixed          //ID: 8, Parent: 0, Value: 1
--- J          //ID: 9, Parent: 8, Value: 1
--- Prime          //ID: 10, Parent: 8, Value: 2
--- A          //ID: 11, Parent: 8, Value: 3
--- S          //ID: 12, Parent: 8, Value: 4
--- Econ          //ID: 13, Parent: 8, Value: 5

As you can see, there are duplicate text (I only allow the selection of the child elements - "Grades", "Random" and "Fixed" are not allowed as they are the root or are types).  So if I have:
RadDropDownTree.SelectedValue = "2";
RadDropDownTree.SelectedText = "Prime"
and for some reason the "Prime" under "Random" is selected, when the "Prime" under "Fixed" SHOULD be selected.  Does that make sense?

It appears that the SelectedText property selects the first text value that matches the input and does not respect the SelectedValue.  Is there a way I can fix this?


Shinu
Top achievements
Rank 2
 answered on 09 Jul 2014
1 answer
126 views
Hi.

I'm noticing something weird happening with a telerik grid.  Short version is that when I filter it, I'm seeing an error that indicates there are no rows to display, despite me being able to see in the code that there is data there...

I have filter controls outside of the grid, it's a big page so I was trying to simplify it for my users

my drop down looks like this, it is databound in the code behind

<telerik:RadComboBox ID="ddlCompany" runat="server" Visible="False" AutoPostBack="True" DataValueField="CompanyID"
                       DataTextField="Name" OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged" >
                       <Items>
                       </Items>
                   </telerik:RadComboBox>

my grid looks like this 

    <telerik:RadGrid ID="productionSearchResults" runat="server" AutoGenerateColumns="false" CellPadding="0" Skin="Windows7" EnableLinqExpressions="false" Width="100%"
                AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" GridLines="None" PageSize="100" OnItemDataBound="productionSearchResults_ItemDataBound"
                AllowCustomPaging="true">
                <HeaderContextMenu EnableAutoScroll="True" />
                <HeaderStyle Font-Names="Verdana" />
                <AlternatingItemStyle Font-Names="Verdana" />
                <ItemStyle Font-Names="Verdana" />
                <PagerStyle AlwaysVisible="True" />
                <GroupingSettings CaseSensitive="false" />
                <ClientSettings>
                    <ClientEvents OnGridCreated="SizeGridToVerticalContent" />
                    <Scrolling UseStaticHeaders="true" AllowScroll="true" FrozenColumnsCount="0" />
                </ClientSettings>
 
                <MasterTableView CommandItemDisplay="Top" Width="98%">
                    <CommandItemSettings
                        ShowAddNewRecordButton="false" ShowRefreshButton="false"
                        ShowExportToWordButton="true" ExportToWordText="Export results to Word"
                        ShowExportToExcelButton="true" ExportToExcelText="Export results to Excel"
                        ShowExportToCsvButton="false" ExportToCsvText="Export results to CSV"
                        ShowExportToPdfButton="false" ExportToPdfText="Export results to PDF" />
 
                    <Columns>
                        <telerik:GridBoundColumn Visible="False" DataField="SessionID" HeaderText="SID" UniqueName="SessionID" AllowFiltering="false"  AllowSorting="false" >
                            <HeaderStyle BackColor="#E3E9DC"></HeaderStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn Visible="False" DataField="Company" HeaderText="Company" UniqueName="Company" AllowFiltering="false"   AllowSorting="false"  >
                            <HeaderStyle BackColor="#E3E9DC"></HeaderStyle>
                        </telerik:GridBoundColumn>
<!-- other columns go here -->
  <telerik:GridTemplateColumn HeaderText="Ship List"  AllowFiltering="false" UniqueName="ShipList"   >
                            <HeaderStyle BackColor="#F2EDB7"></HeaderStyle>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>


when the user selects a value in the list the following is called

Protected Sub ddlCompany_SelectedIndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs) Handles ddlCompany.SelectedIndexChanged
      Dim ddl As RadComboBox = CType(sender, RadComboBox)
 
      ddl.Items.FindItemByValue(e.Value).Selected = True
      CompanyID = CInt(e.Value)
      Dim filterExpression As String
      filterExpression = "([Company]='" + e.Value + "')"
      productionSearchResults.MasterTableView.FilterExpression = filterExpression
      productionSearchResults.Rebind()
  End Sub

this should go away and call the need data source function (which it does) then rebind the grid with the filtered data set.  But when it gets to the rebinding, I'm not seeing any data items, just filter items.... I can clearly see that there is data there, it just doesn't bind.

here's the need data source function
Private Sub productionSearchResults_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles productionSearchResults.NeedDataSource
 
      pageIndex = productionSearchResults.CurrentPageIndex
      Controller.Page(Me)
      productionSearchResults.DataSource = Productions
      productionSearchResults.MasterTableView.VirtualItemCount = totalCount
      productionSearchResults.VirtualItemCount = totalCount
  End Sub

and my item databound

Protected Sub productionSearchResults_ItemDataBound(sender As Object, e As GridItemEventArgs)
      Dim sImgX As String
      Dim sImgCheck As String
 
      sImgX = ResolveUrl("~/images/x.gif")
      sImgCheck = ResolveUrl("~/images/check.gif")
 
 
      If TypeOf e.Item Is GridDataItem Then
 
          Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
 
          If dataItem("ProductionNotes").Text.Contains("NEEDS REVIEW") Then
              e.Item.BackColor = Color.Pink
          End If
          dataItem("SessionID").Text = String.Format("<a href=""{0}"">{1}</a>", _
                                       BuildPageUrl("production/ProductionList.aspx", NavLevel.Session, Integer.Parse(dataItem("SessionID").Text)), dataItem("SessionID").Text)
 
          If Len(PMSession.SID) = 0 Then
              dataItem("shipList").Text = String.Format("<a href=""{0}?ProductionID={1}"" target=_Blank><img src=""{2}"" border=0></a>", _
                                                         BuildPageUrl("reports/Session/SessionShipList.aspx", NavLevel.Session, iSID), ProductionID _
                                                         , ResolveUrl("~/images/report2.gif"))
 
          Else
              dataItem("ProductionID").Text = String.Format("<a href=""{0}?id={1}&cmd=2"">{2}</a>", BuildPageUrl("production/ProductionDetail.aspx"), dataItem("ProductionID"), iSID)
              dataItem("shipList").Text = String.Format("<a href=""{0}?ProductionID={1}"" target=_Blank><img src=""{2}"" border=0></a>", _
                                                         BuildPageUrl("reports/Session/SessionShipList.aspx"), ProductionID, ResolveUrl("~/images/report2.gif"))
          End If
 
 
      Else
      End If

any ideas?

Adam Steckel
Top achievements
Rank 1
 answered on 09 Jul 2014
2 answers
124 views
Hello,

I am trying to override the POST method of the client side functionality on a ListView, but I cannot figure out a way to do it, since apparently there is no event in ClientEvents that's triggered once the items are being requested.
My goal is to pass a parameter to the service.

As an example, I am pointing out the functionality available in RadComboBox, called "OnClientItemsRequesting", in which I am able to get the context and set a custom property, as easily as:

function CountyItemsRequesting(sender, eventArgs) {
    var context = eventArgs.get_context();
    context.District = $find("<%= ddlDistrict.ClientID %>")._value;
}


My question is:
Is there any way at all to pass a parameter as POST in the ListView control?

Thank you in advance!


Jorge
Top achievements
Rank 1
 answered on 09 Jul 2014
1 answer
239 views
Can someone post a complete example of Q2 2011 for making this work .... I have the other events working including OnClientSelectedIndexChanged, OnClientItemsRequesting, OnClientDropDownClosing

My problem is the OnClientItemDataBound event does not seem to be firing ... I have a somewhat 'different' scenario in that the events are wired up in the code behind and the script as well so 

so in the page load

void Page_Load()
{
      if(!this.IsPostBack)
      {
            mycombobox.OnClientItemDataBound = "mycombobox_OnClientItemDataBound"
      }
   
      RegisterScripts();
}


then register scripts looks like
private void RegisterScripts()
{
      StringBuilder sb = new StringBuilder()
      sb.AppendLine("function mycombobox_OnClientItemDataBound(sender, args){console.log(sender);}")
      ScriptManager.RegisterStartupScript(Page, Page.GetType(), "name", sb.ToString(), true);
}

the 'binding code looks like this'
[item generation code]
mycombobox.DataSource = items;
mycombobox.DataBind()





Princy
Top achievements
Rank 2
 answered on 09 Jul 2014
6 answers
212 views

Hi,

We have Asp.net 4.5 and using Telerik WebUI version 2012.3.1308.45.
Using telerik:RadScriptManager as our main script manager.

Page is loading very slow and We got waiting for ajax.aspnetcdn.com.. message.

How can we create local fall back for JQuery and other JavaScript files required by ajax toolkit?


Best Regards,

Damodar

Dimitar Terziev
Telerik team
 answered on 09 Jul 2014
4 answers
349 views
Hello,

Is there a way to replicate the ClearCheckedItems() method on the client side for a radcombobox.

I am able the uncheck all check box using javascript, but if after I hit a button and code to the server code, the Checkbox are still considered checked. Also, if I clear the checked items using the javascript and select other items after, the counter will display a wrong
number of selected items

function radComboBoxLocationSelectedIndexChanged(item) {
  
resetRadComboboxWithCheckBox('<%=radComboBox1.ClientID %>');
  
}
  
function resetRadComboboxWithCheckBox(comboBoxClientId) {
  
var d = $find(comboBoxClientId);
  
d.set_text("");
  
d.clearSelection();
  
var items = d.get_items();
  
var itemsCount = items.get_count();
  
for (var itemIndex = 0; itemIndex < itemsCount; itemIndex++) {
  
var item = items.getItem(itemIndex);
  
var chk = getItemCheckBox(item);
  
if (chk != null) {
  
chk.checked = false;
  
}
  
}
  
}
  
 
  
 
  
 
  
function getItemCheckBox(item) {
  
//Get the 'div' representing the current RadComboBox Item. 
  
var itemDiv = item.get_element();
  
//Get the collection of all 'input' elements in the 'div' (which are contained in the Item). 
  
var inputs = itemDiv.getElementsByTagName("input");
  
for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) {
  
var input = inputs[inputIndex];
  
//Check the type of the current 'input' element. 
  
if (input.type == "checkbox") {
  
return input;
  
}
  
}
  
}


Any Ideas?

Thanks.
Gowtham
Top achievements
Rank 1
 answered on 09 Jul 2014
6 answers
294 views

I would like to use the file explorer to look at the files that I upload.  here is the issue I am running into.  I only wnat to show the files for a person that are part of that record.  So everyone has a record.  If they upload files I put the file names in the database along with the ID of person whom uploaded them.  Is there a way to only load the files in the file explorer that belong to that person whom uploaded them.  Right now I am trying to view them as links and not working so well.
So is there a way to fill the fileExplorer with just the files I am picking in the sql statement.

Current method not working so well as link buttons caus ethey so not persist well in radwindow.
 
  sql = "Select strUrl from PriorServiceUpload where intPriorServiceId = " & myDataTable.Rows(0)(0)
 
            myDataTable = New DataTable
            myDataTable = getReader(sql)
 
            If myDataTable.Rows.Count > 0 Then
                Dim attach As New LinkButton
 
                For Each row As DataRow In myDataTable.Rows
                    attach.Text = row(0) & "<br>"
                    attach.CausesValidation = False
                    attach.CommandArgument = row(0)
                Next
 
                AddHandler attach.Click, AddressOf GetattachLink
                phAttach.Controls.Add(attach)
            End If



Vessy
Telerik team
 answered on 09 Jul 2014
1 answer
186 views
I have a file explorer on my page that is filtering files based on a sql pull.  However what happens is that I use the async uploader to upload files then show in only grid view in the file explorer.  When I post back though nothing show in the file explorer, it says no files avialable even though I uploaded files or there where previous files in there.






Protected Sub lnkSubmitRequest_Click(sender As Object, e As EventArgs) Handles lnkSubmitRequest.Click
 
Code to submit the page
 
This statment reloads all the information on the page if its changed from the database
  LoadPriorService(Convert.ToInt32(HFRecruit.Value))
 End If
 
 
 Private Sub LoadRecruit(ByVal recruitId As Integer)
 
Reload the page
 
This statement is where the FileExplorer is located on the LoadPriorService but I have no command to actually reload the control on a postback.
  LoadPriorService(recruitId)
        Else
            ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "NoData();", True)
        End If
 
 
 
  Private Sub LoadPriorService(ByVal recruit As Integer)
        ClearPriorSvc()
 
        sql = "Select intPriorServiceId, intBranchServiceId, dtDischarge, bitSF180, bitStaterequest, bitArpercen, bitredd, strNotes, dtSubmitted, submittedBy, dtCompleted, CompletedBy, strRocComments " _
            & "from vw_PriorService where intRecruitId = " & recruit
 
        myDataTable = New DataTable
        myDataTable = getReader(sql)
 
        If myDataTable.Rows.Count > 0 Then
            HFPriorService.Value = myDataTable.Rows(0)(0)
            ddlBranchService.SelectedValue = myDataTable.Rows(0)(1)
            txtDtDischarge.Text = myDataTable.Rows(0)(2)
 
            If myDataTable.Rows(0)(3) = "1" Then
                cbSF180.Checked = True
            End If
 
            If myDataTable.Rows(0)(4) = "1" Then
                cbState.Checked = True
            End If
 
            If myDataTable.Rows(0)(5) = "1" Then
                cbArpercen.Checked = True
            End If
 
            If myDataTable.Rows(0)(6) = "1" Then
                cbREDD.Checked = True
            End If
 
            txtPriorNotes.Text = myDataTable.Rows(0)(7)
            lblSubmittedON.Text = myDataTable.Rows(0)(8)
            lblSubmittedBy.Text = myDataTable.Rows(0)(9)
            lblCompletedOn.Text = myDataTable.Rows(0)(10)
            lblCompletedBy.Text = myDataTable.Rows(0)(11)
            txtRocNotes.Text = myDataTable.Rows(0)(12)
            lnkSubmitRequest.Enabled = True
        Else
            lblSubmittedON.Text = "None Submitted"
            lblSubmittedBy.Text = "None Submitted"
        End If
    End Sub
 
 
Here is the code that loads the fileExplorer, it seems to only load on the initial page loads and bugs out on postback.
 
  Private Sub radFileExplorer_ExplorerPopulated(sender As Object, e As RadFileExplorerPopulatedEventArgs) Handles radExplorer.ExplorerPopulated
 
        'If HFPriorService.Value > "" Then
        sql = "Select strUrl from PriorServiceUpload where intPriorServiceId = " & HFPriorService.Value
 
        myDataTable = New DataTable
        myDataTable = getReader(sql)
 
        If myDataTable.Rows.Count > 0 Then
            If e.ControlName = "grid" Then
                Dim items As List(Of FileBrowserItem) = e.List
                Dim i As Integer = 0
                For Each row As DataRow In myDataTable.Rows
                    While i < items.Count
                        If Not items(i).Name.Contains(row(0)) Then
                            items.Remove(items(i))
                        Else
                            i += 1
                        End If
                    End While
                Next
            End If
        End If
        'End If
    End Sub
Vessy
Telerik team
 answered on 09 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?