Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
170 views
Hi,

I'm working on implementing a scheduler/clock in&out system.

I'm binding client side through web services to a scheduler grouped by Users (so I have multiple columns one for each employee and in those columns I'm displaying their clock in and outs).

I want to implement a filter so you can view 1,2,3,4 etc users at a time instead of all of them.  I have a multi-select combobox above the scheduler which I grab the values from client side then do a client side rebind and capture the OnClientAppointmentsPopulating event then override the SchedulerInfo class to pass an extra parameter (the users which I want to view) and then store that in the session and access it in the controller.

This is all working fine and when I do the filter I can see that only the data for the particular users is returned and the appointments for the other users disappear from the calendar BUT the columns for each user (resource) are still there just empty with no appointments since I filtered those out.  Is it possible to hide those empty columns as well so those users do not show? Is this possible client side?  Not even sure I think I may be asking for too much...

I attached a  picture to clarify what I'm looking for...each user has their own column...I want to be able to filter the data (got this part working) and only show 1-2 columns at a time (not working after I get filtered data all columns stay just appointments disappear)

T. Tsonev
Telerik team
 answered on 10 Mar 2010
3 answers
129 views
I have just implemented CustomPaging to my RadGrid, but now I seem to have broken sorting and filtering, as well as the fact that I can't get it to display the records in REVERSE order straight from the db (99,98,97,etc... the Order By [errDate] Desc doesn't seem to be doing exactly what I'm looking for).

Here is my Grid
<telerik:RadGrid ID="RadGrid1" PageSize="15" AllowFilteringByColumn="true" runat="server" 
            AutoGenerateColumns="false" AllowAutomaticDeletes="false" AllowAutomaticUpdates="false" 
            AllowAutomaticInserts="false" AllowSorting="true" AllowPaging="true" AllowCustomPaging="true" 
            OnNeedDataSource="RadGrid1_NeedDataSource"
            <MasterTableView TableLayout="Auto" DataKeyNames="ID"
                <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" /> 
                <ItemStyle Wrap="False" /> 
                <NoRecordsTemplate> 
                    No Errors Logged at this time 
                </NoRecordsTemplate> 
                <NestedViewTemplate> 
                    <fieldset> 
                        <legend style="font-size: 14px; font-weight: bolder;">Error Details</legend> 
                        <table> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    Error URL: 
                                </td> 
                                <td style="width: 100%;"
                                    <%#DataBinder.Eval(Container.DataItem, "errURL")%> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    Error Source: 
                                </td> 
                                <td> 
                                    <%#DataBinder.Eval(Container.DataItem, "errSource")%> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    Exception: 
                                </td> 
                                <td> 
                                    <%#DataBinder.Eval(Container.DataItem, "errEx")%> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    Stack Trace: 
                                </td> 
                                <td> 
                                    <%#DataBinder.Eval(Container.DataItem, "errStack")%> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    Additional Notes: 
                                </td> 
                                <td> 
                                    <%#DataBinder.Eval(Container.DataItem, "errNotes")%> 
                                </td> 
                            </tr> 
                        </table> 
                    </fieldset> 
                    <fieldset> 
                        <legend style="font-size: 14px; font-weight: bolder;">User Details</legend> 
                        <table> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    User Name: 
                                </td> 
                                <td style="width: 100%;"
                                    <%#DataBinder.Eval(Container.DataItem, "errUser")%> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    User IP Address: 
                                </td> 
                                <td> 
                                    <%#DataBinder.Eval(Container.DataItem, "errIP")%> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    User Browser: 
                                </td> 
                                <td> 
                                    <%#DataBinder.Eval(Container.DataItem, "errBrowser")%> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td style="white-space: nowrap;"
                                    User Operating System: 
                                </td> 
                                <td> 
                                    <%#DataBinder.Eval(Container.DataItem, "errOS")%> 
                                </td> 
                            </tr> 
                        </table> 
                    </fieldset> 
                    <div style="height: 20px;"
                        &nbsp;</div> 
                </NestedViewTemplate> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="ID" HeaderText="Error" UniqueName="ID" /> 
                    <telerik:GridBoundColumn DataField="errUser" HeaderText="User" UniqueName="errUser" /> 
                    <telerik:GridTemplateColumn DataField="errMessage" HeaderText="Message" UniqueName="Message"
                        <ItemTemplate> 
                            <asp:Label ID="lblMessage" runat="server" Text='<%# ShortenField(DataBinder.Eval(Container.DataItem, "errMessage")) %>' /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn Reorderable="true" DataField="errDate" HeaderText="Date" 
                        UniqueName="Date"
                        <ItemStyle Width="100px" /> 
                        <ItemTemplate> 
                            <asp:Label ID="lblDate" runat="server" Text='<%# FormatDate(DataBinder.Eval(Container.DataItem, "errDate")) %>' /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 

And my Code Behind
Partial Class App_Windows_Admin_Windows_Health_Monitor_Admin 
    Inherits System.Web.UI.Page 
 
    Function FormatDate(ByVal input As DateTime) As String 
        Return Format(input, "MMMM dd, yyyy"
    End Function 
 
    Function ShortenField(ByVal input As StringAs String 
        If input.Length > 50 Then 
            Return input.Substring(0, 50) & "..." 
        End If 
    End Function 
 
    Protected Sub Page_PreInit(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.PreInit 
        If Not Page.IsPostBack Then 
            Dim HealthMonitorDC As New DAL.HealthMonitorDataContext 
            VirtualItemCount = Integer.Parse(HealthMonitorDC.bt_HealthMonitor_GetRecordCount().ReturnValue) 
        End If 
    End Sub 
 
    Private Shared VirtualItemCount As Integer 
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) 
 
 
        RadGrid1.MasterTableView.VirtualItemCount = VirtualItemCount 
        RadGrid1.VirtualItemCount = VirtualItemCount 
 
        Dim startRowIndex As Integer = (RadGrid1.CurrentPageIndex * RadGrid1.PageSize) 
        Dim maximumRows As Integer = RadGrid1.PageSize 
 
        Dim HealthMonitorDC As New DAL.HealthMonitorDataContext 
 
        Dim r = HealthMonitorDC.bt_HealthMonitor_GetAll(startRowIndex, maximumRows) 
        RadGrid1.DataSource = r 
    End Sub 
 
End Class 
 

My SQL Queries look like this

ALTER PROCEDURE [dbo].[bt_HealthMonitor_GetRecordCount] 
 
AS 
SET NOCOUNT ON 
 
return (Select Count(ID) As TotalRecords From bt_HealthMonitor) 
 

And

 
ALTER PROCEDURE [dbo].[bt_HealthMonitor_GetAll] 
        @StartRowIndex      int
        @MaximumRows        int 
 
AS 
SET NOCOUNT ON 
 
Select 
    RowNum, 
    [ID], 
    [errEx], 
    [errURL], 
    [errSource], 
    [errUser], 
    [errMessage], 
    [errIP], 
    [errBrowser], 
    [errOS], 
    [errStack], 
    [errDate], 
    [errNotes] 
From 
    (Select 
        [ID], 
        [errEx], 
        [errURL], 
        [errSource], 
        [errUser], 
        [errMessage], 
        [errIP], 
        [errBrowser], 
        [errOS], 
        [errStack], 
        [errDate], 
        [errNotes], 
        Row_Number() Over(Order By [ID]) As RowNum 
        From dbo.[bt_HealthMonitor] t)  
As DerivedTableName 
Where RowNum Between @StartRowIndex And (@StartRowIndex + @MaximumRows) 
     
Order By [errDate] Desc 

Any advice on this would be greatly appreciated, thanks.





Iana Tsolova
Telerik team
 answered on 10 Mar 2010
1 answer
189 views
I am using the following code:

                           Dim o_Grid As New Telerik.Web.UI.RadGrid 
 
                            o_Grid.ID = o_I.GUID.ToString 
                            o_Grid.AllowPaging = o_Table.Rows.Count > 10 
                            o_Grid.ShowStatusBar = o_Table.Rows.Count > 10 
                            o_Grid.Width = Unit.Percentage(100) 
                            o_Grid.RegisterWithScriptManager = True 
                            o_Grid.EnableEmbeddedScripts = True 
 
                            AddHandler o_Grid.NeedDataSource, AddressOf _GridsNeedDataSource 
                            AddHandler o_Grid.PageIndexChanged, AddressOf _GridsPageIndexChanged 
                            AddHandler o_Grid.ColumnCreated, AddressOf _GridsColumnCreated 
 
                            Debug.WriteLine(String.Format("Grid.UniqueID: {0}", o_Grid.UniqueID)) 
 
                            o_SerialNumbers.Controls.Add(o_Grid) 
 
                            o_Proxy.AjaxSettings.AddAjaxSetting(o_Grid, o_Grid) 

to dynamically, programmatically add a number of different grids to a Web Content Form during the Page_Load

Fine and dandy.

The Initial .NeedDataSource is fired and the grids are populated correctly, paging enabled/disabled etc.
Here comes what I have not been able to get to work.

Once I click the page "2" button or the "next page" etc ... the AjaxRequest fires correctly but no NeedDataSource or PageIndexChanged ... I can't wrap my head around it.

Bout the second problem I've had in 5y of using Telerik and not being able to figure out a solution by reading the documentation, forums, kb etc.

Anybody have any idea ?

o_Proxy = RadAjaxManagerProxy
o_SerialNumbers = RadAjaxPanel
Pavlina
Telerik team
 answered on 10 Mar 2010
4 answers
175 views
Hello,
If I enter "30/22/09" into the first control in this demo, it gets updated to be "9/30/2022" rather than displaying an error indicating the date is invalid. If I enter "9", it gets changed to "8/9/2009". Is there a way to disable this and just show this as an invalid date?
Thanks
-marcos
sara r
Top achievements
Rank 1
 answered on 10 Mar 2010
3 answers
126 views
I am having a problem overlaying the RadWindow on top of a mapping java applet in Firefox and Chrome (it works OK in IE). The behaviour showing is that the border of the frame is hidden behind the applet but the content of the window is showing correctly. I have tried playing with the z-index of various css classes such as ".RadWindow .rwTopResize" but without success.

Any help in getting around this would be much appreciated.

Thanks in advance, Carl
Svetlina Anati
Telerik team
 answered on 10 Mar 2010
6 answers
211 views
Hi everyone
I'm fighting with this issue for quite a long time now, and so I thought this would be the right place to ask a question regarding this little issue.

Every time I try to cache data with the System.Web.Caching.Cache property, I get the 'Controls cannot be ajaxified after Page PreRender.'-error at the line where I call AddAjaxSettings on the RadAjaxManager. When I remove the caching lines, everything just works fine. I sincerely do not know why the usage of the Cache property causes the AjaxManager to throw an exception. 

The following describes the faulty scenario:
I have a RadTreeView in the Master page. When a node of it is dropped, some data I want to cache is loaded into a RadGrid which is placed in the Default.aspx page. After this step the thing crashes (the first time - the data is not in the cache yet - it loads the data into the grid; the second time - data is in the cache now - it throws the abovementioned exception). The caching code is actually very simple:
BindingList<string> strings = Cache["LotsOfItems"as BindingList<string>; 
if (strings == null
    strings = MyClass.GetLotsOfStrings(); 
    Cache.Insert("LotsOfItems", strings, null, DateTime.Now.AddMinutes(1), Cache.NoSlidingExpiration); 
 
myGrid.DataSource = strings; 
myGrid.DataBind(); 


I hope somebody can help me out with this one. I'll provide further information if needed.

Thanks very much.

Kind regards,
Mallory
Mallory
Top achievements
Rank 1
 answered on 10 Mar 2010
1 answer
80 views
Hi,

First... Happy Independence Day to Bulgaria !!

Now on to the question...

I've been using version 2009_3_1314 of the Telerik Scheduler control and I've run into a javascript error when I switch to a Month view.

The error points to the following code found in Telerik.Web.UI\Scheduler\Views\Month\Model.js:

    _getTimeSlotDomElement : function(rawIndex)
    {
        var element = this._owner.get_element();
        var rowIndex = Math.floor(rawIndex.dayIndex / this.get_weekLength());
        var cellIndex = Math.floor(rawIndex.dayIndex % this.get_weekLength());
        return  $('div.rsTopWrap table.rsContentTable', element)[0].tBodies[0].rows[rowIndex].cells[cellIndex];
    },

It looks as though when I go to open the Jan 2010 month view, the time slot for Feb 1 (which from what I can tell should have a rowindex is set to 5 and a cellindex is set to 1) gets a null value when we are on the last line of this function.

Is there any way to easily correct this issue? Can I in some way modify the Model.js file and have things rebuilt some how?

Thanks as always for all your help,
Greg
T. Tsonev
Telerik team
 answered on 10 Mar 2010
1 answer
106 views
hi

i am using a grid and perfom grid update/insert operations with User Controls,In my user Control i am using a rad upload but when i add ajax manager for grid then radupload in user control doesn't work please help me to perform update and insert with RadUpload in user control that is called by the grid for update or insert.

pleas reply me as soon as possible

Best Regards
Xshan
Veli
Telerik team
 answered on 10 Mar 2010
1 answer
258 views
Hi All,

Ho can i Set Chart Y-axis scale break points.
For example in "Temperature" example on y-axis it is showing starting from 0 tp 50 (0 10 20 30 40 50),

if i want to show same 0 to 50 like (0 5 10 15 20 25 ......) what should i do

Please help me regarding this.



Velin
Telerik team
 answered on 10 Mar 2010
2 answers
170 views
Hi,

I wrote a "small" time registration application using RadGrid and RadNumericTextBox. A registration page would have all the tasks of a user and show a column for each day of the week, each day-task cell contains a RadNumericTextBox control.

The application works perfectly except for one small issue. Performance is dreadful.

The biggest issue that I am running into is the way RadNumericTextBox works.

First of all the 'pure' HTML code of each control turns into about 1k-1.5k of bytes per input box (1 span and 4 input fields), all these html elements contain an id (and input fields have a name) which can be rather long (for example: ctl00_ContentPlaceHolder1_rgUserTasks_ctl00_ctl06_Detail10_ctl04_rntbDay6_ClientState). 

Secondly, each control adds a javascript initialization code at the end of the page. Code like this:
" $create(Telerik.Web.UI.RadNumericTextBox, {"_enableOldBoxModel":false,"_focused":false,"_shouldResetWidthInPixels":true,"clientStateFieldID":"ctl00_ContentPlaceHolder1_rgUserTasks_ctl00_ctl06_Detail10_ctl04_rntbDay5_ClientState","enabled":true,"incrementSettings":{InterceptArrowKeys:true,InterceptMouseWheel:true,Step:1},"maxValue":24,"minValue":0,"numberFormat":{"DecimalDigits":2,"DecimalSeparator":",","CultureNativeDecimalSeparator":",","GroupSeparator":".","GroupSizes":3,"NegativePattern":"-n","NegativeSign":"-","PositivePattern":"n","AllowRounding":true,"KeepNotRoundedValue":false},"styles":{HoveredStyle: ["width:32px;", "riTextBox riHover"],InvalidStyle: ["width:32px;", "riTextBox riError"],DisabledStyle: ["width:32px;", "riTextBox riDisabled"],FocusedStyle: ["width:32px;", "riTextBox riFocused"],EmptyMessageStyle: ["width:32px;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:32px;", "riTextBox riRead"],EnabledStyle: ["width:32px;", "riTextBox riEnabled"],NegativeStyle: ["width:32px;", "riTextBox riNegative"]}}, {"keyPress":disableEnterKey,"valueChanged":function () { changed = true; UpdateTotals(571,5); }}, null, $get("ctl00_ContentPlaceHolder1_rgUserTasks_ctl00_ctl06_Detail10_ctl04_rntbDay5")); "

This is also another 1k-2k of additional size to the page. The 'fun' part is that this initialization code is largely the same for all controls on the page.

Now html size isn't the entire issue. Because each input control actually contains 4 input fields, a post back results in a lot of data. Even if a field is empty, the fact that each name of each input box is roughly 60-100 bytes results in 320-400 bytes per RadNumericTextBox of post data (its actually more because 1 of the fields contains an unused "client state" field).

One User in the application has roughly 40 tasks which results in 40 * 8 (7 days + 1 'remaining') RadNumericTextBox's which in turn results into a page of 1.2Mbyte and 150k post data. Lets just say it takes .NET a while to render the page, then it takes a while for the user to retrieve the page and then it takes a while for the user to post back the page. Making navigation through the application far from ideal. Note that the design of the application requires "easy" input, so row-editing isn't really an option unless this could be started on mouse-over. Editing mostly happens for a day and not so much row (a row is 7 days for a task).

Currently it looks like I will have to dump RadNumericTextBox control in favor of a traditional input field (possibly even a raw-html field) and perhaps add one RadNumericTextBox to the form and show this input box each time the user wants to edit his hours for that day/task.

Is there any other way around this issue?

Regards,

Jerremy
Jerremy
Top achievements
Rank 1
 answered on 10 Mar 2010
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?