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

I've added a mark for the current hour on the scheduler.

This function finds the cell of the current half hour, and adds a light-green border bottom:

function markCurrentHour() {
    var currentHour = (new Date()).format("HH");
    var currentMinutes = (new Date()).format("mm");
    if (+currentHour < 13) {
        currentHour += "AM";
    }
    else {
        currentHour = (+currentHour - 12) + "PM";
    }
    var verticalHeaderTables = $(".rsVerticalHeaderTable"); // Each view type has a table (day view, week view, etc.)
    if (verticalHeaderTables) {
        $.each(verticalHeaderTables, function (index, item) {
            var hourCells = $(item).find(".rsAmPm"); // 24 cells with the hours (12AM, 1AM, 2AM, etc.)
            $.each(hourCells, function (index, item) {
                if (item.parentNode.innerText.trim() == currentHour) { // Current hour cell
                    if (+currentMinutes < 30) { // First 30 minutes cell
                        item.parentNode.parentNode.style.borderBottomColor = "lightgreen";
                        item.parentNode.parentNode.style.borderBottomWidth = "5px";
                    }
                    else { // Next 30 minutes cell
                        $(item.parentNode.parentNode.parentNode).next().children()[0].style.borderBottomColor = "lightgreen";
                        $(item.parentNode.parentNode.parentNode).next().children()[0].style.borderBottomWidth = "5px";
                    }
                }
            });
        });
    }
}


I call this function in this event:

function onClientAppointmentsPopulated() {
    markCurrentHour();
}

You can see the result in the attached screenshot (at 4PM).
Hope it will help someone.

Guy.
Segev
Top achievements
Rank 1
 answered on 16 Jul 2014
6 answers
809 views
I have radgrid on my page. When user clicks "Edit" on the grid item and never click "Cancel"/"Update", when page is loaded next time the row is still in edit mode. ..

I have a toolbar at the top of my page having 2 items -- save and cancel. When Cancel on tollbar is clicked is there some way to cancel the edit mode of the radgrid row...
Princy
Top achievements
Rank 2
 answered on 16 Jul 2014
3 answers
79 views
Any page that has a grid with batch editing enabled breaks all other grids with a GridHyperLinkColumn for IE 8.

See screen shot of error when debugging in visual studio. The error happens after the GridHyperLinkColumn  is clicked but the linked page is never navigated to.

As soon as I remove the one grid with batch editing, all other grids work normally. This happened right after I updated to Q2 2014 from Q1 2014 (SP1 maybe? what ever your last major update was). Chrome and Firefox work fine in this scenario. 

Also the demo you have for batch editing does not add new items when I use IE8
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

Is anyone else seeing this?

Thanks
Milena
Telerik team
 answered on 16 Jul 2014
2 answers
140 views
Dear All,

I'm using

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = GridDataSource;            
        }


to bind the grid, and in the front page (aspx) it's like

<telerik:RadGrid ID="RadGrid1" runat="server" MasterTableView-CommandItemDisplay="Top" OnNeedDataSource="RadGrid1_NeedDataSource" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" ShowGroupPanel="True" PageSize="20" Skin="WebBlue">
                        <ClientSettings AllowDragToGroup="True">
                            <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                        </ClientSettings>
                    </telerik:RadGrid>

I'd just like to ask how can I set the dataformatstring = "{0:d}" to certain columns for example?

Thanks
Tim
Top achievements
Rank 1
 answered on 16 Jul 2014
6 answers
171 views
Hello,

I am currently working on a project with a RadGrid.
The Grid has 2 levels: master and detail.

The Settings of the Grid and the DetailView are in the
Page_Load: 
RadGrid1.MasterTableView.AllowPaging = False
Dim tableViewOrders = New GridTableView(RadGrid1)
RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders)
tableViewOrders.AllowPaging = True
tableViewOrders.PageSize = 10
RadGrid1.AllowSorting = True
RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = True
RadGrid1.AllowFilteringByColumn = True
RadGrid1.MasterTableView.HeaderStyle.Width = Unit.Pixel(200)
RadGrid1.ClientSettings.EnableRowHoverStyle = True
RadGrid1.MasterTableView.AllowNaturalSort = False
tableViewOrders.AllowNaturalSort = False

This is the code for the event DetailTableDataBind:
Private Sub RadGrid1_DetailTableDataBind(sender As Object, e As GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind
        'If rep.Ready_Data.Tables.Count > 1 Then
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
        Dim cellID As TableCell = dataItem("_key_id")
  
        Dim ConnectID As String = cellID.Text
        rep.Ready_Data.Tables(1).DefaultView.RowFilter = ""
        rep.Ready_Data.Tables(1).DefaultView.RowFilter = "_parent_key_id = " & ConnectID
        e.DetailTableView.DataSource = rep.Ready_Data.Tables(1).DefaultView
  
    End Sub

How can I hide some of the columns in detailView?

If I add the following lines into Page_Load:
tableViewOrders.GetColumn("_parent_key_id").Display = False
tableViewOrders.GetColumn("key_id").Display = False

It gives me the following error: 
Cannot find a column with UniqueName '_parent_key_id'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: Telerik.Web.UI.GridException: Cannot find a column with UniqueName '_parent_key_id'
 
Source Error:
Line 208:        tableViewOrders.GetColumn("_parent_key_id").Display = False
Line 209:        tableViewOrders.GetColumn("key_id").Display = False

(It seems the RadGrid doesn’t yet recognize these columns)
 
How can I hide these columns?

 
Thanks,

Daniel.
Daniel
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
173 views
Do you have any performance numbers for the time to upload files comparing your asyncupload to the regular asp:upload control? In this case the files will be .mov or .mp4 movies.  Any numbers, either actual upload onto the server or perceptual, would be greatly appreciated.  Thanks for your help, this is important to us.
Thanks!
Genady Sergeev
Telerik team
 answered on 16 Jul 2014
2 answers
150 views
Hi,

I would like to use multiple paths but from a sql reading loop.
How can I do that?

Of course this isn't working:

while (reader.Read())
{
folderName= (string)reader["folderName"];
viewPaths = new string[] { "~/Documents/" + folderName};
}

Thanks!
Attila
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
184 views
When I click on an item I would like to fill my TextBox with numbers from a column from Grid2 after Grid1 is clicked. Right now if I click on an item in Grid1 it will then run a procedure that will fill Grid2 with data. Here is an example of the current functionality with picture attached. I click an item from Grid1 and it has 3 results, my textbox will still display as an empty textbox. Then I click another item in Grid1 and now my textbox will display the 3 results from the previously clicked item. How can I display the correct numbers in my textbox after an item is selected in Grid1. 

Here are some snippets of what I currently have:
protected void Grid_Product_List_Details_PreRender(object sender, EventArgs e)
    {
        RadGrid grid = (RadGrid)sender;
 
        if (grid.Items.Count > 0)
            {
                RadTextBox1.Text = "";
            }
 
        for (int i = 0; i < grid.Items.Count; i++)
            {
 
                RadTextBox1.Text += grid.Items[i].GetDataKeyValue("number").ToString() + "\n";
            }
        RadTextBox1.DataBind();
 
    }


or I can comment out the above and use this to achieve the same results which are not correct:
protected void Grid_Product_List_Header_SelectedIndexChanged(object sender, EventArgs e)
    {
        RadTextBox1.Text = "";
        for (int i = 0; i < Grid_Product_List_Details.Items.Count; i++)
        {
 
            RadTextBox1.Text += Grid_Product_List_Details.Items[i].GetDataKeyValue("number").ToString() + "\n";
        }    
    }
Princy
Top achievements
Rank 2
 answered on 16 Jul 2014
2 answers
139 views


Hi,

I have grid control that that has master / detail
setup.  I’m trying to get this to export
to excel (html) but I’m having trouble figuring out how to apply 1 type of
formatting to master data and another type of formatting to child data


So for example this code applies formatting to all rows


        
protected void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
{
    GridDataItem item = e.Cell.Parent as GridDataItem;
 
    if (item.ItemType == GridItemType.AlternatingItem)
        item.Style["background-color"] = "#359AFF";
    else
        item.Style["background-color"] = "#2D62FF";
 
}


 Any ideas how I accomplish separate formatting please?

Andy
Top achievements
Rank 1
 answered on 16 Jul 2014
1 answer
217 views
We recently upgraded to the 2014 Q1 release(2014.1.403.35). Since the update some of our grids footers paging next/previous buttons stopped working.

The grid loads the first page fine, then when you click the next button it load the second page, if you then click it again it stays at page two. Using the next button it never goes beyond the second page. The last page button works but if you then click the back button again it wont go to the previous page but all the way back to the first page again.

This only happens when I have AllowPaging="true" The pages with AllowCustomPaging="true" works fine.

I created a PageIndexChanged event for the grid and found the following:

In this example the page has 1210 items, 25 items per page so there is 49 pages.

If I click next page, the NextPageIndex is 1 (the grid then navigates to page 2)
When I click next page again, the NextPageIndex stays 1 (the grid stays on page 2)
If I click last page the NextPageIndex is 48. (it then navigates to page 49)
If you click page back or first page the event does not fire, but it navigates back to the first page.

This leads me to believe that the PageIndex is not being remembered somehow.

Do you have any idea what causes this and how to fix it?

Angel Petrov
Telerik team
 answered on 16 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?