Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
267 views
Hello Guys,

How can I change the column width for one column in the Details View of a MasterView

Thanks
Wendy Hunt
Top achievements
Rank 2
 answered on 05 Jan 2010
2 answers
135 views
Hi
In my skin file i have the following. 

<

 

telerik:RadComboBox runat="server" AppendDataBoundItems="true" > 
 <
Items> 
<te
lerik:RadComboBoxItem Text="Select" Value="" /> 
</
Items> 
</t
elerik:RadComboBox> 

 

This works fine when I am using databound items to append to the drop down. I have come to scenario where I need to just use some static items in my control page. ie
  <telerik:RadComboBox ID="Arrangement" runat="server">  
<Items>  
<telerik:RadComboBoxItem Text="Service Contract" Value="Service Contract" />  
 <telerik:RadComboBoxItem Text="Contract" Value="Contract" />  
</Items>  
</telerik:RadComboBox>

I would like to return a result as
>Select
>Service Contract
>Contract

problem is that when I use the <items> tag in my skin file, I can't use it again in my code page.
Is there some other default value I can so as to avoid an empty drop down box on all my pages. I like seeing select as the default vs blank or the first items in lists.
mac

 

 

 

 

 

 

 

 

 

mac
Top achievements
Rank 1
 answered on 05 Jan 2010
1 answer
178 views
                <telerik:RadComboBox ID="cmbCategoria"   
                                     runat="server" 
                                     DataSourceID="odsCategoria"   
                                     DataValueField="Id" 
                                     DataTextField="Descrizione" 
                                     AppendDataBoundItems="true" 
                                     SelectedValue='<%# Bind("IdCategoria") %>'>  
                    <Items> 
                        <telerik:RadComboBoxItem Value="XXX" /> 
                    </Items> 
                </telerik:RadComboBox> 

Can I set null in Value of RadioComboBoxItem?
Simon
Telerik team
 answered on 05 Jan 2010
1 answer
346 views
Hi,

I am using raddate picker and raddateinput for getting a input date. I need to validate the input date format as mm/dd/yy. I am using OnError function to validate. but it not working properly. is there any alternate way to validate the formate of the datepicker. i am trying to get the text in that dateinput. but i couldnot get if the format is wrong

 <telerik:RadDatePicker ID="textBoxDOB" Skin="Web20" Culture="en-US" Width="100px"
                                    MinDate="01/01/1900" runat="server">
                                    <Calendar ID="CalendarDOB" runat="server" ShowOtherMonthsDays="false" ShowRowHeaders="false"
                                        Skin="WebBlue" BorderWidth="1">
                                    </Calendar>
                                    <DateInput ClientEvents-OnError="OnError" runat="server" ID="raddateDOB" Culture="en-US"
                                          MaxLength="10" ReadOnly="false" MinDate="01/01/1900"  >
                                    </DateInput>
                                    <DatePopupButton HoverImageUrl="../Images/calendar.png" ImageUrl="../Images/calendar.png" />
                                </telerik:RadDatePicker>




function OnError(sender, args) {
                 alert('Invalid date');
                
            }
Thanks,
Jeevitha
Pavlina
Telerik team
 answered on 05 Jan 2010
3 answers
99 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
148 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 Object, ByVal 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
187 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
204 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
347 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
159 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?