Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
334 views
Hi,

I'm trying to extend RadTab in order to create a tab with a close button. (looking somewhat like this http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/deletetabs/defaultcs.aspx)

My first attempts have not been very successful at all, and I hoped that you could point me in the right direction. I have looked around the forums but haven't found anything.

class ClosableRadTab : RadTab
{
    public ClosableRadTab()
    {
        this.Template = new ClosableRadTabTemplate(this);
    }
    private class ClosableRadTabTemplate : ITemplate
    {
        private RadTab _tab;

        public ClosableRadTabTemplate(RadTab tab)
        {            
            _tab = tab;
        }

        public void InstantiateIn(Control container)
        {
            Table table = new Table();           
            TableRow row = new TableRow();
            table.Rows.Add(row);
            TableCell cellLabel = new TableCell();
            row.Cells.Add(cellLabel);                       
            Label lbl = new Label() { Text = _tab.Text };
            cellLabel.Controls.Add(lbl);
            TableCell cellCloseButton = new TableCell();
            row.Cells.Add(cellCloseButton);
            ImageButton btnClose = new ImageButton()
            {
                SkinID = "btnDeleteSmall",
                CommandArgument = _tab.Value
            };
            //btnClose.Click += new EventHandler(btnCloseProject_Click);
            cellCloseButton.Controls.Add(btnClose);

            container.Controls.Clear();
            container.Controls.Add(table);
        }
    }
}

Thank you!
Veronica
Telerik team
 answered on 14 Oct 2010
3 answers
85 views
I'm using a RadGrid GridDropDownColumn which is connected to a SqlDataSource:

 

 

 

<telerik:GridDropDownColumn DataField="Status_ID" DataSourceID="SqlDataSource_WTGTasksStatus"
  
HeaderText="Status" ListTextField="Status_Text" ListValueField="Status_ID" UniqueName="Status_ID"
  
ColumnEditorID="StatusDropdownEditor">

 

 

Here is my Column Editor:

<telerik:GridDropDownListColumnEditor ID="StatusDropdownEditor" DropDownStyle-Width="75px" runat="server" />

This is my datasource:
<asp:SqlDataSource ID="SqlDataSource_WTGTasksStatus" runat="server" ConnectionString="<%$ ConnectionStrings:ParkAnalyticsConnectionString %>"
SelectCommand="SELECT [Status_ID], [Status_Text] FROM [WTGTasksStatus]">
</asp:SqlDataSource>

When I click on 'Add a Record' button, the dropdown does not populate with the records from the datasource, but if I click on the Refresh button while it is in Insert mode (showing textboxes and the empty dropdown), then the dropdown populates.

I've wasted a lot of time trying to make this work, so that the dropdown populates when the user clicks on the 'Add a Record' button, but I've not succeeded.

Can you please help me out with this?

I would really appreciate it.
Martin
Telerik team
 answered on 14 Oct 2010
1 answer
91 views
Hello,

Our project uses the GroupByExpressions collection to generate SQL when NeedDataSource is fired. I noticed that when a group is added to the grid by dragging it onto the group panel, the GroupByExpressions collection does not include a GridGroupByExpression for this new group when handling NeedDataSource. Checking the collection later, in PreRender, I see that the new GridGroupByExpression is included, but a rebind at that point does not seem to affect the grid.

The reverse operation of removing a group by dragging it away from the group panel seems to work as expected, i.e. the GroupByExpressions collection does not include the removed group.

Is there a setting or some workaround which will ensure that GroupByExpressions always contains the correct information after adding or removing a group? I don't really want to have to rebind in any case.

Telerik version is 2009.3.1314.35.

Thanks,
Daniel
Telerik team
 answered on 14 Oct 2010
4 answers
118 views
I'd like to use the scheduler without databinding by setting it up using Javascript. Is this possible?
Veronica
Telerik team
 answered on 14 Oct 2010
6 answers
278 views
Is it possible to change the text of the 'edit' button/link in a detail table after the user has clicked the 'update' button/link? 

Essentially after the user makes changes to the detail table row and clicks the 'update' button I'd like the detail table row to show the 'edit' button again rather than displaying the 'update' and 'cancel' button as it does by default.  I do see that if the user clicks the 'cancel' button then the detail table row will show the 'edit' button.

Thanks!
Amy
Top achievements
Rank 1
 answered on 14 Oct 2010
2 answers
142 views
Hi Telerik,

We use RadComboBox to let our customers to input/choose font family. The idea is when user finish the input/choose,  we try to set the input box font-family equals to what his input, so the user knows what exactly it looks like.

We will use two functions on the client side: OnClientSelectedIndexChanged and OnClientTextChange

but we don't know how to set the style in the client functions.

Please help.

Thanks in advance.

lan
Top achievements
Rank 1
 answered on 14 Oct 2010
3 answers
194 views
I am trying to export only the selected items from a grid. But it exports everything. Here is grid, which is dynamically defined.

<telerik:RadGrid ID="DisplayDataGrid" runat="server" AutoGenerateColumns="False"
               AllowMultiRowSelection="True" AllowSorting="True" AllowPaging="True" PageSize="6"
               OnNeedDataSource="Grid_NeedDataSource" OnItemCreated="ImageryGrid_ItemCreated"
               ShowStatusBar="true" Width="100%" GridLines="None" Skin="Hay" ItemStyle-Font-Size="7pt"
               AlternatingItemStyle-Font-Size="7pt">
               <ClientSettings EnableRowHoverStyle="true">
                   <Scrolling AllowScroll="True" ScrollHeight="230px" UseStaticHeaders="false" />
                   <Selecting AllowRowSelect="true" />
               </ClientSettings>
               <ExportSettings IgnorePaging="true" OpenInNewWindow="true" FileName="ImageryExcel"
                   ExportOnlyData="true" />
               <MasterTableView HeaderStyle-Wrap="false" TableLayout="Fixed">
                   <PagerStyle AlwaysVisible="True" FirstPageToolTip="" LastPageToolTip="" NextPagesToolTip=""
                       PrevPagesToolTip="" PrevPageToolTip="" NextPageToolTip="" />
               </MasterTableView>
           </telerik:RadGrid>

Here is the export button click, which works for exporting everything, but it does not handle selected items.

Public Sub ButtonExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonExcelIMG.Click
        AssignGridDataSource()
        DisplayDataGrid.DataBind()
 
        DisplayDataGrid.MasterTableView.Columns.FindByUniqueName("ClientSelectColumn").Visible = False
         
        DisplayDataGrid.ExportSettings.ExportOnlyData = True
        DisplayDataGrid.ExportSettings.OpenInNewWindow = True
 
        If DisplayDataGrid.SelectedItems.Count > 0 Then
 
            For Each dataItem As GridDataItem In DisplayDataGrid.MasterTableView.Items
            '    If dataItem.Selected Then
            '        DisplayDataGrid.MasterTableView.
            '    End If
                dataItem.Visible = dataItem.Selected
                dataItem.Enabled = dataItem.Selected
                dataItem.Display = dataItem.Selected
 
            Next
        End If
 
        'Export to Excel
        DisplayDataGrid.MasterTableView.ExportToExcel()
    End Sub

Here is the dynamic creation of the select column. The other columns are created in a similar way.
DisplayDataGrid.Columns.Clear()
Dim tcolumn As GridHyperLinkColumn = New GridHyperLinkColumn
Dim clientGrid As GridClientSelectColumn = New GridClientSelectColumn
 
' Checkbox
clientGrid.UniqueName = "ClientSelectColumn"
clientGrid.HeaderStyle.Width = Unit.Pixel(25)
clientGrid.ItemStyle.ForeColor = Color.RoyalBlue
clientGrid.ItemStyle.HorizontalAlign = HorizontalAlign.Center
clientGrid.ItemStyle.Width = Unit.Pixel(25)
DisplayDataGrid.Columns.Add(clientGrid)

Any idea why it is not only doing the selected items? 

Thanks!
Daniel
Telerik team
 answered on 14 Oct 2010
5 answers
92 views
Is there a way to enforce users to only add appointments when the SchedulerTimeViewType is set to DayView? I want them to be able to switch to other views but if they click on a day in MonthView for example, I would like it to redirect them to DaveView to create the actual appointment. I have disabled the TimePicker so clicking on MonthView doesn't allow them to set hourly fields.
Peter
Telerik team
 answered on 14 Oct 2010
2 answers
238 views
By default it is set on business hours. I can't find a property in the control that defaults it to all day. Could you advise?
Peter
Telerik team
 answered on 14 Oct 2010
11 answers
618 views
Hello,
We've started using the FileExplorer to manage files inside our company, what we usually need is simple uploading and downloading. What's the correct way to handle file downloads? Is it with the open method? Because in that case when for example i try to download an .xml file, the browser knows how to interpret the file and it's shown to me in a radwindow. What i want is for it to be downloaded to my computer, but i can't use the usual 'save target as' context menu item as i would usually do to download such a file. The only way we've found until now to handle such files is to zip them beforehand, but it's very inconvenient. Could you point me to a better way to handle this scenario?

Thank you
Fiko
Telerik team
 answered on 14 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?