Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
142 views
Hi,

I want to customize filter-menu according to column.
there are 4 columns in my rad-grid and all that columns contains filter-menu , I want to customise all of them filter-menu.

issue is when i customize first column(filter-menu) using unique-id of column , changes apply to all filter-menu on rad-grid.
another issue is when i put customize code for more than one column, filter-menu drop-down stops working.

following code i used.....


    protected void RadGridUserActionLog_Init(object sender, System.EventArgs e)
        {
            foreach (GridColumn column in RadGridUserActionLog.Columns)
            {             
                if (column.UniqueName == "Date")
                {
                    GridFilterMenu menu = RadGridUserActionLog.FilterMenu;
                    int i = 0;

                    while (i < menu.Items.Count)
                    {
                        if (menu.Items[i].Text == "IsNull" || menu.Items[i].Text == "NotIsNull")
                        {
                            i++;
                        }
                        else
                        {
                            menu.Items.RemoveAt(i);
                        }
                    }                    
                }
                              

                if (column.UniqueName == "Username")
                {
                    GridFilterMenu defaultmenu = RadGridUserActionLog.FilterMenu;
                    int i = 0;

                    while (i < defaultmenu.Items.Count)
                    {
                        if (defaultmenu.Items[i].Text == "NoFilter" || defaultmenu.Items[i].Text == "EqualTo" || defaultmenu.Items[i].Text == "NotEqualTo" || defaultmenu.Items[i].Text == "GreaterThan" || defaultmenu.Items[i].Text == "LessThan" || defaultmenu.Items[i].Text == "GreaterThanOrEqualTo" || defaultmenu.Items[i].Text == "LessThanOrEqualTo")
                        {
                            i++;
                        }
                        else
                        {
                            defaultmenu.Items.RemoveAt(i);
                            
                        }
                        RadGridUserActionLog.FilterMenu.DataBind();
                    }
                }
             }          
        }

Pradip
Top achievements
Rank 1
 answered on 24 Apr 2014
1 answer
107 views
Hello,

Is there any way to set the default behavior for reloading the editor dialogs?
I know that you can set the "ReloadOnShow" property for the "DialogDefinition" class but i cant find a way to set it for the editor dialogs.

Thank you
Ianko
Telerik team
 answered on 24 Apr 2014
1 answer
225 views
Hi,
Anybody can help me how to make drag and drop cell inside grid view? I would like to publish my sample code. I appricate any help or any tutorial.

Script.
function AssignDragandDrop() {
                $telerik.$('.RmEmtpyRoom').each(function () {
                    $telerik.$(this).droppable({ drop: celldrop });
                });
                $telerik.$('.RmReservation').each(function () {
                    $telerik.$(this).draggable({ helper: 'clone' });
                });
            }
            function celldrop(e, a) {
                //var oWnd = radopen(null, "winMove");
                var targetCell = $telerik.$(this);
                var targetCellIndex = targetCell.context.cellIndex;
                var targetRow = targetCell.context.parentElement;
                var targetRowIndex = targetRow.rowIndex;
                var newdate = $find('<%=grdAvailability.ClientID%>').MasterTableView.get_columns()[targetCellIndex].get_uniqueName();
                var roomkey = $find('<%=grdAvailability.ClientID%>').MasterTableView.get_dataItems()[targetRowIndex].getDataKeyValue("RoomKey");
                var reservationkey = a.draggable.context.id.split('_')[1];
                var url = '../Reservation/Update/NewMoveReservation.aspx?RK=' + reservationkey + '&D=' + newdate + '&R=' + roomkey;

                ShowRadWindow('Move Reservation', url, 650, 650);
                //var oWnd = radopen('../Reservation/Update/NewMoveReservation.aspx?RK=' + reservationkey + '&D=' + newdate + '&R=' + roomkey, "winMove");

                //var oWnd = radopen('../Reservation/Test.aspx?RK=' + reservationkey + '&D=' + newdate + '&R=' + roomkey, "winMove");
            }
Viktor Tachev
Telerik team
 answered on 24 Apr 2014
4 answers
210 views
Hello,
I have a dropdown that contains time zones. I would like change the time zone of the radscheduler client side without doing a post back. Is this possible?

Thanks,
Ron
Plamen
Telerik team
 answered on 24 Apr 2014
1 answer
83 views
Why is support for Dynamic Data not included in the Telerik assemblies by default? It seems that the only way to get controls that actually work with Dynamic Data is to post a question to this forum and hope you get a sample back with code that supports the features you intend to use.

Do you ever intend to rectify this? Is there a package I'm missing that will fill in the holes in your base product?
Danail Vasilev
Telerik team
 answered on 24 Apr 2014
1 answer
181 views
Please help me how to open PDF file on moust over on Template column

Shinu
Top achievements
Rank 2
 answered on 24 Apr 2014
1 answer
159 views
Hi there

I have a grid that exports to Excel, the data in the SQL Server table are NVARCHAR(4000) fields. It displays correctly, but when exporting it changes some of the diacritics to foreign characters, for example:

DB: André Letoit
Excel:  André Œetoit

The code I am using to export is:

/// <summary>
/// Export the Grid to XLS on Server instead of Clientside
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
protected void uxExportRequests_GridExporting(object source, GridExportingArgs e)
{
    User currentUser = new User(HttpContext.Current.User.Identity.Name.ToString());
    string fileName = currentUser.UserID.ToString() + "_TitleRequests_" + DateTime.Now.ToShortDateString().Replace("/", "").Replace("-", "") + ".xls";
    string path = Server.MapPath("~/Requests/") + fileName;
 
    using (FileStream fs = File.Create(path))
    {
        Byte[] info = System.Text.Encoding.Default.GetBytes(e.ExportOutput);
        fs.Write(info, 0, info.Length);
    }
}
and
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {               
            uxExportRequests.GridLines = GridLines.Both;
            uxExportRequests.GridExporting += new OnGridExportingEventHandler(uxExportRequests_GridExporting);
            uxExportRequests.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
            uxExportRequests.ExportSettings.ExportOnlyData = true;
    }
}
Is there any setting I need to change for this to keep the database characters?

Thank you.
Daniel
Telerik team
 answered on 24 Apr 2014
1 answer
343 views
Hi,

I am using RadGrid for ASP.NET. It contains a function to export data to PDF. I could achieve most of what I want but it seems it is not possible to change the font size and style of PageTitle.

Any help or comment is welcome.


The code snippet of the code-behind is shown below.

            radGrid.ExportSettings.Pdf.Title = "My Data"
            radGrid.ExportSettings.Pdf.Subject = "My Data";
            radGrid.ExportSettings.Pdf.PageTitle = "This is a page title"
            radGrid.ExportSettings.Pdf.PageWidth = Unit.Parse("297mm");
            radGrid.ExportSettings.Pdf.PageHeight = Unit.Parse("210mm");
            radGrid.ExportSettings.Pdf.PageLeftMargin = Unit.Pixel(15);
            radGrid.ExportSettings.Pdf.PageRightMargin = Unit.Pixel(15);
            radGrid.ExportSettings.Pdf.DefaultFontFamily = "Segoe UI";
            radGrid.ExportSettings.Pdf.AllowModify = false;
            radGrid.ExportSettings.Pdf.FontType = Telerik.Web.Apoc.Render.Pdf.FontType.Embed;
            radGrid.ExportSettings.Pdf.ForceTextWrap = true;
            radGrid.ExportSettings.UseItemStyles = true;



Daniel
Telerik team
 answered on 24 Apr 2014
1 answer
328 views

Hi,

We are testing the radScheduler for ASP.NET AJAX, we need to drag a branch name and ID from the tree view and create a visit schedule for that branch. On the nodeDropping event  we are creating a new appointment, can we add a new attribute to the appointment from the client side other than set_start, set_end and set_subject, like below we need to add "SiteId" as an attribute to the appointment.

                    var newAppointment = new Telerik.Web.UI.SchedulerAppointment();
                    newAppointment.set_start(startTime);
                    newAppointment.set_end(endTime);
                    newAppointment.set_subject(text);
                    newAppointment.set_description(siteId);
                    newAppointment.get_attributes().setAttribute("SiteId", siteId);

And in the server-side on post back, we will get all the appointments and update the database accordingly.

   foreach (Appointment a in RadScheduler1.Appointments)
        {
            string strSiteID;
            string strSubjectSiteId = a.Subject;
            DateTime startDate = a.Start;           
           string siteID = a.Attributes["SiteId"];         
        }

There is no error thrown we set the attribute at the client side, but in server side we are getting null and this attribute count is set to 0.
We have added the CustomAttributeNames="SiteId" into the markup.

Can you please guide us how we can add a custom attribute to the a Telerik.Web.UI.SchedulerAppointment.

Thank you

Regards,
Majid

 

Boyan Dimitrov
Telerik team
 answered on 24 Apr 2014
1 answer
281 views
1.if (!Page.IsPostBack)
2.{
3.    DataTable table = agenda.GetMeetings(DateTime.Now.AddDays(-30), DateTime.Now.AddDays(30));
4.    var meetings = table.AsEnumerable().OrderByDescending(m => m.Field<DateTime>("StartTime"));
5. 
6.    RadGrid1.DataSource = meetings;
7.    RadGrid1.DataBind();
8.}

Above is the databinding code.

Here is the GridHyperLinkColumn:

1.<telerik:GridHyperLinkColumn Text="View Agenda" HeaderText="" DataNavigateUrlFields="MeetingID"
2.    DataNavigateUrlFormatString="~/Routing/ViewAgenda.aspx?MeetingID={0}">
3.</telerik:GridHyperLinkColumn>

The column does not populate the DataNavigateURLFields property if the table is bound after the AsEnumberable conversion. If binding directly to the DataTable type, the hyperlink will work.
Eyup
Telerik team
 answered on 24 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?