Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
314 views
Hi,
Trying to find a way to hide the
 <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="Notes"></telerik:GridEditCommandColumn>
if a person doe snot have admin privledges, I see lots of examples for other buttons and controls but so far not this way.

Protected Sub myRadGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound
        If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
            Dim EditFormcmdItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
  
            If checkAdmin() = False Then
                EditFormcmdItem.FindControl("EditCommandColumn").Visible = False
            End If
        End If
    End Sub
Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Apr 2012
12 answers
327 views
Hi,

I am referring the below link,
http://www.telerik.com/help/aspnet-ajax/grid-binding-description-bind-method.html

two way binding at RadGrid, and I am currently migrating the GridView to RaidGrid, which GridView Application was using bind method to DataTable and save it DataBase, You may refer the below link,

http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-binding-to-datatable.aspx

and My question is,

1. ItemUpdated event was not fired, does it support? if not, any alternative solutions?
2. which event can be traced when data has been updated to the DataSource by using the above Two-way Declarative Binding approach?
3. Do we need to explicit update the value from RadGrid to DataSource (e.g DataTable)? for GridView, there is a function call gridView.UpdateRow to upate to DataSource.
4. As I have plenty of logic monitoring the dataTable dataChaning event for data validation, conditional data retrieving,calculation and so, it is painful if bind to DataTable is not working for GadGrid, Any Suggest for me?  

Thanks.
w
Top achievements
Rank 1
 answered on 06 Apr 2012
0 answers
50 views
Hello ,

I am Using the Tabstrip in which I have parent Datalist which also contain the child Datalist,My problem  is it is not working properly after postback can any body give me the code for this sample

Amit
Top achievements
Rank 1
 asked on 06 Apr 2012
1 answer
85 views
I am Using two ascx files in one aspx file
a.ascx
    raddock1
    raddock2
b.ascx
    raddock3
    raddock4

main aspx
radzone 1
radzone2

i want to display raddock1 in radzone2 of aspx
but when i use findcontrol it will return me null

 

Zaheer
Top achievements
Rank 1
 answered on 06 Apr 2012
1 answer
83 views
I have a Multiview calendar which is set by default to show 1 year, in 4 columns and 3 rows.

I have 2 other DatePickers on the page that let the user pick a start and end date.

Based on the range selection in the 2 datepickers, I would like to hide unused months in the Multiview calendar.  For instance, I show 12 months by default in Multiview, but if you select a range of April to August, then I would like to show the first row of 4, but then only 1 month calendar in row 2 - effectively hiding the last 7 months.  All of this to be done dynamically on the server-side.


I can't seem to find a way to do this.  Any one?

Dan
Top achievements
Rank 1
 answered on 06 Apr 2012
4 answers
105 views
Please help. Thanks!
When I use <AdvancedEditTemplate> as below code, the  Recurrencerule in e.ModifiedAppointment.Recurrencerule always is old value in update block:

RadScheduler1_AppointmentUpdate(

 

object sender, AppointmentUpdateEventArgs e)
{

string Recurrencerule=e.ModifiedAppointment.RecurrenceRule

}


<AdvancedEditTemplate>

...... 

<telerik:RadSchedulerRecurrenceEditor ID="RecurrenceEditor1" runat="server">

 

</telerik:RadSchedulerRecurrenceEditor>
....

 

</AdvancedEditTemplate>

What should I modify?

Best regards!

Joyce
Top achievements
Rank 1
 answered on 06 Apr 2012
3 answers
68 views
Hi,

Today we had an interesting problem that I'm hoping you'll be able to help me fix.

One of our clients, using the Rad Editor (ASP.NET), clicked on the Document Manager and the listing displayed no files.

However the folder that was being accessed had 77 files.

Upon trying to find out why they weren't being displayed, I discovered that one of the file names had a non-printable character in it.

So, once I renamed the file the listing of files worked fine.

The question is:
How do I fix the filenames of files being uploaded so that files are not stored on our servers that may contain non-printable characters?
And
Even if they do contain non-printable characters, how do I get the Document Manager to display the folder of files anyway (with or without the offending file)?


Thanks,
Cameron
Cameron
Top achievements
Rank 1
 answered on 05 Apr 2012
1 answer
120 views
So using the RadControl, I think I managed to get it to filter the datetime correctly so it can only do Dates even when times are included in the data source.This is calling the OnItemCommand event for the control.
But, when I do a datasource and a bind(), no results are shown even though the data does exist in the datasource

The control does filtering based on AJAX Requests I believe so how can I follow this convention?
At the end of the day, The data in this scenario is being filtered on the server end and wish to rebind this.

or alternatively, can someone tell me how I can do the date filtering on clientside using the GridDateTimeColumn, so I can obtain the FilterType and the current selected date then finally do a filter?

Thanks
Pavlina
Telerik team
 answered on 05 Apr 2012
6 answers
136 views
I am attempting to apply a date range filter to a GridBoundColumn bound to a DateTime.

<telerik:GridBoundColumn DataField="Created"  FilterControlAltText="Filter Created column"
                    HeaderText="Created" SortExpression="Created" UniqueName="Created">
                     <FilterTemplate>
                     <telerik:RadDatePicker ID="ToCreatedDatePicker" runat="server" Width="85px"
                            MinDate="01-01-2012" DbSelectedDate='<%# EndCreatedDate %>'  ClientEvents-OnDateSelected="ToDateSelected"/>
                        to
                     <telerik:RadDatePicker ID="FromCreatedDatePicker" runat="server" Width="85px" 
                            MinDate="01-01-2000" DbSelectedDate='<%# StartCreatedDate %>' ClientEvents-OnDateSelected="FromDateSelected"/>
<telerik:RadScriptBlock ID="scriptFilterEventDate" runat="server">
                                    <script type="text/javascript">
                                        function FromDateSelected(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            var ToPicker = $find('<%# ((GridItem)Container).FindControl("ToCreatedDatePicker").ClientID %>');
 
                                            var fromDate = FormatSelectedDate(sender);
                                            var toDate = FormatSelectedDate(ToPicker);
 
                                            if (toDate != '') {
                                                tableView.filter("Created", fromDate + " " + toDate, "Between");
                                            }
                                        }
 
                                        function ToDateSelected(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            var FromPicker = $find('<%# ((GridItem)Container).FindControl("FromCreatedDatePicker").ClientID %>');
 
                                            var fromDate = FormatSelectedDate(FromPicker);
                                            var toDate = FormatSelectedDate(sender);
 
                                            if (fromDate != '') {
                                                tableView.filter("Created", fromDate + " " + toDate, "Between");
                                            }
                                        }
 
                                        function FormatSelectedDate(picker) {
                                            var date = picker.get_selectedDate();
                                            var dateInput = picker.get_dateInput();
                                            var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());
 
                                            return formattedDate;
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                </telerik:GridBoundColumn>

When the filter is applied I receive the following error message from javascript console.

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: String was not recognized as a valid DateTime.
Sys.WebForms.PageRequestManager._endPostBackTelerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._parseDeltaTelerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._onFormSubmitCompletedTelerik.Web.UI.WebResource.axd:15
(anonymous function)Telerik.Web.UI.WebResource.axd:6
(anonymous function)Telerik.Web.UI.WebResource.axd:6
Sys.Net.WebRequest.completedTelerik.Web.UI.WebResource.axd:6
_onReadyStateChange

The filter is not applied when this error is received

Any idea what I'm doing wrong here..

Ahmed Ilyas
Top achievements
Rank 1
 answered on 05 Apr 2012
4 answers
121 views
Hi.
Following some examples, I found this:

http://www.telerik.com/community/code-library/aspnet-ajax/general/filtering-range-with-raddatepicker-instances-in-a-custom-filtering-column.aspx

I am trying to filter a data source between 2 selected dates.

I am almost there with the implementation of the solution however the problem is, even when the dates are selected, the SelectedDate on the ItemCommand event is null (Nothing in VB.NET)

any ideas where I have gone wrong?

<telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="DateFilter" SortExpression="DateTime" UniqueName="DateFilter" 
                        AllowFiltering="true" ShowFilterIcon="true" AutoPostBackOnFilter="false" DataType="System.DateTime" 
                        DataField="DateTime" ItemStyle-HorizontalAlign="Left">
  
                        <HeaderStyle Width="90px"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Left" Width="90px"></ItemStyle>
                          
                        <FilterTemplate>
                            <telerik:RadComboBox ID="ddlDateFilter" runat="server" DropDownWidth="200px">   
                                <Items>
                                    <telerik:RadComboBoxItem Text="" Selected="true" />
                                </Items>
                                <ItemTemplate>
                                  
                                    From <telerik:RadDatePicker ID="RadDatePickerFrom" runat="server" onclick="PreventDropDownClose(event);">
                                    </telerik:RadDatePicker>
                                    To <telerik:RadDatePicker ID="RadDatePickerTo" runat="server" onclick="PreventDropDownClose(event);">
                                    </telerik:RadDatePicker>                                    
                                    <asp:Button ID="cmdFilterDates" runat="server" Text="Filter" CommandName="FilterDates" />
                                </ItemTemplate>
                            </telerik:RadComboBox>
                        </FilterTemplate>
                          
                    </telerik:GridTemplateColumn>


Code:

Protected Sub grdShiftObservation_OnItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grdShiftObservation.ItemCommand
  
        If String.Equals(e.CommandName, "filterdates", StringComparison.OrdinalIgnoreCase) Then
  
            Dim cell As TableCell = CType(e.Item, Telerik.Web.UI.GridFilteringItem)("DateFilter")
            Dim dateFilterComboBox As RadComboBox = CType(cell.Controls(0).FindControl("ddlDateFilter"), RadComboBox)
            Dim dateFrom As RadDatePicker = CType(dateFilterComboBox.SelectedItem.FindControl("RadDatePickerFrom"), RadDatePicker)
            Dim dateTo As RadDatePicker = CType(dateFilterComboBox.SelectedItem.FindControl("RadDatePickerTo"), RadDatePicker)
  
        End If
  
    End Sub


dateFrom and dateTo show "Nothing"

any ideas? I want to be able to obtain the dates the user has selected.
Pavlina
Telerik team
 answered on 05 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?