Default date from column

12 posts, 1 answers
  1. grand lorie
    grand lorie avatar
    55 posts
    Member since:
    Mar 2010

    Posted 22 Oct 2010 Link to this post

    Hi

    I have a grid on a page which generates data from sql database table.

    there is 2 columns "Fields" in this table
    StartDate and EndDate
    on both i am using RadCalender
    User1 will choose the StartDate from Calender and User2 will choose EndDate also from Calender..

    what i want is...for User2 i need the RadCalender default date same as StartDate.. how to do that.

    Thanks

  2. grand lorie
    grand lorie avatar
    55 posts
    Member since:
    Mar 2010

    Posted 26 Oct 2010 Link to this post

    any idea !!!!!????
  3. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 27 Oct 2010 Link to this post

    Hello grand,

    You can handle eith ther client-side OnDateSelected or the server-side SelectionChanged event of the StartDate calendar and there set its selected date to the EndTime calendar. For more information on the RadCalendar API, refer to the below online resources:

    http://www.telerik.com/help/aspnet-ajax/calendar_serversideselecteddatechanged.html
    http://www.telerik.com/help/aspnet-ajax/calendar_serversideselectionchanged.html
    http://www.telerik.com/help/aspnet-ajax/calendar_clientsideradcalendar.html


    Regards,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. grand lorie
    grand lorie avatar
    55 posts
    Member since:
    Mar 2010

    Posted 08 Nov 2010 Link to this post

    Hi Lana

    Thanks for your reply, but i could not get it to work..

    here is my page code; (how can i set the default date to ManageDate equals to DateRequired).
    ==========================================================
    <%@ Page MasterPageFile="~/Master Pages/ManageMasterPage.master"  Language="VB" AutoEventWireup="false" CodeFile="PendingOrders.aspx.vb" Inherits="ManagementDepartment_PendingOrders" EnableSessionState="True" %>
     
    <asp:Content ID="Content1" ContentPlaceHolderID ="ContentPlaceHolder2" runat = "server">
            <table class="style1" cellpadding="0" cellspacing="0">
                   <style type="text/css">
            .viewWrap
            {
                padding: 15px;
                background: #2291b5 0 0 url(Img/bluegradient.gif) repeat-x;
            }
            .contactWrap
            {
                padding: 10px 15px 15px 15px;
                background: #fff;
                color: #333;
            }
            .contactWrap td
            {
                padding: 0 20px 0 0;
            }
            .contactWrap td td
            {
                padding: 3px 20px 3px 0;
            }
            .contactWrap img
            {
                border: 3px solid #05679d;
            }
        </style>
        <!-- end of custom head section -->
        <div>
     
                <tr>
                    <td bgcolor="Black" class="style3">
                        >> Pending Orders</td>
                </tr>
                 
                <tr>
                    <td>
                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticUpdates="True"
                            AllowPaging="True" AllowSorting="True" AutoGenerateEditColumn="True"
                            DataSourceID="SqlDataSource1" GridLines="None" ShowFooter="True"
                            Skin="Sunset">
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="OrderID" DataSourceID="SqlDataSource1">
     
    <NestedViewSettings DataSourceID="SqlDataSource3">
                   <ParentTableRelation>
                       <telerik:GridRelationFields DetailKeyField="OrderID" MasterKeyField="OrderID" />
                   </ParentTableRelation>
               </NestedViewSettings>
               <NestedViewTemplate>
                   <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap">
                       <div class="contactWrap">
                           <fieldset style="padding: 10px;">
                               <legend style="padding: 5px;"><b>Detail for Order Number: <%#Eval("OrderID")%></b>
                               </legend>
                               <table>
                                   <tr>
                                       <td>
                                           Division:
                                       </td>
                                       <td>
                                           <asp:Label ID="Label1" Text='<%#Bind("DivisionName") %>' runat="server"></asp:Label>
                                       </td>
                                       <td>
                                           <asp:Image ID="Image1" runat="server" EnableViewState="true" TabIndex="0" ToolTip="This is Photo"
                                               ImageAlign="Right" Width="60px" Height="60px" ImageUrl='<%#Eval("ThumbImage") %>'
                                               Visible="true" />
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           Category:
                                       </td>
                                       <td>
                                           <asp:Label ID="titleLabel" Text='<%#Bind("CategoryName") %>' runat="server"></asp:Label>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           Item Type:
                                       </td>
                                       <td>
                                           <asp:Label ID="addressLabel" Text='<%#Bind("TypeName") %>' runat="server"></asp:Label>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           Code:
                                       </td>
                                       <td>
                                           <asp:Label ID="Label2" Text='<%#Bind("CodeName") %>' runat="server"></asp:Label>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           Full Code:
                                       </td>
                                       <td>
                                           <asp:Label Font-Size="Medium" ForeColor="Blue" ID="Label3" Text='<%#Bind("FullCode") %>'
                                               runat="server"></asp:Label>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           Number of Pages:
                                       </td>
                                       <td>
                                           <asp:Label ID="Label4" Text='<%#Bind("PagesNumber") %>' runat="server"></asp:Label>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           Release Date:
                                       </td>
                                       <td>
                                           <asp:Label ID="Label5" Text='<%#Bind("ReleaseDate") %>' runat="server"></asp:Label>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           Discontinued:
                                       </td>
                                       <td>
                                           <asp:Label ID="Label6" Text='<%#Bind("Discontinued") %>' runat="server"></asp:Label>
                                       </td>
                                       </td>
                                   </tr>
                                   <tr>
                                       <tr>
                                           <td>
                                               Item ID:
                                           </td>
                                           <td>
                                               <asp:Label ID="Label7" Text='<%#Bind("ItemID") %>' runat="server"></asp:Label>
                                           </td>
                                       </tr>
                               </table>
                           </fieldset>
                       </div>
                   </asp:Panel>
               </NestedViewTemplate>
                
        <ExpandCollapseColumn Visible="True">
        </ExpandCollapseColumn>
        <Columns>
           <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32"
                DefaultInsertValue="" HeaderText="Order Number" ReadOnly="True"
                SortExpression="OrderID" UniqueName="OrderID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="OrderDate" DataType="System.DateTime"
                DefaultInsertValue="" HeaderText="Order Date" ReadOnly="True"
                SortExpression="OrderDate" UniqueName="OrderDate">
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="Quantity" DataType="System.Int32"
                DefaultInsertValue="" HeaderText="Quantity" SortExpression="Quantity"
                UniqueName="Quantity" Aggregate="Sum">
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server"
                        Culture="English (United Kingdom)" DbValue='<%# Bind("Quantity") %>'
                        ShowSpinButtons="True" Value="0" Width="100px">
                        <NumberFormat DecimalDigits="0" GroupSeparator="," GroupSizes="3" />
                    </telerik:RadNumericTextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="QuantityLabel" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label>
                </ItemTemplate>
                <FooterStyle Font-Bold="True" Font-Size="Medium" />
                <ItemStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" ForeColor="Blue"
                    Wrap="False" />
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="DateRequired" DataFormatString="{0:d}"
                DataType="System.DateTime" DefaultInsertValue="" HeaderText="Date Required"
                ReadOnly="True" SortExpression="DateRequired" UniqueName="DateRequired">
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="OrderComment" DefaultInsertValue=""
                HeaderText="Order Comment" ReadOnly="True" SortExpression="OrderComment"
                UniqueName="OrderComment">
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="ManageDate"  DataType="System.DateTime"
                HeaderText="Manage Date" SortExpression="ManageDate"
                UniqueName="ManageDate" DefaultInsertValue="">
                <EditItemTemplate>
                    <telerik:RadDatePicker ID="RadDatePicker1" Runat="server"
                        Culture="English (United Kingdom)" DbSelectedDate='<%# Bind("ManageDate") %>'
                        Width="175px">
                        <Calendar ID="Calendar1" runat="server"  UseColumnHeadersAsSelectors="False"  UseRowHeadersAsSelectors="False"
                            ViewSelectorText="x">
                        </Calendar>
                        <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        <DateInput ID="DateInput1" runat="server"  DateFormat="dd/MM/yyyy"  DisplayDateFormat="dd/MM/yyyy">
                        </DateInput>
                    </telerik:RadDatePicker>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="ManageDateLabel" runat="server" Text='<%# Eval("ManageDate","{0:d}") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="OrderSpecs" DefaultInsertValue="No Specs"
                HeaderText="Order Specs" SortExpression="OrderSpecs"
                UniqueName="OrderSpecs">
                <EditItemTemplate>
                    <telerik:RadTextBox ID="RadTextBox1" Runat="server" Text='<%# Bind("OrderSpecs") %>'
                        Width="250px" EmptyMessage="Print Specifications"
                        SelectionOnFocus="SelectAll">
                    </telerik:RadTextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="OrderSpecsLabel" runat="server" Text='<%# Eval("OrderSpecs") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="ManageComment" DefaultInsertValue="No Comment"
                HeaderText="Manage Comment" SortExpression="ManageComment"
                UniqueName="ManageComment">
                <EditItemTemplate>
                    <telerik:RadTextBox ID="RadTextBox2" Runat="server"
                        Text='<%# Bind("ManageComment") %>' TextMode="MultiLine" Width="250px"
                        EmptyMessage="Message to Suppliers" SelectionOnFocus="SelectAll">
                    </telerik:RadTextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="ManageCommentLabel" runat="server"
                        Text='<%# Eval("ManageComment") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="SupplierName" DefaultInsertValue=""
                HeaderText="Supplier" SortExpression="SupplierName" UniqueName="SupplierName">
                <EditItemTemplate>
                    <telerik:RadComboBox ID="RadComboBox1" Runat="server"
                        DataSourceID="SqlDataSource2" DataTextField="SupplierName"
                        DataValueField="SupplierID" SelectedValue='<%# Bind("SupplierID") %>'
                        Width="200px">
                    </telerik:RadComboBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="SupplierNameLabel" runat="server"
                        Text='<%# Eval("SupplierName") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="ItemID" DataType="System.Int32"
                DefaultInsertValue="" HeaderText="ItemID" ReadOnly="True"
                SortExpression="ItemID" UniqueName="ItemID" Visible="False">
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="DaysLeft" DataType="System.Int32"
                DefaultInsertValue="" HeaderText="DaysLeft" SortExpression="DaysLeft"
                UniqueName="DaysLeft" ReadOnly="True">
                <ItemStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" ForeColor="Maroon"
                    Wrap="False" />
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn DataField="ManageSubmit" DataType="System.Boolean"
                DefaultInsertValue="False" HeaderText="Submit" SortExpression="ManageSubmit"
                UniqueName="ManageSubmit">
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="False" />
            </telerik:GridCheckBoxColumn>
        </Columns>
    </MasterTableView>
                            <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
                                Font-Strikeout="False" Font-Underline="False" Wrap="True" />
                            <ClientSettings EnablePostBackOnRowClick="True">
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                        </telerik:RadGrid>
                    </td>
                </tr>
                <tr>
                    <td>
                         </td>
                </tr>
                <tr>
                    <td>
                         </td>
                </tr>
                <tr>
                    <td bgcolor="Black">
                         </td>
                </tr>
            </table>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
        </div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:OrderSystemConn %>"
            DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @OrderID"
            InsertCommand="INSERT INTO [Orders] ([Quantity], [ManageDate], [OrderSpecs], [ManageComment], [ManageSubmit], [SupplierID]) VALUES (@Quantity, @ManageDate, @OrderSpecs, @ManageComment, @ManageSubmit, @SupplierID)"
            SelectCommand="SELECT Orders.OrderID, Orders.OrderDate, Orders.Quantity, Orders.DateRequired, Orders.OrderComment, Orders.OrderSubmit, Orders.ManageDate, Orders.OrderSpecs, Orders.ManageComment, Orders.ManageSubmit, Orders.ItemID, Orders.SupplierID, Supplier.SupplierName, Orders.DaysLeft FROM Orders INNER JOIN Supplier ON Orders.SupplierID = Supplier.SupplierID WHERE (Orders.OrderSubmit = 1) AND (Orders.ManageSubmit = 0)"
             
             
             
            UpdateCommand="UPDATE [Orders] SET [Quantity] = @Quantity, [ManageDate] = @ManageDate, [OrderSpecs] = @OrderSpecs, [ManageComment] = @ManageComment, [ManageSubmit] = @ManageSubmit  ,[SupplierID] = @SupplierID WHERE [OrderID] = @OrderID">
            <DeleteParameters>
                <asp:Parameter Name="OrderID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Quantity" Type="Int32" />
                <asp:Parameter Name="ManageDate" Type="DateTime" />
                <asp:Parameter Name="OrderSpecs" Type="String" />
                <asp:Parameter Name="ManageComment" Type="String" />
                <asp:Parameter Name="ManageSubmit" Type="Boolean" />
                <asp:Parameter Name="SupplierID" Type="Int32" />
                <asp:Parameter Name="OrderID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Quantity" Type="Int32" />
                <asp:Parameter Name="ManageDate" Type="DateTime" />
                <asp:Parameter Name="OrderSpecs" Type="String" />
                <asp:Parameter Name="ManageComment" Type="String" />
                <asp:Parameter Name="ManageSubmit" Type="Boolean" />
                <asp:Parameter Name="SupplierID" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
            ConnectionString="<%$ ConnectionStrings:OrderSystemConn %>"
            DeleteCommand="DELETE FROM [Supplier] WHERE [SupplierID] = @SupplierID"
            InsertCommand="INSERT INTO [Supplier] ([SupplierName]) VALUES (@SupplierName)"
            SelectCommand="SELECT [SupplierID], [SupplierName] FROM [Supplier] ORDER BY [SupplierName]"
            UpdateCommand="UPDATE [Supplier] SET [SupplierName] = @SupplierName WHERE [SupplierID] = @SupplierID">
            <DeleteParameters>
                <asp:Parameter Name="SupplierID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="SupplierName" Type="String" />
                <asp:Parameter Name="SupplierID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="SupplierName" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server"
            ConnectionString="<%$ ConnectionStrings:OrderSystemConn %>"
             
             
            SelectCommand="SELECT Orders.OrderID, Division.DivisionName, Category.CategoryName, Type.TypeName, Code.CodeName, Item.FullCode, Item.PagesNumber, Item.UnitCost, Item.ItemCost, Item.ReleaseDate, Item.Discontinued, Item.ItemID, Item.ThumbImage FROM Orders INNER JOIN Item ON Orders.ItemID = Item.ItemID INNER JOIN Category ON Item.CategoryID = Category.CategoryID INNER JOIN Division ON Item.DivisionID = Division.DivisionID INNER JOIN Type ON Item.TypeID = Type.TypeID INNER JOIN Code ON Item.CodeID = Code.CodeID WHERE (Orders.OrderID = @OrderID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadGrid1" Name="OrderID"
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource4" runat="server"
            ConnectionString="<%$ ConnectionStrings:OrderSystemConn %>"
             
             
            SelectCommand="SELECT Orders.OrderID, Division.DivisionName, Category.CategoryName, Type.TypeName, Code.CodeName, Item.FullCode, Item.PagesNumber, Item.UnitCost, Item.ItemCost, Item.ReleaseDate, Item.Discontinued, Item.ItemID, Item.ThumbImage FROM Orders INNER JOIN Item ON Orders.ItemID = Item.ItemID INNER JOIN Category ON Item.CategoryID = Category.CategoryID INNER JOIN Division ON Item.DivisionID = Division.DivisionID INNER JOIN Type ON Item.TypeID = Type.TypeID INNER JOIN Code ON Item.CodeID = Code.CodeID WHERE (Orders.OrderID = @OrderID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadGrid1" Name="OrderID"
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </asp:Content>
    <asp:Content ID="Content2" runat="server" contentplaceholderid="head">
     
        <style type="text/css">
            .style3
            {
                text-align: center;
                font-size: x-large;
                color: #FFFFFF;
            }
        </style>
     
    </asp:Content>
  5. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 11 Nov 2010 Link to this post

    Hi grand,

    Try handling the ItemDataBound event as below:

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if(e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            RadDatePicker picker = item["ManagerData"].FindControl("RadDatePicker1") as RadDatePicker;
            picker.SelectedDate = (DateTime)item.DataItem["DateRequired"];
        }
    }


    Sincerely yours,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. grand lorie
    grand lorie avatar
    55 posts
    Member since:
    Mar 2010

    Posted 11 Nov 2010 Link to this post

    Hi Lana

    Unfortunately, that code did not do anything.

    here is my code behind

    Imports Telerik.Web.UI
     
    Partial Class ManagementDepartment_PendingOrders
        Inherits System.Web.UI.Page
        Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
            Me.RadGrid1.GroupingSettings.CaseSensitive = False
        End Sub
     
        Private Sub RadGrid1_ItemCommand(ByVal [source] As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
            If e.CommandName = RadGrid.ExpandCollapseCommandName Then
                Dim item As GridItem
                For Each item In e.Item.OwnerTableView.Items
                    If item.Expanded AndAlso Not item Is e.Item Then
                        item.Expanded = False
                    End If
                Next item
            End If
        End Sub 'RadGrid1_ItemCommand
        Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)
            If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
                Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)
                Dim picker As RadDatePicker = TryCast(item("ManageDate").FindControl("RadDatePicker1"), RadDatePicker)
                picker.SelectedDate = DirectCast(item.DataItem("DateRequired"), DateTime)
            End If
        End Sub
    End Class
  7. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 12 Nov 2010 Link to this post

    Hi grand,

    I am not sure if I properly understood you. Can you specify which code did not work - mine, yours, or both versions?

    Kind regards,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. grand lorie
    grand lorie avatar
    55 posts
    Member since:
    Mar 2010

    Posted 12 Nov 2010 Link to this post

    Hi Lana

    I am using your code (in VB version)..
    i attached my code behind on my previous post..

  9. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 12 Nov 2010 Link to this post

    Hi grand,

    I observed that you are using VB.NET. But I am still not sure if the code you pasted in your previous post works for you or you need further assistance to make it work. Can you clarify that?

    Regards,
    Iana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. grand lorie
    grand lorie avatar
    55 posts
    Member since:
    Mar 2010

    Posted 12 Nov 2010 Link to this post

    Hi Lana

    The code i posted is not working for me, it did not do anything, still when i click edit ....the calendar box is empty and i have to select but of course i need to have it has a default date which is the same as the RequiredDate.

    Thanks
  11. Answer
    Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 17 Nov 2010 Link to this post

    Hello grand,

    Does it make any difference if you change the code as below:

    Imports Telerik.Web.UI
       
    Partial Class ManagementDepartment_PendingOrders
        Inherits System.Web.UI.Page
        Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
            Me.RadGrid1.GroupingSettings.CaseSensitive = False
        End Sub
       
        Private Sub RadGrid1_ItemCommand(ByVal [source] As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
            If e.CommandName = RadGrid.ExpandCollapseCommandName Then
                Dim item As GridItem
                For Each item In e.Item.OwnerTableView.Items
                    If item.Expanded AndAlso Not item Is e.Item Then
                        item.Expanded = False
                    End If
                Next item
            End If
        End Sub 'RadGrid1_ItemCommand
      
        Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemDatabound
      
            If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
                Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)
                Dim picker As RadDatePicker = TryCast(item("ManageDate").FindControl("RadDatePicker1"), RadDatePicker)
                picker.SelectedDate = DirectCast(CType(item.DataItem, DataRowView)("DateRequired"), DateTime)
            End If
        End Sub
    End Class


    Kind regards,
    Iana
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  12. grand lorie
    grand lorie avatar
    55 posts
    Member since:
    Mar 2010

    Posted 17 Nov 2010 Link to this post

    Hi Iana

    Thanks a lot for that code, it did the trick..

    once again thanks
    Lorie
Back to Top