Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
102 views
Ok, this might be a known issue.

The problem is, I am adding a user control on a page on-the-fly. I have RadDateTimePicker and RadComboBox on that page. Both have skin set to "Outlook". When added like this, DateTime control shows date and time buttons below the input box of Date time like this:

[________________________]
[DateButton] [TimeButton]


instead of showing it like:

[________________________] [DateButton] [TimeButton]



Also, the RadComboBox is showing combo drop down arrow below the combo input box, like this:

[______________]
[ArrowButton]



instead of showing it like:

[______________] [ArrowButton]


Is this because I am programmatically (dynamically) adding the control to page?



Please can you guys guide me?


Kind Regards

Fawad
Fawad
Top achievements
Rank 1
 answered on 17 Oct 2009
1 answer
138 views
Hi-

Is there a way to get the "+" boxes to align with the checkboxes for RadTreeNodes which are at the same level?  I'm hoping to get the boxes at each level to line up, regardless of whether they are for navigation or for selection.

Thanks,

-Mike
Mike Bridge
Top achievements
Rank 1
 answered on 16 Oct 2009
1 answer
115 views
Hi,

I have two radtreeviews, in which I can drag and drop nodes from one tree to another. My problem is that when I want to save changes made due to the drag and drops in a button click event, the RadTreeView1.GetAllNodes().Count returns only the original number of nodes in the tree, but not the new number of nodes as a result of the drag and drop operation. Also if I try to refresh the page after drag and drop the changes are lost. I am using the client-side drag and drop. Please help me.


Thanks!
Schlurk
Top achievements
Rank 2
 answered on 16 Oct 2009
0 answers
74 views
Hi

As we have upgraded the telerik control to latest 2009, even then first time when we select the radcombobox it is showing the background dropdowns.

first time only we are getting this issue, from 2nd click onwards it is working fine.

attached is the screenshot, so that it will be very clear.

regards,
Nageswara Rao Eluru.
Nagesh
Top achievements
Rank 2
 asked on 16 Oct 2009
1 answer
99 views
I want to get the RadGrid selectitems with other button after I used <telerik:GridButtonColumn UniqueName="SelectColumn" Text="Select" CommandName="Select" /> for selected the row, but I found cannot get it , the RadGridView.SelectedItems is 0 when I click other button, is this a normal or a bug?

Thanks!

Schlurk
Top achievements
Rank 2
 answered on 16 Oct 2009
7 answers
416 views

I have been struggling with a problem for the last few days and finally found a solution.  It wasn’t a sophisticated fix so I wanted to know if there is a better way to do this.  I have a custom CommandName that looks up data in an asset database so that the user can enter an asset tag to populate the rest of the editform dynamically.  I have also added an extra button that is created when the PerfromInsertButton is present.    Previously I had this attached to the CancelButton but when I tried using my custom  CommandName from Edit (as opposed to Insert) I got an error saying “Index was out of Range”. 

 

Long story short, I decided to just attach my custom button to the PerfromInsertButton button so that it only shows up on Insert and not Edit.  It isn’t elegant but I was hoping for a better outcome.

 

Any ideas?

My RadGrid

 

<telerik:RadGrid ID="transferGrid" runat="server" DataSourceID="transferData" GridLines="None" 
                AllowAutomaticInserts="True" Skin="Office2007" AutoGenerateColumns="False" AllowAutomaticDeletes="True" 
                Visible="false" AutoGenerateEditColumn="true" AllowAutomaticUpdates="true">  
                <HeaderContextMenu EnableTheming="True">  
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                </HeaderContextMenu> 
                <ClientSettings> 
                    <Selecting AllowRowSelect="True" /> 
                </ClientSettings> 
                <MasterTableView DataKeyNames="ID" DataSourceID="transferData" EditMode="EditForms" 
                    CommandItemDisplay="Bottom">  
                    <NoRecordsTemplate> 
                        <asp:Label runat="server" Text="No Assets have been added"></asp:Label> 
                    </NoRecordsTemplate>                     
                    <CommandItemTemplate> 
                        <div class="noprint" style="text-align: right;">  
                            <asp:Button ID="btnAdd" runat="server" Text="Add New Asset" CommandName="InitInsert">  
                            </asp:Button> 
                            <asp:Button ID="btnDelete" runat="server" Text="Delete Selected Asset" ToolTip="Click asset to select" 
                                CommandName="DeleteSelected"></asp:Button> 
                        </div> 
                    </CommandItemTemplate> 
                  <EditFormSettings> 
                        <EditColumn UniqueName="InsertCommandColumn" ButtonType="PushButton" ItemStyle-Font-Bold="true" 
                            InsertText="Save Asset">                              
                        </EditColumn>                                                                                       
                    </EditFormSettings> 
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID" 
                            DataType="System.Int32" ReadOnly="True" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Manufacturer_Name" HeaderText="Manufacturer Name" 
                            SortExpression="Manufacturer_Name" UniqueName="Manufacturer_Name" MaxLength="30">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Model" HeaderText="Model" SortExpression="Model" 
                            UniqueName="Model" MaxLength="18">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Tag" HeaderText="Tag" SortExpression="Tag" UniqueName="Tag" 
                            MaxLength="8">  
                        </telerik:GridBoundColumn>                          
                        <telerik:GridBoundColumn DataField="PO" HeaderText="PO" SortExpression="PO" UniqueName="PO" 
                            MaxLength="10">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Serial" HeaderText="Serial" SortExpression="Serial" 
                            UniqueName="Serial" MaxLength="18">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Value" HeaderText="Value" SortExpression="Value" 
                            UniqueName="Value" MaxLength="8">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridEditCommandColumn Display="false"></telerik:GridEditCommandColumn>    
                    </Columns> 
                </MasterTableView> 
                <FilterMenu EnableTheming="True">  
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                </FilterMenu> 
            </telerik:RadGrid> 

Code Behind
Protected Sub transferGrid_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles transferGrid.ItemCreated  
        If TypeOf e.Item Is Telerik.Web.UI.GridEditFormItem AndAlso e.Item.IsInEditMode Then  
            Dim linkButton As New Button  
            linkButton.Text = "Lookup Tag" 
            linkButton.CommandName = "LookupTag" 
            linkButton.CausesValidation = False 
            linkButton.Attributes("onclick") = "javascript:return confirm('Lookup will use the Asset Tag to fill out details. If asset is not found, data will not be returned.')"  
            Try  
                Dim cancel As Button = TryCast(e.Item.FindControl("PerformInsertButton"), Button)  
                cancel.Parent.Controls.Add(New LiteralControl(" "))  
                cancel.Parent.Controls.Add(linkButton)  
            Catch ex As Exception  
 
            End Try  
 
        End If  
 
    End Sub  
 
 Protected Sub transferGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles transferGrid.ItemCommand  
        If e.CommandName = "InitInsert" Or e.CommandName = "Edit" Then  
            'btnPrintEmail.Enabled = False 
            transferGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None  
            'lookuptagButton.Visible = False 
            'Dim lookupTag As Button = TryCast(e.Item.FindControl("LookupTag"), Button) 'INDEX ERROR HERE ON EDIT SAVE....INSERT WORKED FINE 
            'lookupTag.Visible = False 
 
        ElseIf e.CommandName = "LookupTag" Then  
            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)  
            'Dim tagText As String = CType(item("Tag").Controls(0), TextBox).Text  
            'Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)  
            'Dim itemValue As String = item("Tag").Text  
            Dim cell As TableCell = item("Tag")  
            Dim itemValue As String = (CType(cell.Controls(0), TextBox)).Text 'INDEX ERROR HERE ONLY WHEN TRYING TO SAVE AFTER EDIT  
 
            'MessageBox(itemValue)  
            Dim accessConnection As SqlConnection = New SqlConnection()  
            Dim cn As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("~/App_Data/ReceivingLog.mdb"))  
            'provider to be used when working with access database  
            cn.Open()  
            'calculate mins, hrs played  
            Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT [Make], [Model], [SerialNum], [PO] FROM [tblReceivingLog] WHERE [InventoryNum] = '" & itemValue & "'", cn)  
            Dim dr = cmd.ExecuteReader  
            While dr.Read  
                CType(item("Manufacturer_Name").Controls(0), TextBox).Text = dr(0)  
                CType(item("Model").Controls(0), TextBox).Text = dr(1)  
                CType(item("Serial").Controls(0), TextBox).Text = dr(2)  
                CType(item("PO").Controls(0), TextBox).Text = dr(3)  
            End While  
 
            cn.Close()  
        Else  
            'btnPrintEmail.Enabled = True 
            'transferGrid.MasterTableView.GetColumn("LookupTag").Display = False 
            transferGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Bottom  
        End If  
 
    End Sub 

 

Thomas Salt
Top achievements
Rank 1
 answered on 16 Oct 2009
1 answer
186 views

I'm not sure if this has something to do with page life cycle, but the Autocompleteextender control doesn't behave as expected. Firebug tells me the control is rendered as follows at runtime:

<em unselectable="on">The TargetControlID of 'AutoCompleteExtender1' is not valid. A control with ID 'UserControl1_TextBox1' could not be found.</em>

I guess the control can't be found because it doesn't exist yet??

How can I make this work? Due to layout, I can't move TextBox1 into ParentPage.aspx

UserControl1.ascx:

  1. TextBox1 (I'd like to make the target of a Toolkit AutoCompleteExtender)
    1. rendered as UserControl1_TextBox1
    2. <asp:TextBox ID="TextBox1" runat="server" class="allcaps"></asp:TextBox>

UserControl1.ascx.cs:

  1. Page_Load method (before the check for postback)
    1. AutoCompleteExtender ace = (AutoCompleteExtender)this.Parent.FindControl("AutoCompleteExtender1");
      ace.TargetControlID = TextBox1.UniqueID;

ParentPage.aspx (RadWindow):

  1. Form1
    1. RadScriptManager1
    2. UserControl1
    3. RadAjaxManager1

ParentPage.aspx.cs

  1. Page_Load method
    1. AutoCompleteExtender AutoCompleteExtender1 = new AutoCompleteExtender();
      AutoCompleteExtender1.ID = "AutoCompleteExtender1";
                  
      AutoCompleteExtender1.ServicePath = "AutoCompleteUserControl.asmx";
      AutoCompleteExtender1.ServiceMethod = "GetVendorData";
      AutoCompleteExtender1.MinimumPrefixLength = 1;
      AutoCompleteExtender1.CompletionSetCount = 12;
      
      HtmlForm form = this.Page.FindControl("Form1") as HtmlForm;
      form.Controls.Add(AutoCompleteExtender1);

AutoCompleteUserControl.asmx.cs has a WebMethod:

public string[] GetVendorData(string prefixText, int count)

David Fox
Top achievements
Rank 1
 answered on 16 Oct 2009
2 answers
131 views
Hi all,
I have a RADGRID:

<telerik:RadGrid ID="grdHSKT" runat="server"
                        onneeddatasource="grdHSKT_NeedDataSource" Skin="Office2007"
                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                        oneditcommand="grdHSKT_EditCommand">
                        <MasterTableView CommandItemDisplay="TopAndBottom" TableLayout="Auto" >
                        <PagerStyle Mode="NextPrevAndNumeric"  />
                            <Columns>
                                <telerik:GridButtonColumn UniqueName="EditColumn" ButtonType="ImageButton" CommandName="Edit" />
                                <telerik:GridBoundColumn DataField="TenHSKemTheo" HeaderText="Tên hồ sơ kèm theo" UniqueName="tenHSKT" DataType="System.String">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="SoBanChinh" HeaderText="Bản chính" UniqueName="banChinh" DataType="System.Int32">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="SoBanSao" HeaderText="Bản sao" UniqueName="banSao" DataType="System.Int32">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="GhiChu" HeaderText="Ghi chú" UniqueName="ghiChu" DataType="System.String">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Chọn">
                                <ItemTemplate>
                                    <asp:Panel ID="Panel1" runat="server">
                                        <asp:CheckBox ID="cbActive" Checked="true" runat="server" AutoPostBack="true" OnCheckedChanged="CheckedChanged" />
                                    </asp:Panel>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <EditFormSettings ColumnNumber="1" CaptionFormatString="Thay đổi hồ sơ kèm theo:">
                                <FormTemplate>
                                   <table cellspacing="5px" cellpadding="2px">
                                    <tr>
                                        <td>Tên hồ sơ kèm theo: </td>
                                        <td>
                                            <asp:TextBox ID="txtHoSoKemTheo" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TenHSKemTheo") %>' ></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Số bản chính: </td>
                                        <td>
                                            <asp:TextBox ID="txtSoBanChinh" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SoBanChinh") %>' > </asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Số bản sao: </td>
                                        <td>
                                            <asp:TextBox ID="txtSoBanSao" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SoBanSao") %>'></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Ghi chú: </td>
                                        <td>
                                            <asp:TextBox ID="txtMoTa" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "GhiChu") %>'></asp:TextBox>
                                        </td>
                                    </tr>
                                   </table>
                                </FormTemplate>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings AllowColumnsReorder="True">
                            <Selecting AllowRowSelect="True" />
                        </ClientSettings>
                    </telerik:RadGrid>

And now I want to get checkbox have ID: cbActive into GridTemplateColumn when I call grdHSKT_EditCommand method to set enable property on it !!! But I don' know how to get it !!!
Plz help me !!! Thnks so much for any help.

hongnguyenx
Top achievements
Rank 1
 answered on 16 Oct 2009
2 answers
127 views
Hey Guys!

I have a big problem and need your help!

I have tree controls :
 - RadTabStrip wich i assign texts and values
 - SqlDataSource
 - RadScheduler wich contain over values.

The SqlDataSource provide Radcheduler values.
I want to use RadTabStrip to filter SqlDataSource contents.

My problem is RadTabStrip control dont have a SelectedValue. 

<asp:SqlDataSource ID="SqlDataSourceRadScheduler" runat="server"  

 

  ConnectionString="<%$ ConnectionStrings:ConnectionString %>"  

 

  SelectCommand="SELECT * FROM planning WHERE [fk_id] = @fk_id" 

 

  ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"  

 

 

 

    <SelectParameters>  

 

      <asp:ControlParameter ControlID="RadTabStrip" DefaultValue="2" Name="fk_id" 

 

        PropertyName="SelectedValue" Type="Int32" />  

 

    </SelectParameters> 

 

</asp:SqlDataSource>


Please Help me.
Thanks,
Azize

 




 

 

Nicolaï
Top achievements
Rank 2
 answered on 16 Oct 2009
1 answer
137 views
I am trying the cardview example for grid given on your website. I am trying to build the same example with an older version of telerik dll i.e. Telerik 2007.3.1314.20 but its not allowing me to add the Item template tag (<ItemTemplate></ItemTemplate>) in grid. Can we use the ItemTemplate tag in grid using the version of the telerik dll mentioned above? I have tried the same example using the latest version of the telerik dll and its working fine. But I need to do the same sort of thing using the older version of telerik dll as currently running website is using version of telerik dll mentioned above.

A quick reply would be highly appreciated.

Thanks
Rajeev
Georgi Krustev
Telerik team
 answered on 16 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?