Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
89 views
I have created a grid which has generated a edit button, when I edit one of my row, it turns to edit mode, then after I change sth and click update, it would not be updated! Would somebody help me out here?
The first remarked datasource is built by myself and with logical delete, but it seems not working!
The second one is generated by datasource configuration builder. And it is still not working
<%--<asp:AccessDataSource ID="adsMenus" runat="server"   
    DataFile="~/App_Data/dbmx.mdb"   
    SelectCommand="SELECT * FROM [Menus] where isDelete = False"   
      
    UpdateCommand="UPDATE Menus SET menuName = ?, menuType = ?, menuSequence = ?, menuLink = ?, menuParentID = ? WHERE (menuID = ?)"   
    DeleteCommand="UPDATE Menus SET isDelete = true WHERE (menuID = ?)">  
    <UpdateParameters> 
        <asp:SessionParameter Name="menuName" SessionField="menuName" /> 
        <asp:SessionParameter Name="menuType" SessionField="menuType"/>  
        <asp:SessionParameter Name="menuSequence" SessionField="menuSequence"/>  
        <asp:SessionParameter Name="menuLink" SessionField="menuLink"/>  
        <asp:SessionParameter Name="menuParentID" SessionField="menuParentID"/>  
        <asp:SessionParameter Name="menuID" SessionField="menuID"/>  
    </UpdateParameters> 
    <DeleteParameters> 
        <asp:SessionParameter Name="menuID" SessionField="menuID" /> 
    </DeleteParameters> 
</asp:AccessDataSource>--%> 
<asp:AccessDataSource ID="adsMenus" runat="server"   
    DataFile="~/App_Data/dbmx.mdb"   
    SelectCommand="SELECT * FROM [Menus]"   
      
    UpdateCommand="UPDATE [Menus] SET [menuName] = ?, [menuType] = ?, [menuSequence] = ?, [menuLink] = ?, [menuParentID] = ?, [isDelete] = ? WHERE [menuID] = ? AND [menuName] = ? AND (([menuType] = ?) OR ([menuType] IS NULL AND ? IS NULL)) AND (([menuSequence] = ?) OR ([menuSequence] IS NULL AND ? IS NULL)) AND (([menuLink] = ?) OR ([menuLink] IS NULL AND ? IS NULL)) AND (([menuParentID] = ?) OR ([menuParentID] IS NULL AND ? IS NULL)) AND [isDelete] = ?"   
    ConflictDetection="CompareAllValues"   
    DeleteCommand="DELETE FROM [Menus] WHERE [menuID] = ? AND [menuName] = ? AND (([menuType] = ?) OR ([menuType] IS NULL AND ? IS NULL)) AND (([menuSequence] = ?) OR ([menuSequence] IS NULL AND ? IS NULL)) AND (([menuLink] = ?) OR ([menuLink] IS NULL AND ? IS NULL)) AND (([menuParentID] = ?) OR ([menuParentID] IS NULL AND ? IS NULL)) AND [isDelete] = ?"   
    InsertCommand="INSERT INTO [Menus] ([menuID], [menuName], [menuType], [menuSequence], [menuLink], [menuParentID], [isDelete]) VALUES (?, ?, ?, ?, ?, ?, ?)"   
    OldValuesParameterFormatString="original_{0}">  
    <DeleteParameters> 
        <asp:Parameter Name="original_menuID" Type="Int32" /> 
        <asp:Parameter Name="original_menuName" Type="String" /> 
        <asp:Parameter Name="original_menuType" Type="String" /> 
        <asp:Parameter Name="original_menuSequence" Type="Int32" /> 
        <asp:Parameter Name="original_menuLink" Type="String" /> 
        <asp:Parameter Name="original_menuParentID" Type="Int32" /> 
        <asp:Parameter Name="original_isDelete" Type="Boolean" /> 
    </DeleteParameters> 
    <UpdateParameters> 
        <asp:Parameter Name="menuName" Type="String" /> 
        <asp:Parameter Name="menuType" Type="String" /> 
        <asp:Parameter Name="menuSequence" Type="Int32" /> 
        <asp:Parameter Name="menuLink" Type="String" /> 
        <asp:Parameter Name="menuParentID" Type="Int32" /> 
        <asp:Parameter Name="isDelete" Type="Boolean" /> 
        <asp:Parameter Name="original_menuID" Type="Int32" /> 
        <asp:Parameter Name="original_menuName" Type="String" /> 
        <asp:Parameter Name="original_menuType" Type="String" /> 
        <asp:Parameter Name="original_menuSequence" Type="Int32" /> 
        <asp:Parameter Name="original_menuLink" Type="String" /> 
        <asp:Parameter Name="original_menuParentID" Type="Int32" /> 
        <asp:Parameter Name="original_isDelete" Type="Boolean" /> 
    </UpdateParameters> 
    <InsertParameters> 
        <asp:Parameter Name="menuID" Type="Int32" /> 
        <asp:Parameter Name="menuName" Type="String" /> 
        <asp:Parameter Name="menuType" Type="String" /> 
        <asp:Parameter Name="menuSequence" Type="Int32" /> 
        <asp:Parameter Name="menuLink" Type="String" /> 
        <asp:Parameter Name="menuParentID" Type="Int32" /> 
        <asp:Parameter Name="isDelete" Type="Boolean" /> 
    </InsertParameters> 
</asp:AccessDataSource> 
 
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateDeleteColumn="True"   
    AutoGenerateEditColumn="True" DataSourceID="adsMenus" GridLines="None"   
    Skin="Office2007">  
<MasterTableView AutoGenerateColumns="False" DataKeyNames="menuID"   
        DataSourceID="adsMenus">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="menuID" DataType="System.Int32"   
            HeaderText="menuID" ReadOnly="True" SortExpression="menuID" UniqueName="menuID">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="menuName" HeaderText="menuName"   
            SortExpression="menuName" UniqueName="menuName">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="menuType" HeaderText="menuType"   
            SortExpression="menuType" UniqueName="menuType">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="menuSequence" DataType="System.Int32"   
            HeaderText="menuSequence" SortExpression="menuSequence"   
            UniqueName="menuSequence">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="menuLink" HeaderText="menuLink"   
            SortExpression="menuLink" UniqueName="menuLink">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="menuParentID" DataType="System.Int32"   
            HeaderText="menuParentID" SortExpression="menuParentID"   
            UniqueName="menuParentID">  
        </telerik:GridBoundColumn> 
        <telerik:GridCheckBoxColumn DataField="isDelete" DataType="System.Boolean"   
            HeaderText="isDelete" SortExpression="isDelete" UniqueName="isDelete">  
        </telerik:GridCheckBoxColumn> 
    </Columns> 
</MasterTableView> 
</telerik:RadGrid> 
louis chan
Top achievements
Rank 1
Iron
 answered on 10 Mar 2010
2 answers
105 views
Hey everyone

I have the following scenario: The Master page contains a RadAjaxManager (ID = ajaxMgr) and a RadTreeView (ID = treeView). On another page, namely Default.aspx a RadGrid (ID = radGrid) is placed. The treeView will start the AJAX request and the radGrid is the control that will be updated. My question here is, on which page do I add the AJAX setting: on the Master page (using a base class or something else) or on the Default.aspx page (using ((MasterPage)Master).AjaxMgr.AjaxSettings.AddAjaxSettings(((MasterPage)Master).TreeView, radGrid) )? Does a Telerik control exist, that does solve this kind of situation? Or what is your best practice in this scenario? 

I'm looking forward to your answers. Thanks.

Regards,
Mallory
Mallory
Top achievements
Rank 1
 answered on 10 Mar 2010
3 answers
120 views
Hi,
   I have few questions, Anyone can help me? Thanks in advance

1) Pagination
       i'm having 25 records in my grid and 10 records are displayed per page. So  first 2 page got 10 records and last page got 5 records. after going to last page, if i click sorting, the pagination is still on the last page and number of records shown also 5 only but the data got sorted. am i doing anything wrong?

2) Export to PDF in client side
  if the grid is not ajaxifiedm i'm able to export the grid to PDF in client side. If the grid is ajaxified, then how can i export to pdf in client side?

Telerik version used :2008.2.1001.35

ASPX Code:
<body>

    <script type="text/javascript" language="javascript">
        function ExportGrid()
        {
            var radGrid = $find('<%= RadGrid1.ClientID %>');
            
            radGrid.get_masterTableView().exportToPdf();
        }
        function RequestStart(ajaxManager,eventArgs)
        {
        
        var evtTarget=eventArgs.EventTarget;
        //alert(evtTarget.indexOf("Button1"));
         if(evtTarget.indexOf("Button1")!=-1)
            {
                eventArgs.EnableAjax=false
            }
        }
    </script>

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div>
        <asp:Button ID="Button1" runat="server" Text="Export" OnClientClick="ExportGrid();return false;" />
        <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
            AllowPaging="True" AllowSorting="True" GridLines="None" EnableViewState="true" PagerStyle-Position="TopAndBottom">
            <MasterTableView>
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
            </MasterTableView>
            <FilterMenu EnableTheming="True">
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
            </FilterMenu>
        </telerik:RadGrid>
        <telerik:RadAjaxManager ID="ajaxman" runat="server"
            onajaxsettingcreating="ajaxman_AjaxSettingCreating">
        <ClientEvents OnRequestStart="RequestStart" />
            <AjaxSettings>
               <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>            
            <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="Button1"/>                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </div>
    </form>
</body>

Code Behind:

protected DataTable GenerateDataTable()
    {
        DataTable myDataTable = new DataTable();
        myDataTable.Columns.Add("ID", typeof(int));
        myDataTable.Columns.Add("Name", typeof(string));

        for (int rows = 0; rows < 25; rows++)
            myDataTable.Rows.Add(rows, "Row " + rows);

        return myDataTable;
    }

    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = GenerateDataTable();
    }
Princy
Top achievements
Rank 2
 answered on 10 Mar 2010
1 answer
116 views
Hello,

I have a simple problem with regards to positioning of the XAxis Item Labels.  After I set them to a rotation angle of 45, rather than 90, the start of the label is not aligned with the major tick it corresponds to.  Instead it looks as if the label belongs to the tick preceeding it.  Having the labels set at 90 does not make them very reader friendly, but I am not sure what setting I would need to adjust in order to get them to lineup correctly with their appropriate tick mark?

Thanks,
Ron
Ron
Top achievements
Rank 2
 answered on 10 Mar 2010
2 answers
250 views
I try to use the Rad Grid Delete Command to delete a row in the RadGrid using server side store proc. The index property reads correctly but the actual value of the field is null.

TABLE
-------------------------------------------------------------------------------------------------------------------------------------------------
USE [xxxx]
GO

/****** Object:  Table [dbo].[TemplateAreasPractice]    Script Date: 03/08/2010 21:52:42 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[TemplateAreasPractice](
[TemplateAreasPracticeId] [int] IDENTITY(1,1) NOT NULL,
[CategoryId] [int] NULL,
[ProfileId] [int] NULL,
[TemplateAreasPracticePorcent] [int] NULL,
[TemplateAreasPracticeDate] [datetime] NULL,
 CONSTRAINT [PK_TemplateAreasPractice] PRIMARY KEY CLUSTERED 
(
[TemplateAreasPracticeId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[TemplateAreasPractice] ADD  CONSTRAINT [DF_TemplateAreasPractice_TemplateAreasPracticeDate]  DEFAULT (getdate()) FOR [TemplateAreasPracticeDate]
GO

Store Proc
------------------------------------------------------------------------------------------------------------------------------------------------------------
USE [xxx]
GO

/****** Object:  StoredProcedure [dbo].[Delete_TemplateAreasPractice]    Script Date: 03/08/2010 21:52:15 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author: Christian Rodriguez
-- Create date: 3-8-2010
-- Description:
-- =============================================
CREATE PROCEDURE [dbo].[Delete_TemplateAreasPractice] 
-- Add the parameters for the stored procedure here
@TemplateAreasPracticeId int = 0
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

    -- Insert statements for procedure here
DELETE FROM TemplateAreasPractice
WHERE (TemplateAreasPracticeId = @TemplateAreasPracticeId)
END

GO

HTML
------------------------------------------------------------------------------------------------------------------------------------------
<telerik:RadGrid ID="RadGridAreaofPractice" runat="server" AllowPaging="True" 
                                                                GridLines="None" AutoGenerateColumns="False" OnDeleteCommand="RadGridAreaofPractice_DeleteCommand">
                                        <MasterTableView>
                                        <RowIndicatorColumn>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>

                                        <ExpandCollapseColumn>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        <Columns>                                     
                                                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName= "DeleteColumn" />                                                                                 
                                                <telerik:GridBoundColumn DataField="TemplateAreasPracticeId" HeaderText="TemplateAreasPracticeId" SortExpression="TemplateAreasPracticeId" UniqueName="TemplateAreasPracticeId" />
                                                <telerik:GridBoundColumn DataField="CategoryDesc" HeaderText="Category" SortExpression="Category" UniqueName="Category" />
                                                <telerik:GridBoundColumn DataField="TemplateAreasPracticePorcent" HeaderText="Porcent" SortExpression="Porcent" UniqueName="Porcent" />                                                                                         
                                            </Columns>
                                        </MasterTableView>
                                       </telerik:RadGrid>


ASPX.VB
--------------------------------------------------------------------------------------------------------------------------------------------------------
 Public Sub RadGridAreaofPractice_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridAreaofPractice.DeleteCommand

        Dim id As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("TemplateAreasPracticeId").ToString()

        If id > "" Then

            Dim ConnectionString As New XXX
            Dim sConnection As String = ConnectionString.XXX
            Dim connection As SqlConnection = New SqlConnection(sConnection)

            'Delete
            Dim objCommand_Delete_TemplateAreasPractice As SqlCommand = New SqlCommand("Delete_TemplateAreasPractice", connection)
            objCommand_Delete_TemplateAreasPractice.Connection.Open()
            objCommand_Delete_TemplateAreasPractice.CommandType = Data.CommandType.StoredProcedure
            objCommand_Delete_TemplateAreasPractice.Parameters.AddWithValue("@TemplateAreasPracticeId", id)

            objCommand_Delete_TemplateAreasPractice.ExecuteNonQuery()

            objCommand_Delete_TemplateAreasPractice.Connection.Close()
            objCommand_Delete_TemplateAreasPractice.Dispose()

            'close database connection
            connection.Close()
            connection.Dispose()

        End If



    End Sub 'RadGridAreaofPractice_DeleteCommand


Christian Rodriguez
Top achievements
Rank 2
 answered on 10 Mar 2010
2 answers
84 views
Dear Telerik,

How do yoy view scheduler detail in double clicked. instead of displaying the edit, I would like to display the detail of the scheduler, such as location, price and name of the person.

thank you
Molivia Sa
Top achievements
Rank 1
 answered on 09 Mar 2010
1 answer
159 views
I have a scenario like a few others listed in the forum where I have users than can upload any size image and I need to generate multiple sizes from the image.  I have seen examples of other posts on how to capture the image and that is working just fine.  However, I am having some trouble with the resizing.  Because of some of the manipulation that I need to do to the image regarding quality and because I do not know the file format (after the fact), I am wondering if there is a way to read some of the properties about the original file.  Specifically, because I have to deal with encoding, I need to get the image's original file format in order to alter the image quality or resolution.  I can obviously read the extension during the file upload, but the image processing may not always happen at that time and I don't really want to have an extra database field if it isn't needed.  So, is there a reasonable way to parse out of the file format from the binary image's "datavalue" or byte array?
Allen
Top achievements
Rank 2
 answered on 09 Mar 2010
1 answer
138 views
Hi.

I need to do something in client side when the user click the save button (the same in the "update") of a appointment create (or edit). I don´t want to use an  Advanced Templates because I only need this. 

I try with the "OnClientAppointmentInserting" but this fire when I click the appointment and I want to do something just before to send the postback after the user set values in the form of creating. 

I´m using: StartEditingInAdvancedForm="true" if this can help to understand.

Anybody know how to "take" this event.

Thanks
Daniel Cuba
Top achievements
Rank 1
 answered on 09 Mar 2010
14 answers
367 views
I am using a tooltipManager display the information needed in the tooltip. The tooltip is shown when a row on a radGrid is clicked. I have the information loaded into the tooltipManager from the radGrid_ItemDataBind event but for some reason I can't get the tooltip to appear where I told it to. 

            <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"
                HideEvent="ManualClose" Modal="True"
                onajaxupdate="RadToolTipManager1_AjaxUpdate" Position="Center"
                ShowEvent="OnClick" ManualClose="True" OffsetY="0"
                RelativeTo="BrowserWindow">
            </telerik:RadToolTipManager>

It will occasionally show in the center but usually shows along the middle but not the center of the browser. Is there something I am missing or doing wrong?
Andy F.
Top achievements
Rank 1
Iron
 answered on 09 Mar 2010
2 answers
117 views
Hi all:
  I tried to add RadCombox control by draging or manually adding codes. I got "Error Createing control" error.
the detail information " Could not load file or assembly 'telerik.web.UI version=2009.3.1314.35 ......the system can't find the file specified. I also got the same error when I dragged the RadCalendar control

I uninstalled then re installed but I still got the same error.

Thanks
Helena
HL
Top achievements
Rank 1
 answered on 09 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?