Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
78 views
I have a grid using GridBoundColumns.  The first column is a GridButtonColumn whose Text property is blank.  When the user clicks the button, the user's login Id is stored in a database table and the button's text is set to the user's login Id.  This all happens in the grid's ItemCommand event.  The code is:

        If e.CommandName = "Assign" Then
            Dim item As GridDataItem = CType(e.Item, GridDataItem)
            Dim strJobNumber As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("Job_Number")
            Dim strButtonText As String = CType(item("button").Controls(0), Button).Text
            Dim NTLoginID As String = GetCurrentUser()
              
            If String.IsNullOrEmpty(strButtonText) Then
                Dim _db As New MyAssembly.DataContext(ConfigurationManager.ConnectionStrings("MyCNString").ConnectionString)
                Dim rslt = _db.TMSearchAssignments.Where(Function(x) x.JobNumber.Equals(strJobNumber)).FirstOrDefault
                If Not rslt Is Nothing Then
                    CType(item("button").Controls(0), Button).Text = rslt.NTLoginID
                    Exit Sub
                Else
                    db.StoredProcedureRepo.sp_Insert_TMSearchAssignment(strJobNumber, NTLoginID, False)
                    CType(item("button").Controls(0), Button).Text = NTLoginID
                End If
            End If
End If

That code works great and the button's text is updated as desired. The problem is when the user goes to the next page in the grid and the returns to the previous page, the text is gone.  How can I keep the text from disappearing?

Thanks,

James
James
Top achievements
Rank 1
 answered on 13 Dec 2011
3 answers
78 views
I'm getting data from database. I have two tables which create appointments. The classes which represent these tables differ by one boolean variable.

I'm trying to color the cells from one of the table green.

My css is here:
.rsMonthView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }
                
                .rsDayView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }
                
                .rsWeekView .rsAptContent 
                {  
                  background: #D0ECBB; 
                }
                
                .rsTimelineView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }


How to check which table from is the cell?
Peter
Telerik team
 answered on 13 Dec 2011
7 answers
139 views
Hi Every one,
I want to build a class inherits from charts to make my charting dynamic. But when i try to make such class and add properties of chart control , it fails to set the properties and shows it read only.
Regards
Muhammad Shoaib.

Ves
Telerik team
 answered on 13 Dec 2011
1 answer
109 views
how can we use Raddock in mvc3 application.
Slav
Telerik team
 answered on 13 Dec 2011
5 answers
152 views
In the month view, Is there a way to prevent the user from clicking on the day number to look at the individual day?  I am not using this as a traditional scheduler, but rather a monthly read only informational page.  I have everything disabled so far except clicking on the number in the top left corner of each day.

Thanks.
Ivana
Telerik team
 answered on 13 Dec 2011
8 answers
159 views
Hello
I am Using RelatedLoDRadComboboxesInAdvForm and I want to Display some of my text in my Appointment when all data is saved.
 but Its Showing like this in my 1.jpg

AdvancedForm.aspx
  
<asp:Panel  runat="server" ID="ResourceControls">
 <asp:Label ID="Label1" runat="server" AssociatedControlID="ContinentsRadComboBox">Continent:</asp:Label>
                        <telerik:RadComboBox ID="ContinentsRadComboBox" runat="server" Width="186px"
                            OnClientSelectedIndexChanged="LoadCountries" />
                         
                        <asp:Label ID="Label2" runat="server" AssociatedControlID="CountriesRadComboBox">Country:</asp:Label>
                        <telerik:RadComboBox ID="CountriesRadComboBox" runat="server" Width="186px" 
                            OnClientItemsRequested="CountriesLoaded"  OnClientSelectedIndexChanged="LoadCities" 
                            EnableViewState="false" />
  
  
                            <asp:Label ID="Label3" runat="server" AssociatedControlID="CitiesRadComboBox">Cities:</asp:Label>
                        <telerik:RadComboBox ID="CitiesRadComboBox" runat="server" Width="186px"
                             
                            OnClientItemsRequested="CitiesLoaded"
                            EnableViewState="false" />
    </asp:Panel>
  
DefaultVB.apsx
  
 <AppointmentTemplate>
            <div class="rsAptSubject">
            <%# Eval("Subject")%>
            </div>
            <div>  <%# Eval("Description")%></div>
            <div>  <%# Eval("Continent")%></div>
             <div>  <%# Eval("Country")%></div>
              <div>  <%# Eval("City")%></div>
              
            </AppointmentTemplate>
 But its Showing me my IDs instead of Names...
Please Help
Ivana
Telerik team
 answered on 13 Dec 2011
2 answers
128 views
I need create something like image.
A windows o a panelBar inside content with X for close.
Not Popup. I need inside Content.

Is Any control for that?

July
Top achievements
Rank 2
 answered on 13 Dec 2011
10 answers
232 views
Hi

I have created a simple ajaxified radgrid. Everything works fine except that sometimes when I paginate (change page index), it triggers the OnCommand client event twice. And that too randomly. There is no fixed index at which it happens and that makes it even more difficult for me to identify the problem.  For example if it happens when I click page 5, there are 2 postbacks.... the first one passes the correct pageIndex (4) and loads the proper data on the grid.... but the second post back passes pageIndex as 0 so the grid displays page 1 data.

My pagesize is 10 and I have more than 100 pages.

Here is my Aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Event Log</title>
    <style type="text/css">
        .RadLoadingPanel { top: 0px; right: 0px; position: fixed; background-color: #EBEBEB; }
        .RadLoadingPanel img { vertical-align: middle; margin: 2px; }
    </style>
 
    <script type="text/javascript" src="JS/jquery-1.6.4.min.js"></script>
 
    <script type="text/javascript" src="JS/json2.js"></script>
 
    <telerik:RadCodeBlock runat="server" ID="rc">
 
        <script type="text/javascript">
            var commandName = "";
            var tableView = null;
            function pageLoad()
            {
                setTimeout('LoadGrid();', 1);
            }
 
            function LoadGrid()
            {
                tableView = $find("<%= rg.ClientID %>").get_masterTableView();
                commandName = "Load"
                executeMethod("Default3.aspx", "GetDataAndCount", getRequestData(tableView), updateGrid);
            }
 
            function gridOnCommand(sender, args)
            {
                if (args.get_commandName() != "PageSize")
                {
                    args.set_cancel(true);
                    LoadGrid();
                }
            }
 
 
            function FailMessage()
            {
                alert('fail');
            }
 
            function updateGrid(result)
            {
                tableView.set_dataSource(result.d.Data);
                tableView.set_virtualItemCount(result.d.Count);
                tableView.dataBind();
            }
 
 
            function getRequestData(tableView)
            {
                return JSON.stringify({
                    "startIndex": tableView.get_currentPageIndex(),
                    "maximumRows": tableView.get_pageSize(),
                    "eID": $('#<%=txtEventID.ClientID %>').val(),
                    "fDate": $find("<%= rdFrom.ClientID %>").get_selectedDate(),
                    "tDate": $find("<%= rdTo.ClientID %>").get_selectedDate(),
                    "sortExpression": tableView.get_sortExpressions().toString(),
                    "filterExpression": tableView.get_filterExpressions().toDynamicLinq()
 
                });
            }
 
            function executeMethod(location, methodName, methodArguments, onSuccess, onFail)
            {
                $.ajax({
                    type: "POST",
                    url: location + "/" + methodName,
                    data: methodArguments,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: onSuccess,
                    fail: onFail,
                    beforeSend: function()
                    {
                        // Handle the beforeSend event  
                        $("#<%=RadAjaxLoadingPanel1.ClientID %>").show()
                    },
                    complete: function()
                    {
                        // Handle the complete event  
                        $("#<%=RadAjaxLoadingPanel1.ClientID %>").hide()
                    }
 
                });
            }
        </script>
 
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" CssClass="RadLoadingPanel"
            IsSticky="True" EnableEmbeddedSkins="false" EnableAjaxSkinRendering="false">
            <asp:Image runat="server" ID="imgLoading" ImageUrl="ajax-loader.gif" AlternateText="Loading..." />
            <span>Loading...</span>
        </telerik:RadAjaxLoadingPanel>
        <table>
            <tr>
                <th>
                    From Date
                </th>
                <td>
                    <telerik:RadDatePicker ID="rdFrom" runat="server">
                    </telerik:RadDatePicker>
                </td>
            </tr>
            <tr>
                <th>
                    To Date
                </th>
                <td>
                    <telerik:RadDatePicker ID="rdTo" runat="server">
                    </telerik:RadDatePicker>
                </td>
            </tr>
            <tr>
                <th>
                    Event ID
                </th>
                <td>
                    <asp:TextBox ID="txtEventID" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                </th>
                <td>
                    <a href="javascript://" onclick="LoadGrid();return false;">Search</a>
                </td>
            </tr>
        </table>
        <br />
        <br />
        <telerik:RadAjaxPanel ID="rp" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadGrid ID="rg" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                CellSpacing="0" GridLines="None" AllowSorting="true" >
                <ClientSettings EnableRowHoverStyle="True" >
                    <ClientEvents OnCommand="gridOnCommand"  />
                </ClientSettings>
                <MasterTableView AllowNaturalSort="False" AllowMultiColumnSorting="false">
                    <Columns>
                        <telerik:GridBoundColumn DataField="EventID" HeaderText="Event ID">
                            <ItemStyle Width="10%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EventDate" HeaderText="Event Date" DataFormatString="{0:M/dd/yy  h:mm tt}"
                            DataType="System.DateTime">
                            <ItemStyle Width="15%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EventDesc" HeaderText="Description" AllowSorting="false">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="True"></PagerStyle>
                </MasterTableView>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
    </div>
    </form>
</body>
</html>

And here is the VB Code:
Imports System.Web.Services
Imports System.Data
 
Partial Class Default3
    Inherits System.Web.UI.Page
 
    <WebMethod(True)> _
 Public Shared Function GetDataAndCount(ByVal startIndex As Integer, ByVal maximumRows As Integer, ByVal eID As String, ByVal fDate As Nullable(Of Date), ByVal tDate As Nullable(Of Date)) As Dictionary(Of String, Object)
        Dim data As New Dictionary(Of String, Object)()
        Using dc As New DataClassesDataContext
 
            'dc.Log = Console.Out
 
            Dim EL = From e In dc.EventLogs _
               Select e.EventID, e.EventDate, e.EventDesc _
            Order By EventDate Descending
 
            If IsNumeric(eID) Then
                EL = EL.Where(Function(e) e.EventID = CLng(eID))
            End If
 
            If fDate.HasValue Then
                EL = EL.Where(Function(e) e.EventDate >= fDate.Value)
            End If
 
            If tDate.HasValue Then
                EL = From e In EL _
                  Where e.EventDate < tDate.Value.AddDays(1)
            End If
 
            data.Add("Data", EL.Skip(startIndex * maximumRows).Take(maximumRows).ToList())
            data.Add("Count", EL.Count)
            Return data
        End Using
    End Function
 
End Class


P.S: I am using v2011.2.915.35 of Telerik and this happens both in Firefox and IE.

Vasil
Telerik team
 answered on 13 Dec 2011
1 answer
130 views
I want to replace my RadDatePicker with a RadMonthYearPicker resulting in less clutter for the page, problem is I need to get the start and end of the month selected via MonthYear picker for my query.

the statement below:
protected void DateChange(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        {
            //Session.Add("StartDate", RadDatePicker1.SelectedDate);
            Session.Add("selectedMonth", RadMonthYearPicker1.DbSelectedDate);
        }

returns merely the month I choose, the day today, and the chosen year. ex return '5/13/2011'.  When I want to get '5/1/2011' and '5/31/2011'
Any suggestions on how I can get the 'start' and 'end' of the month or do I stick with RadDatePicker for now? If there is a way to do this pointing me in the right direction would be much appreciated.

Thanks
Kevin
Top achievements
Rank 2
 answered on 13 Dec 2011
1 answer
74 views
- selected tab is not getting selected when im not using multipage property.


Regards,
Irfan
Princy
Top achievements
Rank 2
 answered on 13 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?