Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
186 views
Hi All,

My requirement is as Follows:
1.Binding the HierarchicalData to the RadGrid Dynamically
(Achieved to bind the data dynamically up to the Fisrt Level
(i.e) MainGrid
    ----DetailsTables
                ----->GridTableView1
                ----->GridTableView2
                ----->GridTableView2
But not able to achieve the data as follows:
----DetailsTables
                ----->GridTableView1
                            ------------>DetailsTables
                                                    ------------>GridTableViewChild1
                ----->GridTableView2
                ----->GridTableView2


2.In the First GridTableView I need to have a Link Column
 ----DetailsTables
                ----->GridTableView1(having a linkButton Column)
                ----->GridTableView2
                ----->GridTableView2

3.When I click on the Link ,I need to redirect it to a new window with selected RowIndex
or the Selected Row Table-RowId(I mean the table PK Field ID) passed through query string .

I tried on  Pre-Render Event But Failed to get the selected row index and the Row Data.

Hope You understood it,else see the attached picture

Pavlina
Telerik team
 answered on 17 Feb 2010
5 answers
278 views
If i want to use the radfileexplorer in a grid edit form i get an error trying to find the fileName text box.  can you help me fix this line of code to get find this control.

function

 

OnFileSelected(wnd, fileSelected) {

 

 

var textbox = $get('<%= Master.Master.FindControl("ContentPlaceHolder1").FindControl("ContentPlaceHolder2").FindControl("RadGrid2").GridEditableItem.Controls["fileName"].ClientID %>');

 

textbox.value = fileSelected;

I have tried many ways and cannot figure this out. Thanks!

Fiko
Telerik team
 answered on 17 Feb 2010
1 answer
54 views
I ve been using radcontrols in my project. but it takes some time to refresh.previous data's that was binded will be shown  during the page load , after some time, it shows the datas.in other word rebinding takes some time. how can we increase the performance?
Georgi Tunev
Telerik team
 answered on 17 Feb 2010
2 answers
263 views
I want to extend RadTextBox by implementing RequiredFieldValidator. I did simillar functionality with asp:textbox :

Public Class MyTextBox 
        Inherits WebControls.TextBox 
 
        Private req As New RequiredFieldValidator 
 
        Protected Overrides Sub OnInit(ByVal e As EventArgs) 
            req.ControlToValidate = Me.ID 
            req.Display = ValidatorDisplay.Dynamic 
            req.ErrorMessage = "Please fill marked field(-s)" 
            req.Text = "*" 
            req.EnableClientScript = True 
            Controls.Add(req) 
        End Sub 
 
        Protected Overrides Sub Render(ByVal w As HtmlTextWriter) 
            MyBase.Render(w) 
            req.RenderControl(w) 
        End Sub 
 
 End Class 

When I want to inherit from RadTextBox (at line 2: Inherits Telerik.Web.UI.RadTextBox), code stops working with weird error:

Unable to find control id 'txtTest' referenced by the 'ControlToValidate' property of ''.


What I'm doing wrong? Thank you for your help!

Zdenek

Zdeněk
Top achievements
Rank 1
 answered on 17 Feb 2010
3 answers
263 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
71 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
127 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
326 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
107 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 Object, ByVal 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
166 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
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?