Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
71 views
Hi,
I am struck with a problem that i want to achieve self referencing hierarchy using rad grid but when i bind grid with data source with grid it bind records but  not correctly.
For example Emp1 has null parent and emp2 has parent value of emp1. so records must be look like as follow
emp1
   emp2

but it shows like follow
emp1
    emp2
emp2

Look emp2 display as child as parent as well. which is not correct format. i dont know what i am missing.

I am following complete example given in below link http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/selfreferencing/defaultcs.aspx

Please help...

one more question that is it possible to implement paging in self hierarchy grid????????


waiting for your reply... thanks in advance..
Pavlina
Telerik team
 answered on 22 Sep 2010
2 answers
183 views
version 2009.3.1208 35
Followed the 'getting started' fairly closely. Used the object data source method. Obviously I needed to deviate to a persisted datasource. I also needed to add a couple resources. Location/room and User. Once again followed very closely the dataset schema design.
ok so here we are:
Every time I go to edit the appt. both the location and user resource are not selected to their respective values. ie 1,3. I can confirm that the data is good.
im using a sql datasource exactly as the demos show here to populate dropdowns..which they do: http://demos.telerik.com/aspnet-ajax/scheduler/examples/resources/defaultvb.aspx

When I move the appt I notice it posts back to update the event. I find all the items in the updateAppt except the user and room. i have extended the apptInfo class. I ended up rewriting to check if it was nothing then leave it what it used to be.

Can anyone tell me what might the issue be?
html
<telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="End" 
         DataKeyField="ID" DataRecurrenceField="RecurrenceRule" 
         DataRecurrenceParentKeyField="RecurrenceParentID" StartInsertingInAdvancedForm="true" StartEditingInAdvancedForm="true" 
         DataSourceID="ObjectDataSource1" DataStartField="Start" ShowFooter="false" MinutesPerRow="15" DayStartTime="7:00" DayEndTime="21:00"
         DataSubjectField="Subject">
          <ResourceTypes>
                 <telerik:ResourceType KeyField="LocID" Name="Room" TextField="LocCity" ForeignKeyField="RoomID"
                     DataSourceID="DS_Locations" />
                 <telerik:ResourceType KeyField="UserID" Name="User" TextField="UserFName" ForeignKeyField="UserID"
                     DataSourceID="DS_Users" />
             </ResourceTypes>
     </telerik:RadScheduler>
   
 <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
     DeleteMethod="DeleteAppointment" InsertMethod="InsertAppointment" 
     SelectMethod="AllData" TypeName="AppointmentList" 
     UpdateMethod="UpdateAppointment">
     <DeleteParameters>
         <asp:Parameter Name="ID" Type="String" />
     </DeleteParameters>
     <InsertParameters>
         <asp:Parameter Name="Subject" Type="String" />
         <asp:Parameter Name="Start" Type="DateTime" />
         <asp:Parameter Name="End" Type="DateTime" />
         <asp:Parameter Name="RecurrenceRule" Type="String" />
         <asp:Parameter Name="RecurrenceParentID" Type="Object" />
         <asp:Parameter Name="RecurrenceState" Type="Object" />
         <asp:Parameter Name="RoomID" Type="Int32" />
         <asp:Parameter Name="UserID" Type="Int32" />
           
     </InsertParameters>
     <UpdateParameters>
         <asp:Parameter Name="ID" Type="String" />
         <asp:Parameter Name="Subject" Type="String" />
         <asp:Parameter Name="Start" Type="DateTime" />
         <asp:Parameter Name="End" Type="DateTime" />
         <asp:Parameter Name="RecurrenceRule" Type="String" />
         <asp:Parameter Name="RecurrenceParentID" Type="Object" />
         <asp:Parameter Name="RecurrenceState" Type="Object" />
         <asp:Parameter Name="RoomID" Type="Int32" />
         <asp:Parameter Name="UserID" Type="Int32" />
     </UpdateParameters>
 </asp:ObjectDataSource>
 <br />
 <asp:SqlDataSource ID="DS_Users" runat="server" 
     ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
     SelectCommand="SELECT * FROM [Tbl_Users]"></asp:SqlDataSource>
 <asp:SqlDataSource ID="DS_Locations" runat="server" 
     ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
     SelectCommand="SELECT * FROM [Tbl_Locations]"></asp:SqlDataSource>

AppointmentList.vb
  Public Shared Function buildSess() As List(Of AppointmentInfo)
        Dim dt As DataTable = New DataTable
  
        Using con As New SqlConnection(ConfigurationManager.ConnectionStrings("ApplicationServices").ToString)
  
            Dim da As New SqlDataAdapter()
            da.SelectCommand = New SqlCommand("Select * from Appointments", con)
            da.Fill(dt)
            Dim sessApts As List(Of AppointmentInfo) = New List(Of AppointmentInfo)()
            For Each row In dt.Rows
                Dim ai As New AppointmentInfo(row.Item("Subject"), row.Item("Start"), row.Item("End"))
                ai.ID = row.item("ApptGuid")
                ai.RecurrenceRule = row.item("RecurrenceRule").ToString
                ai.RecurrenceParentID = CType(row.item("RecurrenceParentID"), [Object])
                ai.RoomID = row.item("RoomID").ToString
                ai.UserID = row.item("UserID").ToString
                sessApts.Add(ai)
            Next
            Return sessApts
        End Using
    End Function
  
    Public Shared Function AllData() As List(Of AppointmentInfo)
        Return buildSess()
        '    Dim sessApts As List(Of AppointmentInfo) = TryCast(HttpContext.Current.Session(AppointmentsKey), List(Of AppointmentInfo))
        'Dim sessApts As List(Of AppointmentInfo) = TryCast(HttpContext.Current.Session(AppointmentsKey), List(Of AppointmentInfo))
        'If sessApts Is Nothing Then
        '    sessApts = buildSess() ' New List(Of AppointmentInfo)()
        '    HttpContext.Current.Session(AppointmentsKey) = sessApts
        'End If
        'Return sessApts
    End Function
    Public Shared Sub InsertAppointment(ByVal Subject As String, ByVal Start As DateTime, ByVal [End] As DateTime, _
                                        ByVal RecurrenceRule As String, ByVal RecurrenceParentID As [Object], _
                                        ByVal RecurrenceState As Telerik.Web.UI.RecurrenceState, ByVal RoomID As Int32, ByVal UserID As Int32)
        '   Dim sessApts As List(Of AppointmentInfo) = AllData()
        Dim ai As New AppointmentInfo(Subject, Start, [End])
        ai.RecurrenceRule = RecurrenceRule
        ai.RecurrenceParentID = RecurrenceParentID
        ai.RecurrenceState = RecurrenceState
        ai.RoomID = RoomID
        ai.UserID = UserID
        '    sessApts.Add(ai)
  
  
        Dim guid As String = ai.ID
        'add it to the db
        Dim SQL As String = "INSERT INTO Appointments " & _
"  ([Subject]" & _
", [Description]" & _
", [Start]" & _
", [End]" & _
", [RecurrenceRule]" & _
", [RecurrenceParentID]" & _
", [Reminder]" & _
", [Annotations], ApptGuid, RoomID, UserID) " & _
"  VALUES (" & _
"  @Subject" & _
", @Description" & _
", @Start" & _
", @End" & _
", @RecurrenceRule" & _
", @RecurrenceParentID" & _
", @Reminder" & _
", @Annotations, @ApptGuid, @RoomID, @UserID)"
  
        ' RecurrenceParentID.ToString = Nothing
        Using con As New SqlConnection(ConfigurationManager.ConnectionStrings("ApplicationServices").ToString)
            Dim cmd As New SqlCommand
            cmd.CommandText = SQL
            cmd.Connection = con
            cmd.Parameters.Add("@Subject", Data.SqlDbType.NVarChar).Value = Subject
            cmd.Parameters.Add("@Description", Data.SqlDbType.NVarChar).Value = ""
            cmd.Parameters.Add("@Start", Data.SqlDbType.DateTime).Value = Start
            cmd.Parameters.Add("@End", Data.SqlDbType.DateTime).Value = [End]
            cmd.Parameters.Add("@RecurrenceRule", Data.SqlDbType.NVarChar).Value = IIf(IsNothing(RecurrenceRule), System.Data.SqlTypes.SqlString.Null, RecurrenceRule)
            cmd.Parameters.Add("@RecurrenceParentID", Data.SqlDbType.Int).Value = IIf(RecurrenceParentID Is Nothing, System.Data.SqlTypes.SqlInt32.Null, GetParentID(RecurrenceParentID))
            cmd.Parameters.Add("@Reminder", Data.SqlDbType.NVarChar).Value = ""
            cmd.Parameters.Add("@Annotations", Data.SqlDbType.NVarChar).Value = ""
            cmd.Parameters.Add("@ApptGuid", Data.SqlDbType.NVarChar).Value = guid
            cmd.Parameters.Add("@RoomID", SqlDbType.Int).Value = IIf(IsNumeric(RoomID) = False, SqlTypes.SqlInt32.Null, RoomID)
            cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = IIf(IsNumeric(UserID) = False, SqlTypes.SqlInt32.Null, UserID)
            '  cmd.Parameters.Add("@RecurrenceState", Data.SqlDbType.NVarChar).Value = IIf(RecurrenceState.NotRecurring, System.Data.SqlTypes.SqlString.Null, RecurrenceState)
            cmd.Connection.Open()
            cmd.ExecuteNonQuery()
        End Using
  
    End Sub
    Public Shared Sub DeleteAppointment(ByVal ID As String)
        Dim sessApts As List(Of AppointmentInfo) = AllData()
        sessApts.Remove(FindById(ID, sessApts))
  
        Using con As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("ApplicationServices").ToString)
            Dim cmd As New SqlCommand("Delete from Appointments where ApptGuid = @ID", con)
            cmd.Parameters.Add("@ID", SqlDbType.NVarChar).Value = ID
            cmd.Connection.Open()
            cmd.ExecuteNonQuery()
        End Using
  
  
    End Sub
    Public Shared Sub UpdateAppointment(ByVal ID As String, ByVal Subject As String, ByVal Start As DateTime, ByVal [End] As DateTime, ByVal RecurrenceRule As String, ByVal RecurrenceParentID As [Object], _
     ByVal RecurrenceState As Telerik.Web.UI.RecurrenceState, ByVal RoomID As Int32, ByVal UserID As Int32)
        Dim sessApts As List(Of AppointmentInfo) = AllData()
        Dim ai As AppointmentInfo = FindById(ID, sessApts)
        ai.Subject = Subject
        ai.Start = Start
        ai.[End] = [End]
        ai.RecurrenceRule = RecurrenceRule
        ai.RecurrenceParentID = RecurrenceParentID
        ai.RecurrenceState = RecurrenceState
        ai.RoomID = IIf(RoomID = 0, ai.RoomID, RoomID)
        ai.UserID = IIf(UserID = 0, ai.UserID, UserID)
  
        Dim SQL As String = "Update Appointments set subject = @subject, [start] = @start, [end] = @end " & _
            " , RecurrenceRule = @RecurrenceRule, RecurrenceParentID = @RecurrenceParentID, RoomID = @RoomID, UserID = @UserID where ApptGuid = @ApptGuid"
        Using con As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("ApplicationServices").ToString)
            Dim cmd As SqlCommand = New SqlCommand(SQL, con)
            cmd.Parameters.Add("@Subject", Data.SqlDbType.NVarChar).Value = Subject
            cmd.Parameters.Add("@Description", Data.SqlDbType.NVarChar).Value = ""
            cmd.Parameters.Add("@Start", Data.SqlDbType.DateTime).Value = Start
            cmd.Parameters.Add("@End", Data.SqlDbType.DateTime).Value = [End]
            cmd.Parameters.Add("@RecurrenceRule", Data.SqlDbType.NVarChar).Value = IIf(RecurrenceRule = Nothing, System.Data.SqlTypes.SqlString.Null, RecurrenceRule)
            cmd.Parameters.Add("@RecurrenceParentID", Data.SqlDbType.Int).Value = IIf(RecurrenceParentID = Nothing, System.Data.SqlTypes.SqlInt32.Null, GetParentID(RecurrenceParentID))
            cmd.Parameters.Add("@Reminder", Data.SqlDbType.NVarChar).Value = ""
            cmd.Parameters.Add("@Annotations", Data.SqlDbType.NVarChar).Value = ""
            cmd.Parameters.Add("@ApptGuid", Data.SqlDbType.NVarChar).Value = ai.ID
            cmd.Parameters.Add("@RoomID", SqlDbType.Int).Value = IIf(ai.RoomID = 0, SqlTypes.SqlInt32.Null, ai.RoomID)
            cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = IIf(ai.UserID = 0, SqlTypes.SqlInt32.Null, ai.UserID)
            cmd.Connection.Open()
            cmd.ExecuteNonQuery()
  
  
        End Using
  
  
  
  
    End Sub
    Public Shared Function FindById(ByVal ID As String, ByVal sessApts As List(Of AppointmentInfo)) As AppointmentInfo
        For Each ai As AppointmentInfo In sessApts
            If ai.ID = ID Then
                Return ai
            End If
        Next
        Return Nothing
    End Function
  
    Public Shared Function GetParentID(ByVal RecurrenceParentID As String) As Int32
        'Dim i As Int32
        If RecurrenceParentID IsNot Nothing Then
            Using con As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("ApplicationServices").ToString)
                Dim cmd As SqlCommand = New SqlCommand("Select ID from Appointments where ApptGuid = @Guid", con)
                cmd.Parameters.Add("@Guid", SqlDbType.NVarChar).Value = RecurrenceParentID
                cmd.Connection.Open()
                Dim i As Integer = cmd.ExecuteScalar
                Return i
            End Using
        Else
            Return Nothing
        End If
  
        '  Return (cmd.ExecuteScalar)
  
  
    End Function

AppointmentInfo.vb
Private idString As String
Private subj As String
Private startTime As DateTime
Private endTime As DateTime
Private RID As String
Private UID As String
Private recur As String
Private recurParent As Object
Private recurState As RecurrenceState
Public Property RoomID() As String
    Get
        Return RID
    End Get
    Set(ByVal value As String)
        RID = value
    End Set
End Property
Public Property UserID() As String
    Get
        Return UID
    End Get
    Set(ByVal value As String)
        UID = value
    End Set
End Property
Public Property ID() As String
    Get
        Return idString
    End Get
    Set(ByVal value As String)
        idString = value
    End Set
End Property
Public Property Subject() As String
    Get
        Return subj
    End Get
    Set(ByVal value As String)
        subj = value
    End Set
End Property
Public Property Start() As DateTime
    Get
        Return startTime
    End Get
    Set(ByVal value As DateTime)
        startTime = value
    End Set
End Property
Public Property [End]() As DateTime
    Get
        Return endTime
    End Get
    Set(ByVal value As DateTime)
        endTime = value
    End Set
End Property
Public Property RecurrenceRule() As String
    Get
        Return recur
    End Get
    Set(ByVal value As String)
        recur = value
    End Set
End Property
Public Property RecurrenceParentID() As Object
    Get
        Return recurParent
    End Get
    Set(ByVal value As Object)
        recurParent = value
    End Set
End Property
Public Property RecurrenceState() As RecurrenceState
    Get
        Return recurState
    End Get
    Set(ByVal value As RecurrenceState)
        recurState = value
    End Set
End Property
Private Sub New()
    Me.idString = Guid.NewGuid().ToString()
End Sub
Public Sub New(ByVal subject As String, ByVal start As DateTime, ByVal [end] As DateTime)
    Me.New()
    Me.subj = subject
    Me.startTime = start
    Me.endTime = [end]
End Sub

Peter
Telerik team
 answered on 22 Sep 2010
2 answers
160 views

Hi ,

i am using RadDatePicker control and i am getting below error...

Value of '1900-01-01 00:00:00' is not valid for 'SelectedDate'. 'SelectedDate' should be between 'MinDate' and 'MaxDate'.
Parameter name: SelectedDate

while the date is in table is 1900-01-01.

<telerik:RadDatePicker runat="server" DbSelectedDate='<%# Bind("StartDate") %>' 
                                    ID="txtStartDate" style="z-index: 109; left: 90px; position: absolute; 
                                    top: 180px" Width="220px" Skin="Office2007"> 
                                    <DateInput ID="DateInput1" runat="server" DateFormat="yyyy-MM-dd"
                                        ReadOnly="true" Font-Names="Tahoma" Font-Size="12px"></DateInput> 
                        </telerik:RadDatePicker>

waiting for your reply.

Please help.





bharat kumar
Top achievements
Rank 1
 answered on 22 Sep 2010
1 answer
77 views
The company I work still has IE6 as our corporate standard so for internal projects we use it. In one of my projects I have a RadEditor control (v2010.1.415.35 / RadControls for ASP.NET AJAX Q1 2010 SP1) in the page and if I paste in a large amount of content it causes IE6 to crash. This is extremely frustrating. Has anyone run into this?
Dobromir
Telerik team
 answered on 22 Sep 2010
5 answers
332 views
Hello,

I have a Rad Grid that has 27 columns and few of which can be edited. The problem I am having is when I apply Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true" Scrolling-SaveScrollPosition="true" Scrolling-FrozenColumnsCount="3"
on client settings set the width of the grid to "1200px" for the having both horizontal and vertical scrolling I can't see all the columns. When the grid is loaded the first time I can only see till the 'Disburse Date' column and I can't see the Household column when I click the edit column on the edit mode I can barely see the Disburse Date. Any help on this will be greatly appreciated. Here is the aspx code:


<telerik:RadGrid runat="server" ID="rgGridResults" GridLines="None"
                AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="true" AutoGenerateColumns="false"
                ShowGroupPanel="false" ShowFooter="false" Width="1000px"
                OnNeedDataSource="rgGridResults_NeedDataSource"
                OnItemDataBound="rgGridResults_ItemDataBound"
                OnItemCommand="rgGridResults_ItemCommand">
                <ValidationSettings EnableValidation="true" ValidationGroup="vgGrid" />
                <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true" Scrolling-SaveScrollPosition="true" Scrolling-FrozenColumnsCount="3" Resizing-ResizeGridOnColumnResize="true"/>
                <MasterTableView EditMode="InPlace" DataKeyNames="donorid">
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="Edit" UpdateText="Update"
                            CancelText="Cancel"/>
                        <telerik:GridBoundColumn HeaderText="Donor" DataField="name" SortExpression="name"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="Donor ID" DataField="doid" SortExpression="doid"
                            ReadOnly="true" UniqueName="donorid"/>
                        <telerik:GridBoundColumn HeaderText="Spouse" DataField="renid" SortExpression="renid"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="Gift ID" DataField="giftid" SortExpression="giftid"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="Pledge ID" DataField="pledgeid" SortExpression="pledgeid"
                            ReadOnly="true" />
                        <telerik:GridTemplateColumn HeaderText="Credit Date" DataField="credtdat" SortExpression="credtdat" AllowFiltering="true" ReadOnly="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblCredtDat" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn HeaderText="Type" DataField="trantype" SortExpression="trantype"
                            ReadOnly="true"/>
                        <telerik:GridTemplateColumn HeaderText="Legal Amount" DataField="legal_credit" SortExpression="legal_credit" AllowFiltering="true" ReadOnly="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblLegalAmount" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Soft Credit Amount" DataField="soft_credit" SortExpression="soft_credit" AllowFiltering="true" ReadOnly="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblSoftCredit" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>                        
                        <telerik:GridBoundColumn HeaderText="Fund" DataField="fund" SortExpression="fund"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="Fund Name" DataField="fund_name" SortExpression="fund_name"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="College" DataField="college" SortExpression="college"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="Dept" DataField="dept_desc" SortExpression="dept_desc"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="System Review Code" DataField="needs_review_code"
                            SortExpression="needs_review_code" ReadOnly="true" />
                        <telerik:GridBoundColumn HeaderText="System Review Comment" DataField="needs_review_comment"
                            SortExpression="needs_review_comment" ReadOnly="true" />
                        <telerik:GridTemplateColumn HeaderText="Staff Match Eligibe Flag" DataField="fs_me_flag"
                            SortExpression="fs_me_flag">
                            <EditItemTemplate>
                                <asp:RadioButtonList runat="server" ID="rbtnlFSMatchEligible" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblFSMatchEligible" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Staff Match Comment" DataField="fs_me_comment"
                            SortExpression="fs_me_comment" UniqueName="fscomment">
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="tbxFSMatchComment" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblFSMatchComment" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Ren Match Eligible Flag" DataField="scn_me_flag"
                            SortExpression="scn_me_flag">
                            <EditItemTemplate>
                                <asp:RadioButtonList runat="server" ID="rbtnlRenMatchEligible" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblRenMatchEligible" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Ren Match Comment" DataField="scn_me_comment"
                            SortExpression="scn_me_comment">
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="tbxRenMatchComment" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblRenMatchComment" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="BUF Match Eligible Flag" DataField="sce_me_flag"
                            SortExpression="sce_me_flag">
                            <EditItemTemplate>
                                <asp:RadioButtonList runat="server" ID="rbtnlBufMatchEligible" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblBufMatchEligible" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="BUF Match Comment" DataField="sce_me_comment"
                            SortExpression="sce_me_comment">
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="tbxBufMatchComment" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblBufMatchComment" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Fellows Match Eligible FLag" DataField="ff_me_flag"
                            SortExpression="ff_me_flag">
                            <EditItemTemplate>
                                <asp:RadioButtonList runat="server" ID="rbtnlFFMatchEligible" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblFFMatchEligible" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Fellows Match Comment" DataField="ff_me_comment"
                            SortExpression="ff_me_comment">
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="tbxFFMatchComment" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblFFMatchComment" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Encumbered" DataField="match_eligible_amount"
                            SortExpression="match_eligible_amount" ReadOnly="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblEncumbered" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Disbursed" DataField="disburse_amount"
                            SortExpression="disburse_amount" ReadOnly="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblDisbursed" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Disburse Date" DataField="DISBURSE_DATE" SortExpression="DISBURSE_DATE" AllowFiltering="true" ReadOnly="true">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblDisburseDate" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Household" DataField="household_maximum_amt"
                            SortExpression="household_maximum_amt">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblHousehold" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Thanks
Pavlina
Telerik team
 answered on 22 Sep 2010
3 answers
421 views
Hi,

I have a RadGrid and a RadComboBox as a column of the grid. When user selects a value in the combobox I need to enable/disable some cells on the same row. Hence I need the selectedindexchanged event to fire.
I referred the example on the telerik website and based on that I coded this functionality. However, the selectedindexchanged event does not fire. The code snippet is below.
Thanks, Mala

Here is my code snippet:
UAMain02.aspx

<

 

telerik:GridTemplateColumn AllowFiltering="false" SortExpression="OccCode" HeaderText="Occ Code *" UniqueName="OccCode">

 

 

 

 

<HeaderStyle Width="70px" />

 

 

 

 

<ItemStyle Width="70px" />

 

 

 

 

<ItemTemplate>

 

 

 

 

<telerik:RadComboBox ID="radComboBoxOccCode" runat="server" Autopostback="true" Width="50px" >

 

 

 

 

</telerik:RadComboBox>

 

 

 

 

<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidatorOcc" runat="server" ControlToValidate="radComboBoxOccCode" ErrorMessage="*" ValidationGroup="vgFirst"></asp:RequiredFieldValidator>

 

 

 

 

</ItemTemplate>

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 



and the code behind is:
UAMain02.aspx.cs

 

private void combo_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)

 

{

}

 

 

 

protected void radGrOccupation_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

 

 

if (e.Item is GridDataItem)

 

{

 

 

 

GridDataItem insertItem = (GridDataItem)e.Item;

 

 

 

 

RadComboBox combo = (RadComboBox)insertItem["OccCode"].FindControl("radComboBoxOccCode");

 

 

combo.AutoPostBack =

 

 

true;

 

combo.SelectedIndexChanged +=

 

 

new RadComboBoxSelectedIndexChangedEventHandler(this.combo_SelectedIndexChanged);

 

 

 


Princy
Top achievements
Rank 2
 answered on 22 Sep 2010
1 answer
456 views

I know this is so easy but I can't find the switch to highlight the current date in a month view.  I have a radscheduler on my page and have set my code to this:

radSchAppointments.SelectedDate = DateTime.Now;

I also have the scheduler defaulting to a month view.  I would expect the code above to highlight the current date in the calendar view but it doesn't do anything.

How do I get the current date to be highlighted so users can easily see today's date?

Shinu
Top achievements
Rank 2
 answered on 22 Sep 2010
1 answer
472 views
protected void grdVerification_ItemDataBound(object sender, GridItemEventArgs e) 
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                string header = item.cells[0].HeaderText
            }
        }
Hi,
Is there a way to access the column header text when you're in the item_databound event?  I am autogenerating my columns and I won't know the names of the columns, but I need to be able to figure out which column I am in by name and not by index.  I would like to do something like the attached example.

Thanks!
Tami

Shinu
Top achievements
Rank 2
 answered on 22 Sep 2010
0 answers
64 views
Hi,

This is related to the other thread I raised 2 months ago.
http://www.telerik.com/community/forums/aspnet-ajax/calendar/raddatepicker-validation-not-working-in-ver-2009-3-1103-35.aspx

I was asked to upgrade to 2010.2 to resolve the issue. It did resolve the problem mentioned but introduced other problems.

I am getting an error with 2010.2:
Assembly 'Telerik.Web.UI, Version=2010.2.713.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' does not contain a Web resource with name 'Telerik.Web.UI.Window.RadWindow.js'.

This Resource is there in 2009.3 but is missing from 2010.2

Regards
Krishna
Krishna
Top achievements
Rank 1
 asked on 22 Sep 2010
0 answers
114 views
I have several buttons on my form (it is a TabStrip control) that needs to do a server side postback when the user has focus on one of the buttons. It is a heavy data entry form and they require no mouse clicks. Strictly tabing to each field and then when the user tabs to one of the buttons and hits <ENTER> on the keyboard, I need to do a server side postback. I can't assign the <ENTER> key to a button, because I have multiple buttons on the form to do other things like look ups, etc, besides submitting the form.

Any ideas on how this can be accomplished? 

In summary, I have several buttons on the same form (btnSubmit, btnVoid, btnPend, btnDef, & 3 search buttons with different names). 

I need a way that when focus is on a particular button & the user presses <ENTER>, a server-side postback will occur for that button.

Bill
Top achievements
Rank 2
 asked on 22 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?