Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
105 views
hi friends,


i have downloaded some of your sample projects for Grid.

In those i found that on Grid there is feature 'Add new Record' on the top of the grid.

But those samples are built using RadGrid.Net2.dll file.

I am using Telerik.Web.UI.dll controls.

In my Grid i cannot found that feature.

Can anybody help me how to implement that.

sample codes are preferable
Santhosh
Top achievements
Rank 1
 answered on 18 Mar 2009
2 answers
139 views
hi every body
          i used insert and update commands in the grid. for this i have used edititemtemplate.
now i want the "PASSWORD" field to be displayed in insert mode and in edit mode it must be invisible.

<telerik:GridTemplateColumn HeaderText="Password" UniqueName="Password" Visible="false">            
            <ItemTemplate>
            <asp:Label runat="server" ID="Password" Text='<%# Eval("Password") %>' />
            
            </ItemTemplate>
                <EditItemTemplate>
                <asp:TextBox runat="server" Style="width: 100px; margin-left: 2px;" ID="TBPassword" ReadOnly="False"
                Text='<%# Bind("Password") %>'   TextMode="Password"/>
                </br>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*please enter password" ControlToValidate="TBPassword"></asp:RequiredFieldValidator>
                 </br>
                 <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
        ErrorMessage="*password must contain atleast 7 and not more than 15 characters" ValidationExpression="\w{6,14}$"
        ControlToValidate="TBPassword"></asp:RegularExpressionValidator>
                 
                  </EditItemTemplate>
            <HeaderStyle Width="120px" />
        </telerik:GridTemplateColumn>


guys
plz help me
Shinu
Top achievements
Rank 2
 answered on 18 Mar 2009
1 answer
385 views
I need to bind a value with codebehind to a checkbox.

I have build one checkbox for each row in the event ItemCreated

Christian
Shinu
Top achievements
Rank 2
 answered on 18 Mar 2009
2 answers
283 views
The question thread title explains it all.  How do you do this?
Princy
Top achievements
Rank 2
 answered on 18 Mar 2009
2 answers
189 views
I must be missing something really basic.  I have created a table in sql server 2008 called mytest with two fields (mytest_id int identity, mytest_name nvarchar max).  I am trying to use radgrid to be able to insert, update, and delete.  I am using Visual Studio 2008 to create a web application project.  I have added the radscriptmanager, radgrid, and radajaxpanel.  I created the datasource to the mytest table on sql server and added the select, insert, update, and delete sql statements:


Select:  SELECT mytest_id, mytest_name FROM mytest
Update:  UPDATE mytest SET mytest_name = @mytest_name WHERE (mytest_id = @mytest_id)
Insert:  INSERT INTO mytest(mytest_name) VALUES (@mytest_name)
Delete:  DELETE FROM mytest WHERE (mytest_id = @mytest_id)

I have added the Select, Edit Update Cancel, and Delete columns.
I have set AllowAutomaticDeletes, AllowAutomaticInserts, AllowAutomaticUpdates all to true.

I think the commands are failing because there is no values for the @variables
If I change the delete command to:  DELETE FROM mytest WHERE (mytest_id = 1)
the record is successfully deleted.

Any help is appreciated,
Dave




SIT
Top achievements
Rank 1
 answered on 18 Mar 2009
2 answers
208 views
Hi working on RadSpell trial. I followed the steps on Getting Started but it doesnt seem to work. When I click the Spell Check button, the Spellchecker form pops up and it says Spell Checkin in progress... Did I miss something?
This is also the DictionaryPath  = ~/App_Data/RadSpell/en-US.tdf.

Thanks
Pierpaolo
Top achievements
Rank 1
 answered on 17 Mar 2009
5 answers
239 views
I have an existing app where a user can generate a recurring schedule with a form we made that pretty much looks just like the RadScheduler's Recurrence edit form.  It then previews what dates will be generated from the schedule and they can then save those dates only to the database.

What I would like to do, is replace our custom made form with RadScheduler's Recurrence edit form.  So I don't want to initially databind the RadScheduler to anything and I don't want to see the whole schedule part of it either.  All I want is the functionality of the recurrence edit and then be able to retrieve what they entered in server side.

Is this possible?
Zach
Top achievements
Rank 1
 answered on 17 Mar 2009
1 answer
146 views
Hello! I have a grid that I need to convert to a mutliple row edit grid on an Ajax post back. However, it takes two page refreshes (AJAX) to see the edit boxes.  I'm not sure where in the ASP.NET page lifecycle I can change the way the grid gets rendered. I have attempted the PreRender and on the CheckChanged event of the radio button.

Scenario:

The user makes a selection in a group of radio buttons. One of the buttons should change all of the loaded grid rows to edit mode so the user can make bulk edit entries in the grid to be stored on a full post-back. This change should be turned on when rdProposalLocked is selected and off when any other radio option is selected.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="BulkApproveItems.aspx.vb" 
    Inherits="BulkApproveItems" ErrorPage="~/error_window.aspx" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Bulk Approve Items</title> 
 
    <script type="text/javascript">  
        function CloseAndRebind() {  
            GetRadWindow().Close();  
            GetRadWindow().BrowserWindow.refreshGrid();  
        }  
 
        function GetRadWindow() {  
            var oWindow = null;  
            if (window.radWindow)  
                oWindow = window.radWindow;  
            else if (window.frameElement.radWindow)  
                oWindow = window.frameElement.radWindow;  
 
            return oWindow;  
        }  
 
        function CancelEdit() {  
            GetRadWindow().Close();  
        }  
    </script> 
 
    <link href="CSS/DialogStyles.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="PageScriptManager" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadFormDecorator ID="FormDecorator" runat="server" Skin="Vista" /> 
    <telerik:RadAjaxManager ID="PageAjaxManager" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="btnSubmitApproval">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="imgNotesRequired" /> 
                    <telerik:AjaxUpdatedControl ControlID="imgApprovalRequired" /> 
                    <telerik:AjaxUpdatedControl ControlID="errorMessage" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rdApproveByExecutive">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridBulkApproveCostCenters" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rdProposalLocked">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridBulkApproveCostCenters" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rdRejectToExecutive">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridBulkApproveCostCenters" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rdRejectToManager">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridBulkApproveCostCenters" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <div class="Content">  
        <div class="MainLabel">  
            <asp:Image ID="imgNotesRequired" runat="server" ImageUrl="~/Images/attention1.gif" 
                AlternateText="Notes are required" Visible="false" CssClass="RequiredFieldImage" /> 
            Approval Notes</div> 
        <div class="UserControl">  
            <telerik:RadEditor ID="txtApprovalNotes" runat="server" EditModes="Design" Skin="Vista" 
                Width="100%" Height="150px" EnableResize="False" StripFormattingOptions="MSWordRemoveAll">  
                <Tools> 
                    <telerik:EditorToolGroup> 
                        <telerik:EditorTool Name="Bold" /> 
                        <telerik:EditorTool Name="Italic" /> 
                        <telerik:EditorTool Name="Underline" /> 
                        <telerik:EditorTool Name="Indent" /> 
                        <telerik:EditorTool Name="Outdent" /> 
                    </telerik:EditorToolGroup> 
                    <telerik:EditorToolGroup> 
                        <telerik:EditorTool Name="InsertOrderedList" /> 
                        <telerik:EditorTool Name="InsertUnorderedList" /> 
                    </telerik:EditorToolGroup> 
                    <telerik:EditorToolGroup> 
                        <telerik:EditorTool Name="AjaxSpellCheck" /> 
                        <telerik:EditorTool Name="Copy" /> 
                        <telerik:EditorTool Name="Cut" /> 
                        <telerik:EditorTool Name="Paste" /> 
                        <telerik:EditorTool Name="PasteAsHtml" /> 
                        <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" /> 
                    </telerik:EditorToolGroup> 
                    <telerik:EditorToolGroup> 
                        <telerik:EditorTool Name="Undo" /> 
                        <telerik:EditorTool Name="Redo" /> 
                    </telerik:EditorToolGroup> 
                    <telerik:EditorToolGroup> 
                        <telerik:EditorTool Name="ToggleScreenMode" /> 
                    </telerik:EditorToolGroup> 
                </Tools> 
                <Content> 
                          
 
                          
 
                </Content> 
            </telerik:RadEditor> 
            <asp:CheckBox ID="chkPrivateNote" runat="server" Text="Cabinet Only Note" Checked="false" /> 
        </div> 
        <div class="MainLabel">  
            <asp:Image ID="imgApprovalRequired" runat="server" ImageUrl="~/Images/attention1.gif" 
                AlternateText="Please select an approval status." Visible="false" CssClass="RequiredFieldImage" /> 
            Approval Status</div> 
        <div class="UserControl">  
            <telerik:RadMultiPage ID="pgApprovalPageView" runat="server" CssClass="ApprovalBlock">  
                <telerik:RadPageView ID="vwManagerView" runat="server" Visible="true" Selected="true">  
                    <asp:RadioButton GroupName="Approval" Text="Approve" Checked="false" ID="rdExecutiveApproveToPortal" 
                        runat="server" /> 
                    <asp:RadioButton GroupName="Approval" Text="Reject" Checked="false" ID="rdExecutiveRejectToManager" 
                        runat="server" /> 
                </telerik:RadPageView> 
                <telerik:RadPageView ID="vwPortalAdminView" runat="server">  
                    <div class="SubControl">  
                        <label> 
                            Approve</label> 
                        <div class="RadioOptions">  
                            <asp:RadioButton GroupName="Approval" Text="Approve as Divisional VP" Checked="false" 
                                ID="rdApproveByExecutive" runat="server" AutoPostBack="true" /> 
                            <asp:RadioButton GroupName="Approval" Text="Lock Proposal" Checked="false" ID="rdProposalLocked" 
                                runat="server" AutoPostBack="true" /></div>  
                    </div> 
                    <div class="SubControl">  
                        <label> 
                            Reject</label> 
                        <div class="RadioOptions">  
                            <asp:RadioButton GroupName="Approval" Text="Reject to Divisional VP" Checked="false" 
                                ID="rdRejectToExecutive" runat="server" AutoPostBack="true" /> 
                            <asp:RadioButton GroupName="Approval" Text="Reject to Cost Center Manager" Checked="false" 
                                ID="rdRejectToManager" runat="server" AutoPostBack="true" /></div>  
                    </div> 
                </telerik:RadPageView> 
            </telerik:RadMultiPage></div>  
        <div class="MainLabel">  
            Affected Cost Centers</div> 
        <div class="UserControl">  
            <telerik:RadGrid ID="gridBulkApproveCostCenters" ShowFooter="true" runat="server" 
                Skin="Vista" AllowMultiRowEdit="true">  
                <MasterTableView AutoGenerateColumns="false" EditMode="InPlace">  
                    <Columns> 
                        <telerik:GridTemplateColumn HeaderText="Cost Center">  
                            <ItemTemplate> 
                                <%#Eval("FundID") %>-<%#Eval("UnitID") %>-<%#Eval("LineItemID") %> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridBoundColumn HeaderText="Description" ReadOnly="true" DataField="LedgerLineItem.Description" 
                            DataFormatString="{0:C}" /> 
                        <telerik:GridBoundColumn HeaderText="Current Budget" ReadOnly="true" DataField="CurrentBudget" 
                            DataFormatString="{0:C}" Aggregate="Sum" /> 
                        <telerik:GridNumericColumn HeaderText="Proposed" DataField="ProposedBudget" NumericType="Currency" 
                            Aggregate="Sum" ReadOnly="false" /> 
                    </Columns> 
                </MasterTableView> 
            </telerik:RadGrid> 
        </div> 
        <telerik:RadAjaxLoadingPanel ID="PageLoadingPanel" runat="server" Height="30px" Width="100%" 
            InitialDelayTime="0" MinDisplayTime="250" Transparency="2" IsSticky="true" CssClass="DialogFixedLoadingPanel">  
            <img alt="Loading..." src='Images/loading7.gif' style="border: 0px;" /> 
        </telerik:RadAjaxLoadingPanel> 
        <div id="errorMessage" runat="server" class="ErrorMessage" visible="false">  
        </div> 
        <div class="ButtonPanel">  
            <asp:Button ID="btnSubmitApproval" runat="server" Text="Submit" /><input type="button" 
                value="Cancel" onclick="CancelEdit();" /></div>  
    </div> 
    </form> 
</body> 
</html> 
 

    Protected Sub Approval_CheckedChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles rdProposalLocked.CheckedChanged, rdApproveByExecutive.CheckedChanged, rdRejectToExecutive.CheckedChanged, rdRejectToManager.CheckedChanged  
        If rdProposalLocked.Checked = True Then 
            For Each item As Telerik.Web.UI.GridItem In gridBulkApproveCostCenters.MasterTableView.Items  
                If TypeOf item Is Telerik.Web.UI.GridEditableItem Then 
                    Dim editableItem As Telerik.Web.UI.GridEditableItem = CType(item, Telerik.Web.UI.GridEditableItem)  
                    editableItem.Edit = True 
                End If 
            Next 
            gridBulkApproveCostCenters.Rebind()  
        Else 
            For Each item As Telerik.Web.UI.GridItem In gridBulkApproveCostCenters.MasterTableView.Items  
                If TypeOf item Is Telerik.Web.UI.GridEditableItem Then 
                    Dim editableItem As Telerik.Web.UI.GridEditableItem = CType(item, Telerik.Web.UI.GridEditableItem)  
                    editableItem.Edit = False 
                End If 
            Next 
            gridBulkApproveCostCenters.Rebind()  
        End If 
    End Sub 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        Page.Response.Cache.SetCacheability(HttpCacheability.NoCache)  
 
        Dim IDStoLoad As String = Request.QueryString("keys")  
        ExtractKeys(IDStoLoad)  
        If _keys.Count = 0 Then Response.Redirect("accessDenied.aspx?e=You do not have the ability to approve any of the selected items.&t=Approve Error"True)  
        If Not Page.IsPostBack Then 
            GetItems()  
            BindDataGrid()  
            SetUIVisibility()  
        End If 
        Dim EnableCabinetCheck As Boolean = False 
        EnableCabinetCheck = _WebHelper.GetSystemUser().CanSeePrivateNotes  
        chkPrivateNote.Visible = EnableCabinetCheck  
    End Sub 
 

Thanks for any ideas or pointers!
Chris
Top achievements
Rank 1
 answered on 17 Mar 2009
5 answers
249 views
I am using Rad grid ..I need to show grid without Lines

I set GridLines="None"

but there is no change...The lines are always show

How to i remove it

I am using

Skin

="Office2007"

 

in my rad grid
Dimo
Telerik team
 answered on 17 Mar 2009
11 answers
261 views
Hi,

We are actually customizing the Rad skins to our needs.
We are unable to set the Alternating row style color and the edititemstyle color in the Grid.Default.css

These two paarmeters need to be set only the page as a radgrid property.

The only option available in the CSS is the first child edit item color.

Could you please provide some help on this

Thanks
Bala
Dimo
Telerik team
 answered on 17 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?