Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
158 views
Hello,

I've got a grid with date columns and I'd like to filter these columns selecting 2 dates (start and end) and apply "between" filter.
My grid is built dynamically at server side, as I don't know in advance what kind of columns it will contain.
So, to allow filtering, I've created a filter template with 2 RadDatePicker.
But I don't know how I can use FireCommandEvent to make filter work.
If I select one date, and I use GreaterThan or LessThan, it works fine, but how to invoke FireCommandEvent to take the 2 dates in input, and apply "Between" filter ?

Tanks for your answers

Here is my code :

The template filter for date is implemented by the CustomFilterForDateGridColumn class.

Here is the aspx code for the control containing the grid :
<%@ Control AutoEventWireup="false" CodeBehind="wucCompteHistoPrets.ascx.vb" Inherits="OPAC_LOCAL.wucCompteHistoPrets" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<asp:Panel ID="PanelHistoPrets" runat="server">  
    <asp:label id="MSG_ERREUR" runat="server" CssClass="MessageErreur" Visible="False"></asp:label> 
    <telerik:RadGrid id="GrilleHistoPrets" runat="server" EnableEmbeddedSkins="false" Width="100%" Skin="Default" 
        PageSize="20" PagerStyle-AlwaysVisible="true" AllowPaging="true" AutoGenerateColumns="false" 
        GroupingEnabled="false" ShowGroupPanel="false" AllowMultiRowSelection="true" AllowSorting="true" 
        ClientSettings-AllowDragToGroup="false" ClientSettings-Selecting-AllowRowSelect="true" 
        SortingSettings-SortToolTip="Cliquer pour trier la colonne" SortingSettings-SortedDescToolTip="Tri ascendant" SortingSettings-SortedAscToolTip="Tri descendant" 
        OnNeedDataSource="GrilleHistoPrets_NeedDataSource" OnItemDataBound="GrilleHistoPrets_ItemDataBound" 
        OnItemCreated="GrilleHistoPrets_ItemCreated" 
        OnItemCommand="GrilleHistoPrets_ItemCommand" 
        ShowStatusBar="true" 
        > 
        <MasterTableView PageSize="20" runat="server" 
            AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" 
            NoMasterRecordsText="Aucun prêt" NoDetailRecordsText="Aucun prêt" 
            ShowHeadersWhenNoRecords="true" 
            CommandItemDisplay="Top" 
            > 
            <Columns> 
            </Columns> 
            <CommandItemTemplate> 
                <div align="right" style="padding:4px 0px 0px 6px;">  
                    <asp:ImageButton runat="server" ID="btnClearFilters" CommandName="ClearFilters" /> 
                    <asp:Button runat="server" ID="btnTexteClearFilters" CommandName="ClearFilters" /> 
                </div> 
            </CommandItemTemplate> 
        </MasterTableView> 
        <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" 
            FirstPageText="" FirstPageToolTip="Aller Ã  la première page" 
            NextPageText="" NextPageToolTip="Aller Ã  la page suivante" 
            LastPageText="" LastPageToolTip="Aller Ã  la dernière page" 
            PrevPageText="" PrevPageToolTip="Aller Ã  la page précédente" 
            NextPagesToolTip="Afficher les pages suivantes" PrevPagesToolTip="Afficher les pages précédentes" 
            PagerTextFormat="{4}{5} prêt(s) sur {1} page(s)" 
        /> 
    </telerik:RadGrid> 
</asp:Panel> 
 
 

And the code behind : the method which build the grid dynamically.
    Protected Sub AfficherGrillePrets()  
        Dim i As Integer = 0  
        Dim strTxt As String = "" 
        SessionsConfig.GetConfTextes("TexteAucunPret", strTxt)  
        GrilleHistoPrets.MasterTableView.NoDetailRecordsText = strTxt  
        GrilleHistoPrets.MasterTableView.NoMasterRecordsText = strTxt  
        GrilleHistoPrets.MasterTableView.Columns.Clear()  
        GrilleHistoPrets.AllowFilteringByColumn = _AutoriserFiltrage  
 
        If Not IsNothing(ListeColonneHistoPrets) AndAlso ListeColonneHistoPrets.Count > 0 Then 
            Dim colID As GridBoundColumn  
 
            colID = New GridBoundColumn  
            colID.DataField = "Id" 
            colID.Visible = False 
            GrilleHistoPrets.MasterTableView.Columns.Add(colID)  
 
            Dim myEnum As IEnumerator = ListeColonneHistoPrets.GetEnumerator()  
            Dim sLibCol As String 
            Dim sTypeCol As String = "T" 
            i = 1  
            While myEnum.MoveNext  
                sLibCol = CStr(myEnum.Current)  
                sTypeCol = "T" 
                If CStr(myEnum.Current).Contains("|"Then 
                    Try 
                        sLibCol = CStr(myEnum.Current).Split("|")(0)  
                        sTypeCol = CStr(myEnum.Current).Split("|")(1)  
                    Catch ex As Exception  
                    End Try 
                End If 
                Select Case sTypeCol  
                    Case "T" 
                        Dim col As New GridBoundColumn  
                        col.DataField = "val" & i  
                        col.HeaderText = sLibCol  
                        col.ItemStyle.HorizontalAlign = HorizontalAlign.Left  
                        col.AllowFiltering = False 
                        GrilleHistoPrets.MasterTableView.Columns.Add(col)  
                    Case "D" 
                        Dim col As New GridDateTimeColumn  
                        col.DataField = "valD" & i  
                        col.DataType = GetType(System.DateTime)  
                        col.DataFormatString = "{0:dd/MM/yyyy}" 
                        col.HeaderText = sLibCol  
                        col.AllowFiltering = False 
                        col.ItemStyle.HorizontalAlign = HorizontalAlign.Left  
                        GrilleHistoPrets.MasterTableView.Columns.Add(col)  
                    Case "TF" 
                        Dim col As New CustomFilterForTextGridColumn(ListeLigneHistoPrets, "val" & i)  
                        col.DataField = "val" & i  
                        col.HeaderText = sLibCol  
                        col.AllowFiltering = _AutoriserFiltrage  
                        col.ItemStyle.HorizontalAlign = HorizontalAlign.Left  
                        GrilleHistoPrets.MasterTableView.Columns.Add(col)  
                    Case "DF" 
                        Dim col As New CustomFilterForDateGridColumn(ListeLigneHistoPrets, "valD" & i)  
                        col.DataField = "valD" & i  
                        col.DataType = GetType(System.DateTime)  
                        col.DataFormatString = "{0:dd/MM/yyyy}" 
                        col.HeaderText = sLibCol  
                        col.AllowFiltering = _AutoriserFiltrage  
                        col.ItemStyle.HorizontalAlign = HorizontalAlign.Left  
                        GrilleHistoPrets.MasterTableView.Columns.Add(col)  
                End Select 
                i += 1  
            End While 
        End If 
    End Sub 

The CustomFilterForDateGridColumn class :
Imports Telerik.Web.UI  
 
Public Class CustomFilterForDateGridColumn  
    Inherits GridBoundColumn  
 
    Private _DataTable As List(Of PODCompteEntite)  
    Private _DataField As String 
    Private Property _DateDebut() As String 
        Get 
            Return CStr(System.Web.HttpContext.Current.Session("DateDebut" & Me.UniqueName))  
        End Get 
        Set(ByVal value As String)  
            System.Web.HttpContext.Current.Session("DateDebut" & Me.UniqueName) = value  
        End Set 
    End Property 
    Private Property _DateFin() As String 
        Get 
            Return CStr(System.Web.HttpContext.Current.Session("DateFin" & Me.UniqueName))  
        End Get 
        Set(ByVal value As String)  
            System.Web.HttpContext.Current.Session("DateFin" & Me.UniqueName) = value  
        End Set 
    End Property 
 
    Public Sub New(ByVal pDataTable As List(Of PODCompteEntite), ByVal pDataField As String)  
        _DataTable = pDataTable  
        _DataField = pDataField  
    End Sub 
 
    Protected Overrides Sub SetupFilterControls(ByVal cell As System.Web.UI.WebControls.TableCell)  
        MyBase.SetupFilterControls(cell)  
        cell.Controls.RemoveAt(0)  
        Dim dateDebut As New RadDatePicker()  
        dateDebut.ID = "dateDebut" & Me.UniqueName  
        dateDebut.Width = Unit.Pixel(100)  
        dateDebut.AutoPostBack = False 
        Dim dateFin As New RadDatePicker()  
        dateFin.ID = "dateFin" & Me.UniqueName  
        dateFin.Width = Unit.Pixel(100)  
        dateFin.AutoPostBack = False 
        Dim sChargement As String = "" 
        SessionsConfig.GetConfTextes("TexteChargementEnCours", sChargement)  
        cell.Controls.AddAt(0, New LiteralControl("<div align=""right"">De "))  
        cell.Controls.AddAt(1, dateDebut)  
        cell.Controls.AddAt(2, New LiteralControl("</div>"))  
        cell.Controls.AddAt(3, New LiteralControl("<div align=""right"">A "))  
        cell.Controls.AddAt(4, dateFin)  
        cell.Controls.AddAt(5, New LiteralControl("</div>"))  
        cell.Controls.AddAt(6, New LiteralControl("<div align=""right"">"))  
        Dim btnFiltrer As New ImageButton  
        btnFiltrer.ID = "btnFiltrer" & Me.UniqueName  
        cell.Controls.AddAt(7, btnFiltrer)  
         cell.Controls.AddAt(8, New LiteralControl("</div>"))  
        cell.Controls.RemoveAt(9)  
    End Sub 
 
    Protected Overrides Sub SetCurrentFilterValueToControl(ByVal cell As System.Web.UI.WebControls.TableCell)  
        MyBase.SetCurrentFilterValueToControl(cell)  
        Dim dateDebut As RadDatePicker = CType(cell.Controls(1), RadDatePicker)  
        If _DateDebut <> String.Empty Then 
            dateDebut.SelectedDate = Date.Parse(_DateDebut)  
        End If 
        Dim dateFin As RadDatePicker = CType(cell.Controls(4), RadDatePicker)  
        If _DateFin <> String.Empty Then 
            dateFin.SelectedDate = Date.Parse(_DateFin)  
        End If 
    End Sub 
 
    Protected Overrides Function GetCurrentFilterValueFromControl(ByVal cell As System.Web.UI.WebControls.TableCell) As String 
        Dim sDate As String = String.Empty  
        _DateDebut = String.Empty  
        _DateFin = String.Empty  
        Dim dateDebut As RadDatePicker = CType(cell.Controls(1), RadDatePicker)  
        Dim dateFin As RadDatePicker = CType(cell.Controls(4), RadDatePicker)  
        If Not IsNothing(dateDebut.SelectedDate) Then 
            sDate = dateDebut.SelectedDate.ToString()  
            _DateDebut = dateDebut.SelectedDate.ToString()  
        End If 
        If Not IsNothing(dateFin.SelectedDate) Then 
            _DateFin = dateFin.SelectedDate.ToString()  
            sDate = dateFin.SelectedDate.ToString()  
        End If 
        Return sDate  
    End Function 
 
    Private Sub BoutonFiltrer_Command(ByVal sender As ObjectByVal e As CommandEventArgs)  
        Dim filterItem As GridFilteringItem = CType(CType(sender, ImageButton).NamingContainer, GridFilteringItem)  
        filterItem.FireCommandEvent("Filter"New Pair("GreaterThan"Me.UniqueName))  
    End Sub 
End Class 
 

Schlurk
Top achievements
Rank 2
 answered on 05 Mar 2010
1 answer
69 views
Hey guys,

I want to change the time increments of my day view to 15 minutes. I set MinutesPerRow to 15 and TimeLabelRowSpan to 4. I noticed that my rows were too big so I set my RowHeight to 10px. 

The issue that I am having is when you make an appointment, the blocked off time does not visually represent the actual time blocked off. So, when I block off 12pm-1pm for a meeting, the appointment that shows up on the view does not entirely fill up the 12pm-1pm time slot. 

What am I doing wrong?

Peter
Telerik team
 answered on 05 Mar 2010
1 answer
185 views
Hi all,

I have some trouble about FileExplorer. I like file explorer and decided to use in my web app.

This is my issue:

I need to create folders and file lists programmatically. Beacuse user's files and folders recorded at database. There no physical folder or files.

How can I do this. I found something about this. I tried to use Treeview attributes to solve my problem but I failed.

Please I need help.
Thanks.
Fiko
Telerik team
 answered on 05 Mar 2010
1 answer
79 views
I have been tasked with solving an issue we have with a radeditor control.

We use the editor to build and save documents. Basically when you select a block of text within the editor to style, say font courier, size 5px the style is applied but once you click save and move away from the screen and then return the styling has not been applied. This only happens in IE. I have tried updating the telerik version to the latest but this did not solve the issue.

Any pointers will be greatly appreciated.
Rumen
Telerik team
 answered on 05 Mar 2010
3 answers
73 views
Hi,

I am having an odd problem with the slider.  As of right now, the slider is working as expected and everything seems to be fine.  However, when I go to resize the page the radpane the slider is in displays the vertical scrollbar and when I go to scroll down, the slider stays "sticks" to where it is and does not move down with the rest of the content.  The div it is within on the pane is not set to float or absolute, but just a plain div.  When I maximize the window back, the control still does not show up where it is supposed to until I refresh the window.

Also, with regards to the radpanes, when I resize the window and then refresh, every now and then the panes from the masterpage seem to have a problem with sizing correctly again to the new size unless I either re-navigate back to the URL or resize the window again (bigger or smaller).  Has anyone seen this either?

Thanks,
Ron
Tsvetie
Telerik team
 answered on 05 Mar 2010
1 answer
164 views
Hi,

I have been evaluating the Scheduler control for a client. The specific bit I'm interested in is the time line with time across, and resources down the side.

The client requires multiple days to be visible, but still have control over timing, and I have found that half hour resolution with lot's of time slots serves this purpose quite well.

The problem is that they only work from 8am to 6pm and thus, most of the time is irrelevant to their operations, I can change the colour of dead time, but that still leaves 2/3 of the screen dedicated to irrelevant time. I have also tried hiding cells, but that breaks drag and drop, I also can't work out how to hide the column headers.

The question is, can i get the timeline to skip non-working time, as the day view and week view does?

Best Regards,

Mark
Peter
Telerik team
 answered on 05 Mar 2010
1 answer
125 views
Hi,

Is it possible to enable/ disable particular row in radgrid server side?

While binding I am selecting some rows , and don't want user to deselect them (some of the rows).
How can I disable specific row?
Princy
Top achievements
Rank 2
 answered on 05 Mar 2010
2 answers
132 views
I have a RadGrid named gvConcurrence that has an Edit Template with button called btnUpdate.  When I click on the button It does not hit my OnInsertCommand="gvConcurrence_InsertCommand".  If I hit the btnUpdate again it then goes into my OnInsertCommand="gvConcurrence_InsertCommand".  Why is it skipping on my first hit of the btnUpdate?  Here is the template section with the button and below that is my full aspx and aspx.cs. Oh and by the way the Grid is in a user control but I don't believe that should be the reason why it does not fire on first hit.  Or maybe that's my answer.  Anyhow...here you go.
 
<EditFormSettings EditFormType="Template">   
    <FormTemplate>   
        <table id="Table2" cellspacing="2" cellpadding="1" border="0" rules="none"   
            style="border-collapse: collapse; background: white;">   
            <tr>   
                <td colspan="2" style="font-size: small">   
                    <b>Add Additional Concurrence</b>   
                </td>   
            </tr>   
            <tr>   
                <td>   
                    <asp:DropDownList ID="ddlConcur" runat="server">   
                        <asp:ListItem>Approve</asp:ListItem>   
                        <asp:ListItem>Disapprove</asp:ListItem>   
                        <asp:ListItem>Abstain</asp:ListItem>   
                    </asp:DropDownList>   
                </td>   
                <td valign="top">   
                    <telerik:RadTextBox Width="195px" ID="txtComments" runat="server" TextMode="MultiLine"   
                        Label="Comments: " EmptyMessage="Enter Comments Here" AutoPostBack="true" >   
                    </telerik:RadTextBox>   
                </td>   
            </tr>      
                                       
            <tr>   
                <td align="right" colspan="2">   
                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'   
                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>   
                    </asp:Button>&nbsp;   
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"   
                    CommandName="Cancel"></asp:Button></td>   
            </tr>   
        </table>   
    </FormTemplate>   
</EditFormSettings>   
 
Full aspx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Concurrence.ascx.cs" Inherits="AMC.OnlineSCR.Web.UserControls.Concurrence" %>   
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>   
<asp:LoginName ID="LoginName1" Visible="false" runat="server" />    
<telerik:RadGrid ID="gvConcurrence"    
    runat="server"    
    Width="96%"    
    GridLines="None"   
    AutoGenerateColumns="False"    
    PageSize="13"    
    AllowSorting="True"    
    AllowPaging="True"    
    OnNeedDataSource="gvConcurrence_NeedDataSource"   
    ShowStatusBar="true"    
    OnInsertCommand="gvConcurrence_InsertCommand"    
    OnDeleteCommand="gvConcurrence_DeleteCommand"   
    OnItemDataBound="gvConcurrence_ItemDataBound"   
    OnEditCommand="gvConcurrence_EditCommand">   
        <MasterTableView DataKeyNames="CONCURRENCE_ID"    
            AllowMultiColumnSorting="True"    
            Width="100%"   
            CommandItemDisplay="Top">   
        <Columns>   
            <telerik:GridButtonColumn UniqueName="DeleteColumn"    
                Text="Delete"    
                CommandName="Delete" />   
            <telerik:GridBoundColumn UniqueName="CONCURRENCE_ID"    
                SortExpression="CONCURRENCE_ID"    
                HeaderText="CONCURRENCE ID"   
                DataField="CONCURRENCE_ID"   
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="SCRID"    
                SortExpression="SCRID"    
                HeaderText="SCR ID"   
                DataField="SCRID"   
                Display="false" />   
            <telerik:GridBoundColumn UniqueName="CONCURRENCE"    
                SortExpression="CONCURRENCE"    
                HeaderText="Concurrence"   
                DataField="CONCURRENCE" />   
            <telerik:GridBoundColumn UniqueName="COMMENTS"    
                SortExpression="COMMENTS"    
                HeaderText="Comments"   
                DataField="COMMENTS" />   
            <telerik:GridBoundColumn UniqueName="USER_ID"    
                SortExpression="USER_ID"    
                HeaderText="User ID"   
                DataField="USER_ID"   
                Display="false" />   
            <telerik:GridBoundColumn UniqueName="USER_NAME"    
                SortExpression="USER_NAME"    
                HeaderText="User Name"   
                DataField="USER_NAME" />   
            <telerik:GridBoundColumn UniqueName="FIRST_NAME"    
                SortExpression="FIRST_NAME"    
                HeaderText="First Name"   
                DataField="FIRST_NAME" />   
            <telerik:GridBoundColumn UniqueName="LAST_NAME"    
                SortExpression="LAST_NAME"    
                HeaderText="Last Name"   
                DataField="LAST_NAME" />   
            <telerik:GridBoundColumn UniqueName="POSITION_TITLE"    
                SortExpression="POSITION_TITLE"    
                HeaderText="POSITION_TITLE"   
                DataField="POSITION_TITLE" />   
            <telerik:GridBoundColumn UniqueName="ADDRESS"    
                SortExpression="ADDRESS"    
                HeaderText="Address"   
                DataField="ADDRESS"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="CITY"    
                SortExpression="CITY"    
                HeaderText="City"   
                DataField="CITY"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="STATE"    
                SortExpression="STATE"    
                HeaderText="State"   
                DataField="STATE"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="ZIP"    
                SortExpression="ZIP"    
                HeaderText="Zip"   
                DataField="ZIP"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="PHONE"    
                SortExpression="PHONE"    
                HeaderText="Phone"   
                DataField="PHONE"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="EXTENSION"    
                SortExpression="EXTENSION"    
                HeaderText="Extension"   
                DataField="EXTENSION"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="BASE_ID"    
                SortExpression="BASE_ID"    
                HeaderText="Base ID"   
                DataField="BASE_ID"   
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="CODE"    
                SortExpression="CODE"    
                HeaderText="Base Code"   
                DataField="CODE"/>   
            <telerik:GridBoundColumn UniqueName="GEOLOC_NAME"    
                SortExpression="GEOLOC_NAME"    
                HeaderText="Geo Loc Name"   
                DataField="GEOLOC_NAME"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="COMMAND"    
                SortExpression="COMMAND"    
                HeaderText="Command"   
                DataField="COMMAND"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="UNIT_DEPARTMENT"    
                SortExpression="UNIT_DEPARTMENT"    
                HeaderText="Unit/Department"   
                DataField="UNIT_DEPARTMENT"    
                Display="false"/>   
            <telerik:GridBoundColumn UniqueName="EMAIL"    
                SortExpression="EMAIL"    
                HeaderText="Email"   
                DataField="EMAIL" />   
        </Columns>   
        <EditFormSettings EditFormType="Template">   
            <FormTemplate>   
                <table id="Table2" cellspacing="2" cellpadding="1" border="0" rules="none"   
                    style="border-collapse: collapse; background: white;">   
                    <tr>   
                        <td colspan="2" style="font-size: small">   
                            <b>Add Additional Concurrence</b>   
                        </td>   
                    </tr>   
                    <tr>   
                        <td>   
                            <asp:DropDownList ID="ddlConcur" runat="server">   
                                <asp:ListItem>Approve</asp:ListItem>   
                                <asp:ListItem>Disapprove</asp:ListItem>   
                                <asp:ListItem>Abstain</asp:ListItem>   
                            </asp:DropDownList>   
                        </td>   
                        <td valign="top">   
                            <telerik:RadTextBox Width="195px" ID="txtComments" runat="server" TextMode="MultiLine"   
                                Label="Comments: " EmptyMessage="Enter Comments Here" AutoPostBack="true" >   
                            </telerik:RadTextBox>   
                        </td>   
                    </tr>      
                                               
                    <tr>   
                        <td align="right" colspan="2">   
                            <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'   
                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>   
                            </asp:Button>&nbsp;   
                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"   
                            CommandName="Cancel"></asp:Button></td>   
                    </tr>   
                </table>   
            </FormTemplate>   
        </EditFormSettings>   
    </MasterTableView>   
</telerik:RadGrid>  
Full aspx.cs
using System;   
using System.Collections;   
using System.ComponentModel;   
using System.Data;   
using System.Drawing;   
using System.Web;   
using System.Web.SessionState;   
using System.Web.UI;   
using System.Web.UI.WebControls;   
using System.Web.UI.HtmlControls;   
using AMC.OnlineSCR.BusinessLayer.BusinessObjects;   
using AMC.OnlineSCR.BusinessLayer.Facade;   
using AMC.OnlineSCR.Web.Components;   
using Telerik.Web.UI;   
using G081.WebLogin.CustomProviders;   
using System.Web.Security;   
   
namespace AMC.OnlineSCR.Web.UserControls   
{   
    public partial class Concurrence : System.Web.UI.UserControl   
    {   
        private IApprovalsDataFacade approvalsFacade = new ApprovalsDataFacade();   
        private IUsersDataFacade userFacade = new UsersDataFacade();   
        int m_ConcurrenceID;   
        int m_SCRID;   
   
        public int ConcurrenceID   
        {   
            get { return m_ConcurrenceID; }   
            set { m_ConcurrenceID = value; }   
        }   
   
        public int SCRID   
        {   
            get { return m_SCRID; }   
            set { m_SCRID = value; }   
        }   
   
        public DataSet ConcurrenceData   
        {   
            get   
            {   
                DataSet ds = approvalsFacade.GetApprovalsBySCRID(m_SCRID);   
                return ds;   
            }   
        }   
   
        protected void Page_PreRender(object sender, System.EventArgs e)   
        {   
            if (!this.IsPostBack)   
            {   
                this.gvConcurrence.MasterTableView.Rebind();   
            }   
        }   
   
        protected void CheckBox1_CheckedChanged(object sender, System.EventArgs e)   
        {   
            //this.gvPrograms.AllowMultiRowEdit = this.CheckBox1.Checked;   
            this.gvConcurrence.Rebind();   
        }   
   
        protected void gvConcurrence_NeedDataSource(object source, GridNeedDataSourceEventArgs e)   
        {   
            this.gvConcurrence.DataSource = this.ConcurrenceData;   
        }   
   
        protected void gvConcurrence_InsertCommand(object source, GridCommandEventArgs e)   
        {   
            MembershipUser user = Membership.GetUser();   
            string userName = user.UserName.ToString();   
            DataSet userInfo = userFacade.GetUserWithInfoByUserName(userName.ToUpper());   
            int userID = Convert.ToInt16(userInfo.Tables[0].Rows[0]["USER_ID"].ToString());   
            UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);   
            DropDownList ddlConcur = (DropDownList)e.Item.FindControl("ddlConcur");   
            string concur = ddlConcur.SelectedValue.ToString();   
            RadTextBox txtComments = (RadTextBox)e.Item.FindControl("txtComments");   
            string comments = txtComments.Text;   
              
            // use 0 for concurrenceID so that you can insert a new record   
            approvalsFacade.insertApprovalsBySCRID(SCRID, 0, userID, concur, comments);   
        }   
   
        protected void gvConcurrence_EditCommand(object source, GridCommandEventArgs e)   
        {   
            //e is the event argument object   
            if (e.Item is GridDataItem)   
            {   
                GridDataItem dataItem = e.Item as GridDataItem;   
                int ConcurrenceID = Convert.ToInt16(dataItem["Concurrence_ID"].Text);   
                int scrID = Convert.ToInt16(dataItem["SCRID"].Text);   
                MembershipUser user = Membership.GetUser();   
                string userName = user.UserName.ToString();   
                DataSet userInfo = userFacade.GetUserWithInfoByUserName(userName.ToUpper());   
                int userID = Convert.ToInt16(userInfo.Tables[0].Rows[0]["USER_ID"].ToString());   
                UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);   
                DropDownList ddlConcur = (DropDownList)e.Item.FindControl("ddlConcur");   
                string concur = ddlConcur.SelectedValue.ToString();   
                RadTextBox txtComments = (RadTextBox)e.Item.FindControl("txtComments");   
                string comments = txtComments.Text;   
   
                approvalsFacade.insertApprovalsBySCRID(scrID, ConcurrenceID, userID, concur, comments);   
   
            }   
            else if (e.Item is GridEditFormItem)   
            {   
                GridEditFormItem editItem = e.Item as GridEditFormItem;   
                int ConcurrenceID = Convert.ToInt16(editItem["Concurrence_ID"].Text);   
                int scrID = Convert.ToInt16(editItem["SCRID"].Text);   
                MembershipUser user = Membership.GetUser();   
                string userName = user.UserName.ToString();   
                DataSet userInfo = userFacade.GetUserWithInfoByUserName(userName.ToUpper());   
                int userID = Convert.ToInt16(userInfo.Tables[0].Rows[0]["USER_ID"].ToString());   
                UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);   
                DropDownList ddlConcur = (DropDownList)e.Item.FindControl("ddlConcur");   
                string concur = ddlConcur.SelectedValue.ToString();   
                RadTextBox txtComments = (RadTextBox)e.Item.FindControl("txtComments");   
                string comments = txtComments.Text;   
   
                approvalsFacade.insertApprovalsBySCRID(scrID, ConcurrenceID, userID, concur, comments);   
            }   
        }   
   
        protected void gvConcurrence_DeleteCommand(object source, GridCommandEventArgs e)   
        {   
            //e is the event argument object   
            if (e.Item is GridDataItem)   
            {   
                GridDataItem dataItem = e.Item as GridDataItem;   
                int ConcurrenceID = Convert.ToInt16(dataItem["Concurrence_ID"].Text);   
                approvalsFacade.DeleteApprovalsByConcID(ConcurrenceID);   
   
            }   
            else if (e.Item is GridEditFormItem)   
            {   
                GridEditFormItem editItem = e.Item as GridEditFormItem;   
            }   
   
        }   
   
        private void Page_Load(object sender, System.EventArgs e)   
        {   
            if (!Page.IsPostBack)   
            {   
            }   
        }   
   
        protected void gvConcurrence_ItemDataBound(object sender, GridItemEventArgs e)   
        {   
            //e is the event argument object   
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode)   
            {   
                GridEditFormItem item = (GridEditFormItem)e.Item;   
            }   
            else if (e.Item is GridEditFormItem)   
            {   
                GridEditFormItem editItem = e.Item as GridEditFormItem;   
            }   
        }   
   
    }   
}   
  
Stephen Kumor
Top achievements
Rank 1
 answered on 05 Mar 2010
2 answers
161 views
Hi,

I have an ASP.NET Wizard.  On the first screen, when user select a specific dropdownlist value, I want to put a custom Telerik radconfirm before it goes to next wizard step.  I can't get this thing to work.  Can someone please help me?  Thank you.

 <asp:Wizard ID="wzdJob" runat="server" ActiveStepIndex="0"                          
    DisplayCancelButton="true" Height="250px" Width="550px">  
        <WizardSteps>  
             <asp:WizardStep ID="wzs1" StepType="Start" Title="Step 1" runat="server">  
                      <asp:dropdownlist runat="server" id="ddlDeviceType" />  
             </asp:WizardStep>  
            <asp:WizardStep ID="wzs2" StepType="Step" Title="Step 2" runat="server">  
                       Step 2  
             </asp:WizardStep>  
      </WizardSteps>  
        
</asp:Wizard>  
          
Private Sub ddlDeviceType_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles ddlDeviceType.SelectedIndexChanged  
 
       If ddlDeviceType.SelectedValue = "SpecificValue" Then 
            Dim nextbtn As Button  
 
            nextbtn = wzdJob.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton")  
 
            nextbtn.OnClientClick = "radconfirm('** Warning Message, proceed? **', CallBackFn, 400, 100);" 
 
        End If 
 
 
    End Sub 
 function CallBackFn(args) {  
 
 
            if (args == true) {  
                //Move to Wizard Step 2             
            } else {  
                //Do nothing  
            }  
              
             
        
        } 
Pei Chen
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
102 views
You can see this issue on the telerik demo page here:


Set the minutes per row to 15 (or lower) and alter the breakfast appointment to be from 6:00 am to 10:00 pm.

Change the view to 24 hour view. 

Notice the blue box representing the appointment is drawn correctly up to the 6:00 PM line but there is still the "bottom line" of the box at the 10:00 pm mark but the gap between 6:00 pm and 10:00pm appears blank as if the breakfast appointment does not extend all the way until 10:00 pm.

Since it appears on the demo site i am assuming that this is a known bug. I have tried various search terms here in the forums but I cannot seem to find a reference to this bug or a solution.

If you choose to set minutes per row to 10 minutes the display issue gets worse as the appointment gets cut off at 2 pm. So it appears that an appointment can only have a maximum number of lines drawn.

Another way to demonstrate the bug is to un-check "All-Day Row" and then change the minutes per row value and notice how the "all-day" appointment is drawn, any value under 30 minutes causes a problem.

Any way around this? Is the fix in the next release?  

This has confused and annoyed a lot of my users as they recently requested 15 minute timeslots and now their long time blocks are not visually useful.

Any help or a point toward a post already dealing with this is greatly appreciated

Thanks all!


Peter
Telerik team
 answered on 05 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?