Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
257 views
Hi,
  I am using RadNumericTextBox inside EditItemTemplate of a RadGrid.  I have given DecimalDigits property of RadNumericTextBox as "2".  But it accepts more than 2 decimal places depending on the MaxLength property.  How can I restrict the decimal places only to 2 digits?  Code I have used given below:

 <telerik:GridTemplateColumn  HeaderText="Debit" UniqueName="debit" DataType="System.Decimal" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" >
                        <ItemTemplate>
                        <asp:Label ID="lblDbAmt" Text= '<%# Eval("dbamt") %>' CssClass="labels"   runat="server"> </asp:Label>
                        </ItemTemplate>
           
                       <EditItemTemplate>
                               <telerik:RadNumericTextBox ID="txtDbAmt" Text  = '<%# bind("dbamt") %>' MinValue="0" MaxValue="99999999" MaxLength="11" DataType="System.Decimal" Culture="en-GB"  AutoPostBack="false" ClientEvents-OnKeyPress="KeyPressed" EnabledStyle-HorizontalAlign="Right" runat="server">                   
                                           <NumberFormat AllowRounding="false" DecimalDigits="2" DecimalSeparator="." GroupSeparator="," GroupSizes="3" KeepNotRoundedValue="true"   />
                               </telerik:RadNumericTextBox>   
                       </EditItemTemplate>

                    </telerik:GridTemplateColumn>   


Alphonse

Dimo
Telerik team
 answered on 17 Feb 2010
1 answer
69 views

Hi,

 

 I had used Rad Controls and we got the error while using RadComboBox control at the time of design.

 

Error as follows:

 

“There was an error rendering the control. locationType is neither a DataColumn nor a DataRelation for table.”

Simon
Telerik team
 answered on 17 Feb 2010
4 answers
123 views
Hi! i just facing a problem when the grid either in edit/insert with popup. the popup( with modal) function is working fine without any grouping. but when there is any grouping in the grid and the popup edit form template will not appear but the screen become modal. it is fine for add record but not for update existing record. the code is attact below. please kindly to give me any advice (version 2008.3.1314.20)

<telerik:RadGrid ID="grdComment" runat="server" AutoGenerateColumns="False" GridLines="None" Skin="Office2007" AllowPaging="True" AllowSorting="True" Height="250px" ShowGroupPanel="True" OnNeedDataSource="grdComment_NeedDataSource" PageSize="20" OnItemCreated="grdComment_ItemCreated" > 
                                <HeaderContextMenu Skin="Office2007">  
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                </HeaderContextMenu> 
                                <MasterTableView CommandItemDisplay="Top" EditMode="PopUp" Name="ServiceBusiness" DataKeyNames="Project_Service_Id_Text"  ClientDataKeyNames="Project_Service_Id_Text">  
                                    <Columns> 
                                        <telerik:GridEditCommandColumn > 
                                        </telerik:GridEditCommandColumn> 
                                        <telerik:GridBoundColumn DataField="Project_Service_Id_Text" HeaderText="Project_Service_Id_Text" 
                                            UniqueName="Project_Service_Id_Text">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Parent_Service_Business_Id_Text" UniqueName="Parent_Service_Business_Id_Text" DataField="Parent_Service_Business_Id_Text" Visible="False">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Service Category" UniqueName="Parent_Service_Business_Name" DataField="Parent_Service_Business_Name">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Service_Business_Id_Text" UniqueName="Service_Business_Id_Text" DataField="Service_Business_Id_Text" Visible="False">  
                                            <HeaderStyle Width="100px" /> 
                                            <ItemStyle Width="100px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Service" UniqueName="Service_Business_Name" DataField="Service_Business_Name">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Service_Status_Id_Text" HeaderText="Service_Status_Id_Text" 
                                            UniqueName="Service_Status_Id_Text" Visible="False">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Service_Status_Name" HeaderText="Status" UniqueName="Service_Status_Name">  
                                            <HeaderStyle Width="120px" /> 
                                            <ItemStyle Width="120px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Start Date" UniqueName="Start_Date" DataField="Start_Date" DataFormatString="{0:d-MMM}" DataType="System.DateTime">  
                                            <HeaderStyle Width="120px" /> 
                                            <ItemStyle Width="120px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Latest Comment" UniqueName="Latest_Comment" DataField="Latest_Comment">  
                                            <HeaderStyle Width="250px" /> 
                                            <ItemStyle Width="250px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Employee_Name" HeaderText="Employee" UniqueName="Employee_Name">  
                                            <HeaderStyle Width="120px" /> 
                                            <ItemStyle Width="120px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Latest_Comment_Date" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" 
                                            DataType="System.DateTime" HeaderText="Date" UniqueName="Latest_Comment_Date">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                    <NoRecordsTemplate> 
                                        No Service and Comment found!  
                                    </NoRecordsTemplate> 
                                    <CommandItemSettings AddNewRecordText="+ Service" /> 
                                    <EditFormSettings   EditFormType="Template" > 
                                        <PopUpSettings  Modal="True" Width="300px"/>  
                                        <FormTemplate> 
                                            <table border="0" cellpadding="0" cellspacing="1" width="100%">  
                                                <tr> 
                                                    <td>Service:</td> 
                                                    <td> 
                                                        <telerik:RadComboBox ID="cboServiceType" runat="server" Skin="Outlook" Width="200px">  
                                                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                                        </telerik:RadComboBox> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Status:</td> 
                                                    <td> 
                                                        <telerik:RadComboBox ID="cboServiceStatus" runat="server" Skin="Outlook" Width="200px">  
                                                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                                        </telerik:RadComboBox> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Start Date:</td> 
                                                    <td> 
                                                        <telerik:RadDatePicker ID="dtpServiceStartDate" runat="server" Skin="Default2006" Width="200px">  
                                                            <Calendar Skin="Default2006" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                                                                ViewSelectorText="x">  
                                                            </Calendar> 
                                                            <DatePopupButton HoverImageUrl="" ImageUrl="" /> 
                                                            <DateInput DateFormat="dd-MM-yyyy">  
                                                            </DateInput> 
                                                        </telerik:RadDatePicker> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td colspan="2" align="right">  
                                                        <asp:Button ID="btnServiceAdd" runat="server" Text="Add" CommandName="Cancel" OnClientClick="if (!btnServiceAdd_OnClick()) return false;" Width="64px" /> 
                                                        <asp:Button ID="btnServiceUpdate" runat="server" Text="Update" CommandName="Cancel" OnClientClick="if (!btnServiceUpdate_OnClick()) return false;" Width="64px" /> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                            <asp:HiddenField ID="fldProjectServiceIdText" runat="server" /> 
                                              
                                        </FormTemplate> 
                                        <EditColumn UniqueName="EditCommandColumn1">  
                                        </EditColumn> 
                                    </EditFormSettings> 
                                </MasterTableView> 
                                <FilterMenu Skin="Office2007">  
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                </FilterMenu> 
                                <ClientSettings AllowDragToGroup="True">  
                                    <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                                    <ClientEvents OnPopUpShowing="PopUpShowing" /> 
                                </ClientSettings> 
                            </telerik:RadGrid> 
 
protected void grdComment_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
    {  
        if (PropertyId != null)  
        {  
            DataSet ds = new DataSet();  
            ds = GetCommentDataSet(EmployeeId, PropertyId);  
            ds.Tables[0].PrimaryKey = new DataColumn[] { ds.Tables[0].Columns["Project_Service_Id_Text"] };   
            grdComment.DataSource = ds;  
        }  
    }  
 
 
    protected void grdComment_ItemCreated(object sender, GridItemEventArgs e)  
    {  
        RadComboBox radCombo;  
        Button btn;  
        RadDatePicker dtp;  
        HiddenField fld;  
          
        if (e.Item.OwnerTableView.Name == "ServiceBusiness") {  
            if ( e.Item is GridEditFormItem && e.Item.IsInEditMode){  
                if (e.Item.OwnerTableView.IsItemInserted)  
                {  
                    GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();  
                    if (insertedItem != null)  
                    {  
                        radCombo = (RadComboBox)insertedItem.FindControl("cboServiceType");  
                        radCombo.DataSource = GetServiceBusinessDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Name";  
                        radCombo.DataValueField = "Service_Business_Id_Text";  
 
                        radCombo = (RadComboBox)insertedItem.FindControl("cboServiceStatus");  
                        radCombo.DataSource = GetServiceBusinessStatusDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Status_Name";  
                        radCombo.DataValueField = "Service_Status_Id_Text";  
                        btn = (Button)insertedItem.FindControl("btnServiceAdd");  
                        btn.Visible = true;  
                        btn = (Button)insertedItem.FindControl("btnServiceUpdate");  
                        btn.Visible = false;  
                    }  
                }  
                else {   
                    GridItem updatedItem = e.Item;  
                    if (updatedItem != null)  
                    {  
                        radCombo = (RadComboBox)updatedItem.FindControl("cboServiceType");  
                        radCombo.DataSource = GetServiceBusinessDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Name";  
                        radCombo.DataValueField = "Service_Business_Id_Text";  
 
                        if (DataBinder.Eval(e.Item.DataItem, "Service_Business_Id_Text") != null)  
                        {  
                            radCombo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Service_Business_Id_Text").ToString();  
                        }  
                        radCombo.Enabled = false;  
 
                        radCombo = (RadComboBox)updatedItem.FindControl("cboServiceStatus");  
                        radCombo.DataSource = GetServiceBusinessStatusDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Status_Name";  
                        radCombo.DataValueField = "Service_Status_Id_Text";  
                        if (DataBinder.Eval(e.Item.DataItem, "Service_Business_Id_Text") != null)  
                        {  
                            radCombo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Service_Status_Id_Text").ToString();  
                        }  
 
                        dtp = (RadDatePicker)updatedItem.FindControl("dtpServiceStartDate");  
                        if (DataBinder.Eval(e.Item.DataItem, "Start_Date") != null)  
                            if (DataBinder.Eval(e.Item.DataItem, "Start_Date") != DBNull.Value)  
                            {  
                                dtp.SelectedDate = DateTime.Parse( DataBinder.Eval(e.Item.DataItem, "Start_Date").ToString());  
                            }  
 
                        fld = (HiddenField)updatedItem.FindControl("fldProjectServiceIdText");  
                        if (DataBinder.Eval(e.Item.DataItem, "Project_Service_Id_text") != null)  
                            fld.Value = DataBinder.Eval(e.Item.DataItem, "Project_Service_Id_text").ToString();  
 
                        btn = (Button)updatedItem.FindControl("btnServiceAdd");  
                        btn.Visible = false;  
                        btn = (Button)updatedItem.FindControl("btnServiceUpdate");  
                        btn.Visible = true;  
 
                          
 
                    }  
                  
                }  
            }  
        }  
    } 

From CH
Iana Tsolova
Telerik team
 answered on 17 Feb 2010
1 answer
311 views
Hi,

I want to use a RadTextBox with attribute TextMode set to MultiLine in a RadGrid.  Unfortunately, the rendering always seems to be a <input type="text" where I want a <textarea></textarea> to apply autogrowing.

Is theres a way to achieve this ?

Thank you,
AT
Veli
Telerik team
 answered on 17 Feb 2010
1 answer
105 views
Hi There,

I have a Grid control with a column which is used to render an icon based on a bound value.

The DocumentIconTemplate class looks like this

 

 

Public Class DocumentIconTemplate  
    Implements ITemplate  
 
    Private m_Name As String 
 
    Public Sub New(ByVal name As String)  
        m_Name = name  
    End Sub 
 
 
    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn  
 
        Dim dataCell As GridTableCell = container  
        Dim dataItem As GridDataItem = CType(container.NamingContainer, GridDataItem)  
 
        Dim img As New Image()  
        img.ID = m_Name  
        AddHandler img.DataBinding, AddressOf BindImage  
 
        container.Controls.Add(img)  
 
    End Sub 
 
    Public Sub BindImage(ByVal sender As ObjectByVal e As EventArgs)  
        Dim img As Image = CType(sender, Image)  
        Dim container As GridDataItem = CType(img.NamingContainer, GridDataItem)  
        img.ID = m_Name  
        img.ImageUrl = "Scr.Bmp" 
    End Sub 
 
 
End Class 

and the custom column looks like this
            Dim column As GridTemplateColumn  
 
            column = New GridTemplateColumn()  
            column.HeaderText = "Type" 
            column.DataField = "Type" 
            column.UniqueName = "Type" 
            column.ItemTemplate = New DocumentIconTemplate("Type")  
            gridControl.MasterTableView.Columns.Add(column) 

All is well and this renders fine until I create a hierarchical grid or use some operation that requires a postback. When I expand the row (to show the second level of the hierarchy) my custom image disappears although all "text" based fields remain.When you expand the row the grid posts back to the server and when it comes back Grid columns that have Text set on them still have their values. I'm not sure if it the viewstate or the control heirarchy that is the problem here. On postback the grid doesn't call the InstantiateIn again so I presume it's trying to re-render itself just using viewstate.

It does keep the image if you use the <ItemTemplate> and create the image declaratively however outside of this simple test app the columns need to be created dynamically.

Any help/thoughts appreciated.

Adrian

Veli
Telerik team
 answered on 17 Feb 2010
3 answers
161 views
Hi all ,
I have applied Rad skin manager for my master page total working fine but page navigation differs for skin to skin any solution will be helpful.Here iam attaching the images.Pager style is looking good for Office 2007 not for sunset how can i achieve consistency.
Dimo
Telerik team
 answered on 17 Feb 2010
1 answer
177 views
I have a couple of grids that I need to do this on, each grid has 3 or 4 GridDropDownColumns - i'm not sure the best way to implement this.

I understand that each GridDropDownColumn will receive it's items list from (in my case) an ObjectDataSource, so as I move from the 1st dropdown to the 2nd,  the 2nd dropdown needs to be passed the value of he 1st dropdown so it can re-evaluate it's list and rebind .. and so the pattern flows along the columns.

My ObjectDataSource will have a custom SelectMethod,  so I guess my questions are:
  1. How do I pass into the SelectMethod of the 2nd columns ObjectDataSource the value that was selected from the 1st columns DropDown?
  2. Once i'm in the SelectMethod of the 2nd column and i've received the value of the 1st columns dropdown,  how do I force the 2nd column to re-evaluate it's ObjectDataSource  -- from what I can tell the data is bound upfront as the grid item goes into edit mode; so I would need to trigger on value change of the 1st drop down that the 2nd drop-down needs to re-evaluate it's selection list.
  3. Do you have any simple examples of this cascading effect inside a grid?  I've seen examples of cascading behavour but not inside a grid.

Thankyou
Brian.
Veli
Telerik team
 answered on 17 Feb 2010
0 answers
405 views
Q1 2010 BETA

There is a known issue with Firefox sometimes crashing when using RadAsyncUpload if the current version (1.5.0) of the Firebug extension is installed. This is a reported bug in the Firebug extension. It's already fixed in the latest source code of the extension and the next version of Firebug should resolve the issue.

It is possible to work around the problem at this moment by disabling Firebug's Net Panel.
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 17 Feb 2010
3 answers
61 views
Hi,

Is it possible to add items to a combobox which uses an itemtemplate when it's databound using client side code?

Thanks
Jon
Yana
Telerik team
 answered on 17 Feb 2010
1 answer
76 views
I've tried uninstalling, reinstalling RadControls.. resetting toolbox.. etc.  I do have the 'Telerik' menu item, but only the 'about' item under it.
RadControls/tools/extensions do appear in VS2008 as expected.

Anybody else seeing this?  Is there a way to install them manually??

Thanks.
David
Andrey
Telerik team
 answered on 17 Feb 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?