Telerik Forums
UI for ASP.NET AJAX Forum
18 answers
777 views

Hello Everyone,

I am using RadControls for ASP.NET AJAX Q2 2009 SP1 with Visual Studio 2008 SP1.  I have a 2 level (Master/Detail) RadGrid. For my Project I am using the below Grid/Command Item Demo as a prototype. 

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx

My question's are:

1) How do I add a new LinkButton in command item template to Print individual row like Edit selected from above Grid Demo?
2) I would like if I click that print button, it will print Master as well as all related Detail rows for that selected row.

Any example or help will be appreciated. Thanks

Princy
Top achievements
Rank 2
 answered on 14 Jul 2011
4 answers
62 views
HI,

I just started using the treeview and have found a strange behaviour:
This is the markup:
<telerik:RadTreeView ID="tvCategories" runat="server" Skin="Default" Width="200"
    DataTextField="Title" DataFieldParentID="ParentId" DataFieldID="Id">
</telerik:RadTreeView>

This is the codebehind:
protected void Page_Load(object sender, EventArgs e)
   {
       tvCategories.DataSource = common.GetProductCategories();
       tvCategories.DataBind();
   }

Surely, nothing fancy stuff. However, when displayed on the page when I expand nodes more than 2 levels deep, the page starts growing every time I hover over any node. I can see the scrollbar growing, my footer goes waaaaay down, etc.

Any idea why?

thanks

v






Viktor Takacs
Top achievements
Rank 2
 answered on 14 Jul 2011
3 answers
137 views
Hi,
We have a panel with a rounded corner extender which displays fine.
Until we ad a RADAjaxManager then the border lines of the rounded extender do not display.
Anyone have any ideas???

Chris
Iana Tsolova
Telerik team
 answered on 14 Jul 2011
4 answers
99 views
Still persisting in trying to get these tabs to work, building the tabstrip up after the page has loaded. Here's the latest issue:

If the TabString is in a container with restricted width, and ScrollChildren is set to "true", if tabs are added using tabList.insert() then the scrolling doesn't work properly.

Using IE8 but I don't think it's browser related - if you add tabs using the "add" function instead it works as expected.

Here's some code that demonstrates the problem:
<div style="background-color: #cccccc; width: 500px; height: 50px; border: 1px solid black;">
  <telerik:radtabstrip id="rts2" runat="server" ScrollChildren="true">
    <tabs>
      <telerik:radtab text="First Tab" value="First Tab" />
     </tabs>
   </telerik:radtabstrip>
</div>
<input type="button" value="Insert Tab" onclick="onInsertTab()" />
 
<script type="text/javascript" language="javascript">
  function onInsertTab() {
    var tabStrip = $find('rts2');
 
    var tab = new Telerik.Web.UI.RadTab();
    tab.set_text("Inserted Tab");
    var tabList = tabStrip.get_tabs();
    // change the call below to "tabList.add(tab)" and it all works ok
    tabList.insert(0, tab);
}
</script>

Dimitar Terziev
Telerik team
 answered on 14 Jul 2011
2 answers
119 views
Here's another one...

I have a RadTabStrip with the ScrollChildren property set true, and enough initial items to cause the scroll bar to be visible.

If I now call the delete() function to remove a tab such that a scroll bar is no longer required, the scroll bar stays displayed. Worse still, if the bar were previously scrolled it stays scrolled so you can end up with an apparently empty tabstrip which actually still contains items but they are just scrolled out of view!

Here's a simple snippet that demonstrates this:

<div style="background-color: #cccccc; width: 500px; height: 50px; border: 1px solid black;">
  <telerik:radtabstrip id="rts2" runat="server" ScrollChildren="true">
    <tabs>
      <telerik:radtab text="First Tab" value="Tab1" />
      <telerik:radtab text="Second Tab" value="Tab2" />
      <telerik:radtab text="Third Tab" value="Tab3" />
      <telerik:radtab text="Fourth Tab" value="Tab4" />
      <telerik:radtab text="Fifth Tab" value="Tab5" />
      <telerik:radtab text="Sixth Tab" value="Tab6" />
    </tabs>
  </telerik:radtabstrip>
</div>
<input type="button" value="Remove Tab" onclick="onRemoveTab()" />
 
<script type="text/javascript" language="javascript">
    function onRemoveTab() {
        var tabStrip = $find('rts2');
 
        var tab = tabStrip.get_tabs().getTab(0);
        if (tab)
            tabStrip.get_tabs().remove(tab);
    }

Dimitar Terziev
Telerik team
 answered on 14 Jul 2011
2 answers
82 views

Every time I think I'm close to getting the tabstrip to work I find another bug! Here's the latest one...

Add a RadTabStrip to the page with the ScrollChildren property set true, and initialise it with enough items to ensure the scrollbar is visible.
Now append a new item to the bar using a client-side "add" function. It ignores the scroll bar setting and starts a new row of tabs instead.

Here's a simple code snippet that demonstrates this

<div style="background-color: #cccccc; width: 500px; height: 50px; border: 1px solid black;">
  <telerik:radtabstrip id="rts2" runat="server" ScrollChildren="true">
    <tabs>
      <telerik:radtab text="First Tab" value="Tab1" />
      <telerik:radtab text="Second Tab" value="Tab2" />
      <telerik:radtab text="Third Tab" value="Tab3" />
      <telerik:radtab text="Fourth Tab" value="Tab4" />
      <telerik:radtab text="Fifth Tab" value="Tab5" />
      <telerik:radtab text="Sixth Tab" value="Tab6" />
    </tabs>
  </telerik:radtabstrip>
</div>
<input type="button" value="Insert Tab" onclick="onInsertTab()" />
 
<script type="text/javascript" language="javascript">
    function onInsertTab() {
        var tabStrip = $find('rts2');
 
        var tab = new Telerik.Web.UI.RadTab();
        tab.set_text("Inserted Tab");
        var tabList = tabStrip.get_tabs();
 
        tabList.add(tab);
    }
Dimitar Terziev
Telerik team
 answered on 14 Jul 2011
1 answer
105 views
Hello, I am using RadControls for ASP.NET AJAX version 2009.3.1314.20
My Horizontal TabStrip works fine in IE 7, 8, FF & Chrome but in IE 6 the width of each tab seems to be  Auto (100%) because the tabs stack vertically one above the other like they should for a vertical tabstrip. I inspected the CSS using IE Developer Tools and when I hover over the DIVs that hold each tab the highligh of the dv spans 100% of the container holding the tab control. I was hoping simply modifying the style to include a fixed width for the tabs and float them left  would fix this but either that doesn't work or I am not overriding the appropriate styles. Here is what I have tried but this doesn't work

.RadTabStrip .rtsLI
{
    PADDING-RIGHT: 0px;
    PADDING-LEFT: 0px;
    PADDING-BOTTOM: 0px;
    MARGIN: 0px;
    OVERFLOW: hidden;
    PADDING-TOP: 0px;
    LIST-STYLE-TYPE: none;
    width:100px !important;
    float:left;
}

.RadTabStrip .rtsLink
{
    TEXT-ALIGN: center;
    width:100px !important;
}

Any suggestions on how I can fix this issue?

Thanks in advance
Cliff
Ian
Top achievements
Rank 1
 answered on 14 Jul 2011
3 answers
177 views
HI,
I am trying to set the HeaderText property of the columns in a RadTreeList, however, it doesn't seem to respond to the following command:
tlCategories.Columns[0].HeaderText = common.RM.GetString("ctName");

The column's header stays empty.
If I use the HeaderText attribute in the aspx file it displays it correctly.

I am back to a previous issue I encountered with a GridView. Are these related? Any way around it?

By the way: the localization example on your deom site doesn't work at all: it fails to display localized resources and when I click on the related files link it gives me a no access error...

Any pointers would be greatly appreciated!
Viktor Takacs
Top achievements
Rank 2
 answered on 14 Jul 2011
1 answer
116 views
--- Disregard..  I found that the code pasted here does work, but I was setting the event in the page_init
RadGrid2.ItemCreated += new GridItemEventHandler(RadGrid2_ItemCreated);
which for some reason doesn't work.  Setting it on the aspx side:
OnItemCreated="RadGrid2_ItemCreated">
works..

Anyone know why defining the event in the code behind wouldn't work?

---

Hi,

Is there any way to change the widths of the textboxes that are created when you allow the grid to auto generate the edit template, without having to build a custom template?

Currently they all come out the same size, and half are too long and the other half are too short...

I tried code from a post with the same question, but it doesn't seem to do anything...

protected void RadGrid2_ItemCreated(object sender, GridItemEventArgs e)
        {
            if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
            {
                GridEditableItem edititem = (GridEditableItem)e.Item;
                TextBox txtbx = (TextBox)edititem["Donor_ID"].Controls[0];
                txtbx.Width = Unit.Pixel(50);
            }
  
        }


Thanks,

Matt
Vasil
Telerik team
 answered on 14 Jul 2011
2 answers
361 views
I have a screen that contains a Radgrid.  In this radgrid I have three filterTemplates that use a Radcombobox, and a GridNumericColumn for filtering.

It works fine when I filter on only one column but when I try want to filter by more than one it only filters on the current column.  I have changed the code behind to save the current filter and add the changes to it, the problem is I need to remove the existing filter and rebuild it based on the values from the selected filters.

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" EnableLinqExpressions="false"
                    PageSize="25" AutoGenerateColumns="False" GridLines="None" AllowSorting="True"
                    AllowFilteringByColumn="true" AlternatingItemStyle-BackColor="#eeeeee" ShowStatusBar="True"
                    OnItemCreated="RadGrid1_ItemCreated" OnPreRender="RadGrid1_PreRender" OnNeedDataSource="RadGrid1_NeedDataSource"
                    OnItemDataBound="RadGrid1_ItemDataBound" OnInsertCommand="RadGrid1_InsertCommand"
                    OnUpdateCommand="RadGrid1_UpdateCommand" Width="100%">
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
                    <MasterTableView CommandItemDisplay="Top" DataKeyNames="AuditID" EditMode="InPlace">
                        <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="50px" />
                            <telerik:GridTemplateColumn HeaderText="Branch" DataField="CRDBranchNumber" SortExpression=""
                                UniqueName="CRDBranchNumber" HeaderStyle-Width="160px">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbBranch" DataTextField="CRDBranchNumber" DataValueField="CRDBranchNumber"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CRDBranchNumber").CurrentFilterValue %>'
                                        runat="server" AutoPostBack="true" OnSelectedIndexChanged="BranchCombo_SelectedIndexChanged" />
                                </FilterTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbCRDBranchNumber" Text='<%# Eval("CRDBranchNumber") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="rcbCRDBranchNumber" DataTextField="CRDBranchNumber" DataValueField="CRDBranchNumber"
                                        runat="server" Width="115px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="rcbCRDBranchNumber"
                                        ErrorMessage="*" runat="server" ToolTip="Branch is Required" InitialValue="Select Branch"
                                        ForeColor="Red" />
                                    <asp:Label runat="server" ID="ldID" Visible="false" Text='<%# Eval("CRDBranchNumber") %>' />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Auditor" DataField="AuditorName" SortExpression=""
                                UniqueName="AuditorName" HeaderStyle-Width="225px">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbAuditor" DataTextField="AuditorName" DataValueField="AuditorName"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AuditorName").CurrentFilterValue %>'
                                        runat="server" AutoPostBack="true" OnSelectedIndexChanged="AuditorCombo_SelectedIndexChanged" />
                                </FilterTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbAuditor" Text='<%# Eval("AuditorName") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="rcbAuditor" DataTextField="AuditorName" DataValueField="AuditorID"
                                        runat="server" Width="175px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="rcbAuditor"
                                        ErrorMessage="*" runat="server" ToolTip="Auditor is Required" InitialValue="Select Auditor"
                                        ForeColor="Red" />
                                    <asp:Label runat="server" ID="ldAuditorID" Visible="false" Text='<%# Eval("AuditorID") %>' />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridNumericColumn DataField="AuditYear" HeaderText="Audit Year" SortExpression="AuditYear"
                                UniqueName="AuditYear" DataType="System.Decimal" DataFormatString="{0:F0}" />
                            <telerik:GridDateTimeColumn SortExpression="ScheduledDate" DataField="ScheduledDate"
                                HeaderText="Scheduled" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}"
                                AllowFiltering="false" HeaderStyle-Width="100px" UniqueName="ScheduledDate" />
                            <telerik:GridDateTimeColumn SortExpression="CompletedDate" DataField="CompletedDate"
                                HeaderText="Completed" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}"
                                AllowFiltering="false" HeaderStyle-Width="100px" UniqueName="CompletedDate" />
                            <telerik:GridTemplateColumn HeaderText="Status" DataField="Status" SortExpression=""
                                UniqueName="Status" HeaderStyle-Width="195px">
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="rcbStatus" DataTextField="Status" DataValueField="Status"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Status").CurrentFilterValue %>'
                                        runat="server" AutoPostBack="true" OnSelectedIndexChanged="StatusCombo_SelectedIndexChanged" />
                                </FilterTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblStatus" Text='<%# Eval("Status") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="rcbStatus" DataTextField="Status" DataValueField="AuditStatusID"
                                        runat="server" Width="150px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="rcbStatus"
                                        ErrorMessage="*" runat="server" ToolTip="Status is Required" InitialValue="Select Status"
                                        ForeColor="Red" />
                                    <asp:Label runat="server" ID="lbAuditStatusID" Visible="false" Text='<%# Eval("AuditStatusID") %>' />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn InsertText="Insert Audit" UpdateText="Update Audit" UniqueName="EditCommandColumn1"
                                CancelText="Cancel edit">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                </telerik:RadGrid>

Is there a way I can iterate through the columns, get the values of the selected filter and build a filter string.
Genti
Telerik team
 answered on 14 Jul 2011
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?