Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
97 views

 
                if (confirm("Are you sure want to delete this data?")) { 
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("DeleteNow:" + data.innerHTML); 
 
                    alert("Deleted"); // if i dont have this, ajaxRequest is not triggered, with this alert box it is. 
                     
                } else { return false; } 
Pavlina
Telerik team
 answered on 05 Jan 2010
7 answers
135 views
I have a combo box that has a list of Part Numbers and its in template so it shows:
 ______________________________
|Part Number: 1234-1234-1234-1234    |
|Facility: NY Facility                                |
--------------------------------------------------
|Part Number: 1234-1234-1234-1234    |
|Facility: PA Facility                                |
--------------------------------------------------
|Part Number: 1234-1234-1234-1234    |
|Facility: NJ Facility                                 |
--------------------------------------------------

I have it setup so the onselectedindexchanged will put the PN into a TextBox, but I would also like to put the Facility into a TextBox also.  How would I achieve this?  I cant load the entire dataset as it has >100k records and causes far too much overhead.  (I have it setup to load on demand and only sugest PN after 4 characters have been entered)

    Protected Sub RadComboBox3_SelectedIndexChanged(ByVal o As ObjectByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)  
        Dim editedItem As GridEditableItem = CType(CType(o, RadComboBox).NamingContainer, GridEditableItem)  
        Dim PNCombo As RadComboBox = CType(editedItem.FindControl("RadComboBox3"), RadComboBox)  
        
        Dim PNBOX As TextBox = CType(editedItem.FindControl("PN"), TextBox)  
        Dim FACBOX As TextBox = CType(editedItem.FindControl("FAC"), TextBox)  
 
 
        PNBOX.Text = PNCombo.SelectedValue  
        FACBOX.Text = ????????
 
    End Sub 


Simon
Telerik team
 answered on 05 Jan 2010
5 answers
184 views
I have a screen with a few grids on it.  Here is a copy of one of those grid
<telerik:RadPageView ID="pvRegistration" runat="server">  
                                    <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server">  
                                        <telerik:RadGrid ID="rgRegistration" runat="server" GridLines="None" AllowSorting="True" 
                                            AllowPaging="true" PageSize="10" AllowMultiRowEdit="false" AutoGenerateColumns="False" 
                                            ShowStatusBar="true" OnNeedDataSource="Registration_NeedDataSource" OnItemDataBound="Registration_ItemDataBound" 
                                            OnUpdateCommand="RegistrationGrid_UpdateCommand" OnInsertCommand="RegistrationGrid_InsertCommand" 
                                            OnDeleteCommand="RegistrationGrid_DeleteCommand"   
                                            Skin="Office2007" Width="100%" > 
                                            <MasterTableView CommandItemDisplay="Top" DataKeyNames="RepFirmID" EditMode="InPlace">  
                                                <Columns> 
                                                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">  
                                                        <HeaderStyle Width="50px" /> 
                                                    </telerik:GridEditCommandColumn> 
                                                    <telerik:GridTemplateColumn HeaderText="Firm Type" SortExpression="FirmTypeDescription" 
                                                        UniqueName="FirmType">  
                                                        <ItemTemplate> 
                                                            <asp:Label ID="lbFirmType" runat="server" Text='<%# Eval("FirmTypeDescription")%>' /> 
                                                        </ItemTemplate> 
                                                        <EditItemTemplate> 
                                                            <telerik:RadComboBox ID="rcbFirmType" DataTextField="FirmTypeDescription" DataValueField="FirmTypeID" 
                                                                runat="server" Width="300px" /> 
                                                            <asp:RequiredFieldValidator ControlToValidate="rcbFirmType" ErrorMessage="*" InitialValue="Select Type" 
                                                                runat="server" ToolTip="Type is  Required" FontColor="Red" /> 
                                                            <asp:Label runat="server" ID="lbFirmTypeID" Visible="false" Text='<%# Eval("FirmTypeID") %>'></asp:Label></EditItemTemplate>  
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridButtonColumn ConfirmText="Remove this Firm?" ConfirmDialogType="RadWindow" 
                                                        CommandName="Delete" ConfirmTitle="Delete" Text="Delete" ShowInEditForm="false">  
                                                        <HeaderStyle Width="25px" /> 
                                                    </telerik:GridButtonColumn> 
                                                </Columns> 
                                                <EditFormSettings> 
                                                    <EditColumn ButtonType="ImageButton" InsertText="Insert" UpdateText="Update" UniqueName="EditCommandColumn1" 
                                                        CancelText="Cancel">  
                                                    </EditColumn> 
                                                    <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> 
                                                </EditFormSettings> 
                                                <PagerStyle Mode="NumericPages"></PagerStyle> 
                                            </MasterTableView> 
                                        </telerik:RadGrid> 
                                        <button onclick="ShowForm('FirmType'); return false;">  
                                            Edit Type</button> 
                                    </telerik:RadAjaxPanel> 
                                </telerik:RadPageView> 

at run time I need to change the way the grid works according to Page.User.IsInRole

if the user is not in the correct role I want to display the grid but reomve the edit, delete, and add ne functionality.

I tried
  protected void Registration_PreRender(object sender, EventArgs e)  
        {  
            if (!Page.User.IsInRole("COMPLIANCE USER"))  
            {  
                  
                rgRegistration.AllowAutomaticInserts = false;  
                rgRegistration.AllowAutomaticUpdates = false;  
                rgRegistration.AllowAutomaticDeletes = false;  
                //rgRegistration.MasterTableView.RenderColumns[3].Display = false;  
            }  
        } 
but the grid still had the functionality.  is there anyway to do this?
Eric Klein
Top achievements
Rank 1
 answered on 05 Jan 2010
2 answers
199 views
Hi I was able to create dynamic column creation using code behind but I'm having a problem when I click on delete button, my gridTemplateColumn checkbox disappears.
Heres my code:
<rad:radgrid id="RadGrid1" runat="server" Height="200px" AllowMultiRowSelection="True" ForeColor="White" AllowMultiRowEdit="True" Skin="outlook" width="985px" ItemStyle-BackColor="WhiteSmoke" AlternatingItemStyle-BackColor="White" BorderStyle="None" GridLines="Both">  
 
<AlternatingItemStyle Font-Size="Small" Font-Names="Arial Narrow" HorizontalAlign="Left" VerticalAlign="Middle" BorderStyle="None" CssClass="AlternatingItemRow" BackColor="White"></AlternatingItemStyle> 
                          
<MasterTableView DataKeyNames="ID" AllowAutomaticInserts="True" EditMode="InPlace" CommandItemDisplay="Top" AutoGenerateColumns="False">  
 
<CommandItemStyle BackColor="#FFE39A"></CommandItemStyle> 
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle"></ItemStyle> 
 
                              
<CommandItemTemplate> 
    <table class="MyCommandItemClass" width="100%">  
    <tr> 
                                        <td align="left" style="width: 75%; padding-top:4px">  
                                            <asp:Label ID="lblPN" runat="server" Text="PlanName" CssClass="basicfontbold" ForeColor="black" Font-Size="12px" Visible="true"></asp:Label> 
                                              
                                              
                                        </td> 
                                           
                                        <td align="right">  
                                        <asp:Button id="btnAdd" Runat="server" CommandName="InitInsert"  ToolTip="Add New Record" Text="Add" CssClass="ButtonGray" Visible='<%# Not RadGrid1.MasterTableView.IsItemInserted and showInsert %>' /> 
                                              
                                            <asp:Button ID="PerformInsert" runat="server" CommandName="PerformInsert"  ToolTip="Save" CssClass="ButtonRed" Text="Save" Visible='<%# RadGrid1.MasterTableView.IsItemInserted and showInsert %>'/>  
                                            <asp:Button ID="CancelInsert" runat="server" CommandName="CancelInsert" ToolTip="Cancel" CssClass="ButtonGray" Text="Cancel" Visible='<%# RadGrid1.MasterTableView.IsItemInserted and showInsert %>'/>  
                                              
                                           <asp:Button id="Linkbutton1" Runat="server" CommandName="DeleteChecked" Text="Delete" CssClass="ButtonGray" Visible='<%# Not RadGrid1.MasterTableView.IsItemInserted and showDelete %>' Enabled='<%# showDelete %>'/>  
                                          
                                          
                                              
                                        </td> 
                                                                            </tr> 
                                </table> 
                            </CommandItemTemplate> 
                            <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px"></HeaderStyle> 
                            </ExpandCollapseColumn> 
                            <FooterStyle BorderStyle="None" BackColor="#FFE39A"></FooterStyle> 
                        </MasterTableView> 
                          
                        <HeaderStyle Font-Size="Small" Font-Names="Arial Narrow" Font-Bold="True" ForeColor="White" ></HeaderStyle>  
                        <SelectedItemStyle CssClass="RadGridSelectedItem"></SelectedItemStyle> 
                        <ItemStyle Font-Size="Small" Font-Names="Arial Narrow" HorizontalAlign="Left" VerticalAlign="Middle"></ItemStyle> 
                        <ClientSettings> 
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting> 
                            <Resizing ResizeGridOnColumnResize="True" AllowColumnResize="True"></Resizing> 
                            <ClientEvents OnRowDeselected="RowDeselected" OnRowSelected="RowSelected" OnRowCreated="RowCreated"></ClientEvents> 
                            <Scrolling ScrollHeight="202px" AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="5"></Scrolling> 
                        </ClientSettings> 
                    </rad:radgrid> 

Code behind
 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load  
If Not IsPostBack Then  
 
Try  
                Dim boundColumn As GridBoundColumn  
                boundColumn = New GridBoundColumn()  
                RadGrid1.MasterTableView.Columns.Add(boundColumn)  
                boundColumn.HeaderText = "ID" 
                boundColumn.DataField = "ID" 
                boundColumn.UniqueName = "ID" 
                boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left  
                boundColumn.ItemStyle.VerticalAlign = VerticalAlign.Middle  
                boundColumn.ReadOnly = True 
                boundColumn.Visible = False 
            Catch ex As Exception  
 
            End Try  
 
            Try  
                Dim templateColumnName As String = "Delete" 
                Dim templateColumn As New GridTemplateColumn()  
                templateColumn.ItemTemplate = New GridCheckboxTemplate(templateColumnName)  
                templateColumn.HeaderImageUrl = "images/delete.gif" 
                templateColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center  
                templateColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Left  
                templateColumn.ItemStyle.VerticalAlign = VerticalAlign.Middle  
                templateColumn.HeaderStyle.Width = Unit.Pixel(23)  
                templateColumn.ItemStyle.Width = Unit.Pixel(35)  
                RadGrid1.MasterTableView.Columns.Add(templateColumn)  
            Catch ex As Exception  
 
            End Try  


            Several more columns defined here.....

            RadGrid1 Code Binding here.......

end if  
end sub  
 
Private Class GridCheckboxTemplate  
        Implements ITemplate  
        Protected boolValue As CheckBox  
        Private colname As String  
        Public Sub New(ByVal cName As String)  
            colname = cName 
        End Sub  
        Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn  
            boolValue = New CheckBox()  
            boolValue.ID = "CheckBox1" 
            AddHandler boolValue.DataBinding, AddressOf boolValue_DataBinding  
            boolValue.Enabled = True 
            boolValue.AutoPostBack = False 
            container.Controls.Add(boolValue)  
        End Sub  
        Sub boolValue_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
            Dim cBox As CheckBox = DirectCast(sender, CheckBox)  
            Dim container As GridDataItem = DirectCast(cBox.NamingContainer, GridDataItem)  
              
 
        End Sub  
          
    End Class  
 
 
Im using the checkbox column template to delete all items thats been checked.
Any feedback would be appreciated.

Thanks in advance,
RJ
RJ
Top achievements
Rank 1
 answered on 05 Jan 2010
3 answers
326 views
Hi,

How can I disable the spellchecking feature of radeditor?

Right now I get an error message about copying en-US.tdf to /App_data, but I'd rather just disable the whole thing. How can I do that ?

Best regards,

Jan Hansen
Rumen
Telerik team
 answered on 05 Jan 2010
2 answers
153 views
This should be easy, but I can't find an answer..............

On the initial load of my page I do not want to show the scheduler, nor is there data to bind to it.  Even though the scheduler is set to disabled and not visible I get a runtime error that the bind fields were not all supplied.  Is there any way to not bind the scheduler?  I will want to bind it later, but not yet
Chris Trina
Top achievements
Rank 1
 answered on 05 Jan 2010
3 answers
226 views
I have a page that I need to process the "Enter" key to perform a specific function based on the srcElement.  I have set all of the buttons on the page to not user default submit behavior to prevent them from clicking with the enter key.  However the grid sort icon renders as an input type=submit.  This is click when I press the enter key.

Is there a way to have the sort icon to not render as a submit type?
Dimo
Telerik team
 answered on 05 Jan 2010
1 answer
87 views
Hi,

Is it possible to change text "loading" in Rad AjaxLoadingPanel loading image.
I am using image "Loading.gif". In this image i want the circle with the changes in text "loading".
Please help ASAP.

Regards
Jyoti
Hus Damen
Top achievements
Rank 1
 answered on 05 Jan 2010
4 answers
440 views
I have a radeditor that is in a user control that is used as the form for a radgrid....

so, when i am in edit mode (popup and modal) the form and the editor appear correctly.. however, when i press the fullscreen icon in the editor, it goes fullscreen behind the modal screen...

how can I remedy this?

thanks!

pic 1

pic 2
Rumen
Telerik team
 answered on 05 Jan 2010
7 answers
157 views
Hello,

I am in search for a forum control providing standart functionnalities (like this one).
I spent hours on codeplex but found nothing serious.
I also tryed YAF but it suffers from 2 points: not stable version, incredible license.

As I am not using MVC, I won't start with it before some years.

So I would appreciate Telerik to instroduce a new 'RadForum' control in next version.
Seems that everything is already here.

Same request for 'RadBlog' but less urgent, here I am looking for the featured enhancing last 'bloged' subjects just as in MS Blogs.

Thanks you for attention.

CS
Sebastian
Telerik team
 answered on 05 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?