Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
208 views
Hi All,

I have C# code-behind RadGrid that uses SQLDataSource and Databinds in NeedDataSource();

I have set
radGrid.AllowSorting = true;
radGrid.MasterTableView.AllowMultiColumnSorting = true;
radGrid.MasterTableView.AllowNaturalSort = true;

I have also set AllowSorting= true; on the columns themselves, but nothing seems to work.  The columns refuse to sort, even though I can see the Arrow Up, Arrow Down and revert to default.  Can you please help?

Thanks,
Mark
Princy
Top achievements
Rank 2
 answered on 22 Nov 2013
1 answer
142 views
Hi,
We have a RadDatePicker control. User can enter/edit manually date in the associated date input box. Then on a save button click we need to perform some validation. The problem is when user manually edits the date and presses enter key while still in the date text box, we do not get the selected date from the raddatepicker control. We need this new date value in the validation function. How can we resolve this ?
Princy
Top achievements
Rank 2
 answered on 22 Nov 2013
3 answers
94 views
Hi ,

I need to show the count along with the name of the bound column.The grid has only master table view and the bound column is getting the values of a list.
ex:
Category:Doc1(2) 
Catgeory:Doc2(4)
Categroy:Doc3(5).....

I tried with Pre-render event but it is adding the count in the child items only. please help me to get the count of the values of the bound column.
Below
<ad:adGrid ID="grdAttachments" runat="server" Width="100%" AllowPaging="false"
    GroupingEnabled="true" ShowGroupPanel="false" MasterTableView-GroupsDefaultExpanded="true" >
        <MasterTableView  HierarchyLoadMode ="Client" >
        <Columns>
    <tel:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Category" />
    <tel:GridHyperLinkColumn UniqueName="Subject" DataTextField="Subject" HeaderText="Subject"
    DataNavigateUrlFormatString="ts/disp.aspx?id={0}" DataNavigateUrlFields="ID"
    SortExpression="Subject">
    <ItemStyle CssClass="gridhyperlink" />
    </tel:GridHyperLinkColumn>
<tel:GridHyperLinkColumn UniqueName="FileName" DataTextField="FileName" HeaderText="Attachment"
DataNavigateUrlFormatString="{0}" DataNavigateUrlFields="AttachmentUrl" SortExpression="FileName"
        Target="_blank">
<ItemStyle CssClass="gridhyperlink" />
</tel:GridHyperLinkColumn>
<tel:GridDateTimeColumn UniqueName="CreatedDate" DataField="CreatedDate" HeaderText="Date" />
<tel:GridBoundColumn UniqueName="CreatedBy" DataField="CreatedBy" HeaderText="Author" />
    </Columns>
<GroupByExpressions>
<tel:GridGroupByExpression>
    <SelectFields>
<tel:GridGroupByField FieldName="Name" FieldAlias="Category"  />
</SelectFields>
<GroupByFields>
<tel:GridGroupByField FieldName="Name" />
</GroupByFields>
</tel:GridGroupByExpression>
    </GroupByExpressions>
</MasterTableView>
   <ClientSettings AllowExpandCollapse="true">
   </ClientSettings>
</ad:adGrid>
----------------------------------------------------------------
 
 
 
 
Private Sub grdAttachments_NeedsDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles grdAttachments.NeedDataSource
        Dim types As ADAttachmentTypeList = CMClient.GetAttacntTyps()
        Dim attachments = types.Aggregate(
         New List(Of Object)(),
         Function(acc As List(Of Object), type As ADAttachmentType)
             Dim typeAttachments As ADAttachmentList = Document.GetAttachments(type.ID)
             typeAttachments.Aggregate(
              acc,
              Function(acc2 As List(Of Object), attachment As ADAttachment)
                  Dim extension = attachment.Extension.ToLower()
                  Dim navigationUrl As String = String.Empty
 
                  If CurrentTADClient.CCV Then
                      navigationUrl = String.Format("ts/view.aspx?id={0}&path={1}&aid={2}", attachment.Document.ID, attachment.FileName, attachment.ID)
                  ElseIf EnableCommentsWithAttachments Then
                      navigationUrl = String.Format("reviews/dispyReadOnlyOpt.aspx?id={0}&type=ATTACHMENT&path={1}&aid={2}", attachment.Document.ID, attachment.FileName, attachment.ID)
                  Else
                      If (extension = "docx" _
                       OrElse extension = "doc" _
                       OrElse extension = "dotx" _
                       OrElse extension = "dot" _
                       OrElse extension = "rtf" _
                      ) Then
                          navigationUrl = String.Format(
                           "rev/dispyreadonly.aspx?id={0}&type=ATTACHMENT&path={1}",
                           attachment.Document.ID,
                           attachment.FileName
                          )
                      Else
                          navigationUrl = attachment.VirtualPath
                      End If
                  End If
 
                  acc2.Add(New With {
                   Key .Name = type.Name,
                 .ID = attachment.ID,
                 .Subject = attachment.Subject,
                 .FileName = attachment.FileName,
                 .CreatedDate = String.Format("{0} {1}", attachment.CreatedDate.ToString(CurrentCulture.DateTimeFormat.ShortDatePattern, CurrentCulture), attachment.CreatedDate.ToString(CurrentCulture.DateTimeFormat.ShortTimePattern, CurrentCulture)),
                 .CreatedBy = attachment.CreatedBy,
                  .AttachmentUrl = navigationUrl
                  })
                  Return acc2
              End Function
             )
             Return acc
         End Function
        )
 
        DirectCast(grdAttachments.Columns(1), GridHyperLinkColumn).DataNavigateUrlFormatString = String.Format("{0}hj/ts/displ.aspx?id={1}0{2}", Captions.VirtualRoot, Chr(123), Chr(125))
 
        grdAttachments.DataSource = attachments.ToArray()
 
         
    End Sub
is the Grid and the Databinding
.Thanks in Advance
Jose
Shinu
Top achievements
Rank 2
 answered on 22 Nov 2013
1 answer
64 views
I have two radio buttons on my aspx page, and when I click one, it does a full page submit. I need to implement Ajax functionality. How can I do that?  

On my html page, I have a reference to the AjaxToolkit. Any suggestion?

The html code is:    

<asp:Panel ID="pnlSelectAllItemsClearAllItems" Visible="true" runat="server" ScrollBars="None">
    <table border="0">
        <tr>
            <td width="50%" style="height:2%;">
        <asp:RadioButtonList ID="rbSelectAllItemsClearAllItems" runat="server" AutoPostBack="true"
            RepeatDirection="Horizontal"  Enabled="true"
            OnSelectedIndexChanged="rbSelectClearAllItems_OnSelectedIndexChanged" >
            <asp:ListItem Value="SelectAllItems">Select All Items</asp:ListItem>
            <asp:ListItem Value="ClearAll">Clear All</asp:ListItem>
        </asp:RadioButtonList>
            </td>
            <td style="text-align: center; height:2%;" width="50%">
                <asp:Button runat="server" Text="Archive Selected Items"
                    ID="btnArchiveSelected" onclick="btnArchiveSelected_Click" />    
            </td>
        </tr>
    </table>
</asp:Panel>
Shinu
Top achievements
Rank 2
 answered on 22 Nov 2013
1 answer
35 views
Hello friends of telerik. I want to pass tha data cells from a row to textboxs by client-side.
I try to follow this tutorial but I only have the same result with the object undefinided. How i can do this? what is the real name of the column?
Here is my code (Don't worry If you can't understand the name, it's on spanish) and a screen shoot of the table.
<telerik:RadGrid ID="dgv_usuarios" runat="server">
    <ClientSettings>
        <Selecting AllowRowSelect="true" />
        <Animation AllowColumnReorderAnimation="true" />
        <ClientEvents OnRowClick="rowUsuario" />
    </ClientSettings>
</telerik:RadGrid>

function rowUsuario(sender, eventArgs) {
      var grid = sender;
      var MasterTable = grid.get_masterTableView(); var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
      var cell = MasterTable.getCellByColumnUniqueName(row, "Nombre");
      alert("Su dato es: " + cell.innerHtml);
}

Princy
Top achievements
Rank 2
 answered on 22 Nov 2013
0 answers
80 views
Hi, I am trying to implement this demo http://demos.telerik.com/aspnet-ajax/tooltip/examples/usingwithimagemap/defaultcs.aspx but the problem is when I am using an image too big. Is there a way to put the imagemap inside some container and make it zoomable?

Thanks.
Julio
Top achievements
Rank 1
 asked on 21 Nov 2013
3 answers
159 views
Hi,

I am working with creating recurring meetings. I don't have any problem creating recurring meeting and editing the series, but when I want to edit the single occurence of the series i am facing many difficulties. My modified subject won't get updated one in AppoinementUpdate event and my appointment gets deleted on updating. I also donno for some reason after my update event is fired , insert event gets fired and it has the updated subject. Not sure whats going on. I need it asap.
Can anyone please suggest what the issue could be?
Thanks in advance.

Regards,
Rakesh
Rakesh
Top achievements
Rank 1
 answered on 21 Nov 2013
2 answers
231 views
Hi!

I am currently using this javascript to alert my user that they didn't fill in a field and to make sure it's filled before clicking the button:

(before you look at this note that I will rewrite the redundancy out of it later, the original script was to check all boxes and if any of them was empty, fire the alert, I just added the color thing)

                function RadButton1_MouseOver(sender, args) {
    var quotevar = document.getElementById("<%=RadComboBox1.ClientID%>");
    var custvar = document.getElementById("<%=rcbCustomer.ClientID%>");
    var empvar = document.getElementById("<%=RadComboBox2.ClientID%>");
    var delvar = document.getElementById("<%=RadComboBox3.ClientID%>");
    var datevar = document.getElementById("<%=RadDatePicker1.ClientID%>");
                    if (quotevar.value == "" || custvar.value == "" || empvar.value == "" || delvar.value == "" || datevar.value == "") {
                        if (quotevar.value == null || quotevar.value == "") {
                            quotevar.style.borderColor = "red";
                        }
                        if (custvar.value == null || custvar.value == "") {
                            custvar.style.borderColor = "red";
                        }
                        if (empvar.value == null || empvar.value == "") {
                            empvar.style.borderColor = "red";
                        }
                        if (delvar.value == null || delvar.value == "") {
                            delvar.style.borderColor = "red";
                        }
                        if (datevar.value == null || datevar.value == "") {
                            datevar.style.borderColor = "green";
                        }
 
                        alert("Please make sure to fill in all fields at the top of the invoice before continuing.");
                    }
}

It works great on all my controls that I'm using except for raddatepicker.

I know that the script is correctly checking the control for empty data because the alert still pops up if it is the only control that isn't populated with data.

Is there some sort of alternative style that I should be changing?

I attached a few pictures.
The first one is with no fields filled in and the script generating the style and pop up correctly on all but the datepicker.
The second one shows that with all the other controls filled in, the alert still fires properly but the border color does not change.

What could it be that is limiting this from working?


Garrett
Top achievements
Rank 1
 answered on 21 Nov 2013
4 answers
169 views
This is a bit of an edge case, so I'll need to explain.

Say you have a scheduler with its time zone set to Central Standard Time (UTC -6) and you create a scheduled appointment. The schedule is set to occur yearly, every first Monday of December. If you choose a start time of 7pm or later, the appointments appear on the day before they should be scheduled.

Here's what I think is happening: The recurrence rule first figures out what dates the first Monday of December are for the next few years. It then converts the time into UTC to store in the database. So 7pm would become 1am. When these appointments are shown on the schedule, it then tries to convert it back to Central Standard Time, however since it's going back before midnight, the day also gets pushed back.

Ultimately the problem is that when the recurrence rule is figuring out the Occurrences property, it first figures out the dates, and THEN adds the converted time, rather than converting the entire date for the time zone.

If this is a known problem or there's any kind of workaround, please let me know. Thanks.
Derek
Top achievements
Rank 1
 answered on 21 Nov 2013
3 answers
131 views
Good afternoon --

I have a drop down list created that has the description as the text and a URL as the value.  I want the user to select an item from the drop down list and redirect them to the URL.  However, the event doesn't fire.  This is what I have on the form:

<telerik:RadDropDownList ID="MUQuickLinks" CssClass="QuickLinks" AutoPostBack="true" DefaultMessage="MU QUICK LINKS" OnSelectedIndexChanged="MUQuickLinks_SelectedIndexChanged" runat="server" TabIndex="1" ToolTip="Jump to a particular subject on our site." DataSourceID="dsQuickLinks" DataTextField="qlDescription" DataValueField="qlLink"></telerik:RadDropDownList>

And this is in the code-behind:

    Protected Sub MUQuickLinks_SelectedIndexChanged(sender As Object, e As DropDownListEventArgs)
        HttpContext.Current.Response.Redirect(e.Value, True)
    End Sub

Again, the event doesn't fire when the user selects an item in the drop down list.  The AutoPostBack simply reloads the page.  I've tried other events like OnItemSelected and the event still doesn't fire.

Any assistance is greatly appreciated.

Thanks,
Michael
Michael
Top achievements
Rank 1
 answered on 21 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?