Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
47 views
I have a TreeView embedded within a combobox that is doubling as both a user-navigable tree and a filtered autocomplete tree if the user is typing into the combobox.
When the user is clicking through the tree, I want the SingleExpandPath behaviour to be used.
When they are typing and the (partial) tree is being filtered and displayed to them, I'd like this behaviour to be disabled since the filtered set of nodes will come from various branches of the tree.

I'd like to disabled this property in the combobox's OnClientKeyPressing event, and re-enable it on the OnClientDropDownOpened event. I haven't seen anything in the client side API that lets me control this.
Stefan
Top achievements
Rank 1
 answered on 31 Jan 2011
3 answers
117 views
How to set DataNavigateUrlFormatString with radopen javascript at run time?

I used the following code on page load, it doesn't work while uisng

glc.DataNavigateUrlFormatString = "javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";

 

---------------------------------------------------------------------

 

if (!Page.IsPostBack)

 

{

 

 

 

GridHyperLinkColumn glc;

 

glc =

new GridHyperLinkColumn();

 

 

this.rgTranslationView.MasterTableView.Columns.Add(glc);

 

glc.DataTextField=

"English";

 

glc.HeaderText=

"English";

 

glc.UniqueName =

"English0";

 

glc.FilterControlWidth=

Unit.Pixel(100);

 

glc.DataType= System.

Type.GetType("System.String");

 

glc.AutoPostBackOnFilter=

true;

 

glc.AllowFiltering =

true;

 

glc.ShowFilterIcon =

false;

 

glc.DataNavigateUrlFormatString =

"javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";

 

glc.DataNavigateUrlFields =

new String[] { "TagID, LanguageID" };

 

glc.CurrentFilterFunction =

GridKnownFunction.Contains; 

 

 

}


Can anyone help?

Thanks!

JJ
Top achievements
Rank 1
 answered on 31 Jan 2011
2 answers
149 views
How to set DataNavigateUrlFormatString with radopen javascript at run time?

I used the following code on page load, it doesn't work while uisng

glc.DataNavigateUrlFormatString = "javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";

 

---------------------------------------------------------------------

 

if (!Page.IsPostBack)

 

{

 

 

 

GridHyperLinkColumn glc;

 

glc =

new GridHyperLinkColumn();

 

 

this.rgTranslationView.MasterTableView.Columns.Add(glc);

 

glc.DataTextField=

"English";

 

glc.HeaderText=

"English";

 

glc.UniqueName =

"English0";

 

glc.FilterControlWidth=

Unit.Pixel(100);

 

glc.DataType= System.

Type.GetType("System.String");

 

glc.AutoPostBackOnFilter=

true;

 

glc.AllowFiltering =

true;

 

glc.ShowFilterIcon =

false;

 

glc.DataNavigateUrlFormatString =

"javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";

 

glc.DataNavigateUrlFields =

new String[] { "TagID, LanguageID" };

 

glc.CurrentFilterFunction =

GridKnownFunction.Contains; 

 

 

}


Can anyone help?

Thanks!

JJ
Top achievements
Rank 1
 answered on 31 Jan 2011
11 answers
150 views

Hi coders,
I have a <a> tag in the AppointmentTemplate and when a user clicks on the link, I would like to extract the ID of the clicked entry and pass it to a javascript function. This is the code I am trying but it doesn't work. Please let me know how to accomplish this:
 

<AppointmentTemplate>
   <div>
      <a href='#' onclick='openWindow(<%# Eval("ID") %>)'><%# Eval("Subject") %></a>
   </div>
</AppointmentTemplate>


openWindow
is my JavaScript function. Please let me know where I am going wrong.

Thanks, Peterson.

David
Top achievements
Rank 1
 answered on 31 Jan 2011
6 answers
119 views
Using this markup...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1"
              runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1"
                                      runat="server">
            </telerik:RadScriptManager>
            <div>
                <telerik:RadGrid ID="RadGrid1"
                                 runat="server"
                                 GridLines="None"
                                 DataSourceID="SQLData">
                    <MasterTableView AutoGenerateColumns="false">
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
 
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="ID" DataField="ProductID" HeaderText="ID" />
                            <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name" />
                        </Columns>
                        <NestedViewTemplate>
                            <asp:Label runat="server" ID="lblProductNumber" Text='<%#Eval("ProductNumber")%>' />
                            <telerik:RadButton runat="server" ID="btn" Text="Alarm" Icon-PrimaryIconUrl="~/Images/alarm-clock.png" />
                        </NestedViewTemplate>
                    </MasterTableView>
                    <ClientSettings Scrolling-UseStaticHeaders="true" Scrolling-AllowScroll="true" />
                </telerik:RadGrid>
 
                <asp:SqlDataSource runat="server"
                                   ID="SQLData"
                                   ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString2 %>"
                                   SelectCommand="SELECT * FROM [Production].[Product]"/>
            </div>
        </form>
    </body>
</html>

open the page in IE8. Expand a row. See the button. Scroll the grid and see the button scroll.

Now do the same thing in IE7/IE8+Compatability mode. The button doesn't scroll. I suspect that this may be related to this issue but im unsure how I might go about solving it in this case.

Any pointers would be appreciated.

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 31 Jan 2011
8 answers
319 views
Hi all,

I have a RadDockZone inside of a RadPane. The RadDockZone's height is 100%, has a minimum height, and the RadPane's height is unset.

I add a dock to the RadDockZone and this new dock does not fit completely inside of the RadDockZone (it's height + the height of other docks in the RadDockZone exceeds the minimum height set). I would like the RadDockZone's height to increase so that it can hold all the Dock's without any excess space. Currently, the last dock just gets clipped off -- even though the RadDockZone's height is 100%.

Any ideas?
Sean
Top achievements
Rank 2
 answered on 31 Jan 2011
5 answers
337 views
Hi, I have the following scenario:
A grid inside a UserControl
The user control in an aspx inside a div with width=100%
In the user control the grid is also inside a div with width=100%
The grid is using AutoGenerateColumns=True, and I'm setting the default size for each column to 170px in the ColumnCreatingEvent
           
column.ItemStyle.Width = Unit.Pixel(170);
column.HeaderStyle.Width = Unit.Pixel(170);

The grid is allowing AllowFilteringByColumn.

The grid headers and columns expands even bigger than the browser window and the scroll appears (this is OK), but the GroupPanel just render to the end of the window (where the scroll begins), and additionally in the last columns of the grid I can't drag & drop to group by these columns. Also when I click the filter button in these columns the dropdown render in another position of the screen, is like in someway the grid is lost in space and time.

Enclosed you can find a screenshot with more visual detail.

I've tried using FixedLayout in the MasterTable.
This is the definition of the grid.

Telerik Q1 2010

<div style="width: 100%;padding-top:15px">
    <telerik:RadGrid ID="gridData" runat="server" AllowPaging="true" AutoGenerateColumns="true"
        GridLines="Both" BorderStyle="None" Skin="Office2007" Width="100%" OnNeedDataSource="gridData_NeedDataSource"
        PageSize="100" ShowGroupPanel="true" OnItemCreated="gridData_ItemCreated" OnItemDataBound="gridData_ItemDataBound"
        OnDataBound="gridData_DataBound" OnPreRender="gridData_PreRender"
        AllowFilteringByColumn="True" EnableViewState="False"
        oncolumncreated="gridData_ColumnCreated"
        oncolumncreating="gridData_ColumnCreating">
        <GroupPanel Text="Arrastre una cabecera de columna hacia ésta barra para agrupar">
        </GroupPanel>
        <MasterTableView GridLines="Both" ShowGroupFooter="true" TableLayout="Auto"
            EnableViewState="False">
            <HeaderStyle Width="100%" />
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
        </MasterTableView>
        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True"
            AllowColumnHide="false">
            <Selecting AllowRowSelect="True"></Selecting>
            <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                ResizeGridOnColumnResize="true"></Resizing>
        </ClientSettings>
        <GroupingSettings ShowUnGroupButton="true" GroupContinuedFormatString="... continuación del grupo de la página anterior. "
            GroupContinuesFormatString=" El grupo continúa en la siguiente página." GroupSplitDisplayFormat="Mostrando {0} de {1} items."
            UnGroupButtonTooltip="Click aquí para remover grupo" UnGroupTooltip="Arrastre fuera de la barra para remover grupo"
            CaseSensitive="false" />
    </telerik:RadGrid>
</div>
Pavlina
Telerik team
 answered on 31 Jan 2011
1 answer
55 views
Hi,
  When I click on sort text(column Name) the data is getting soreted correctly. But if I click on the sort icon I am getting an exception. Please find the exception details below

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Please let me know.
Pavlina
Telerik team
 answered on 31 Jan 2011
3 answers
85 views

I'm new... both to Telerik and C# so this might be simple...  I hope :-)

Using radgrid inside radtabs.  I have 4 tabs, 3 of them appear fine, but the one that has a group-by has an un-needed horizontal scrollbar, that causes a header bar icons to appear behind the scrollbar. 

I'm using GridGroupByExpression, and it adds a space to the left with the group-ungroup arrows - that is fine, but then this causes a horizontal scrollbar to always appear on the bottom of the grid, regardless of browser size.  The rightmost export button is always partly obscured, see uploaded jpg.  How do I resize the grid to remove the horizontal scrollbar?   The scrollbar is not needed, there are only 3 columns.  I've tried setting the grid width, columns width, etc. but the scrollbar persists, the grid is always a little wider than the available area, due to the grouping arrows area to the left. 

What setting do I use to resize the grid to fit the scrren, when using GridGroupByExpression?

 

<telerik:RadTabStrip ID="WQTS" MultiPageID="WorkQueueTabPages" runat="server" Skin="Outlook" SelectedIndex="0"
    <Tabs
        <telerik:RadTab PageViewID="PendingApprovalsTabPage" runat="server" Text="Pending Approvals" Selected="True" Width="90%" /> 
        <telerik:RadTab PageViewID="PendingSetupsTabPage" runat="server" Text="Pending Setups" /> 
        <telerik:RadTab PageViewID="ApprovedNewDocsTabPage" runat="server" Text="Approved with New Documents"   /> 
        <telerik:RadTab PageViewID="NeedInsReviewTabPage" runat="server" Text="Needs Insurance Review" /> 
    </Tabs
</telerik:RadTabStrip
<telerik:RadMultiPage runat="server" ID="WorkQueueTabPages" SelectedIndex="0"
        
    <!-- Pending Approvals Tab -->
    <telerik:RadPageView ID="PendingApprovalsTabPage" runat="server"
        <telerik:RadGrid Height="450px" AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AllowAutomaticUpdates="false"
        ID="PendingApprovalsGrid" runat="server" AllowSorting="True" Width="90%"
        OnNeedDataSource="PendingApprovalsGrid_NeedDataSource" 
        AutoGenerateColumns="False"  OnItemCommand="OpenCompany" OnEditCommand="OpenCompany"
        <ExportSettings HideStructureColumns="True" ExportOnlyData="True" IgnorePaging="True" OpenInNewWindow="True"
        </ExportSettings>   
            <FilterMenu EnableImageSprites="False"></FilterMenu
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu
                <ClientSettings AllowKeyboardNavigation = "True"
                    <Scrolling AllowScroll="True"></Scrolling
                    <ClientEvents OnRowCreated="workQueues_rowCreated" OnRowClick="workQueues_onRowClick" /> 
                </ClientSettings
      <mastertableview
      datakeynames="CompanyID" 
      ClientDataKeyNames="CompanyId,CompanyName,VendorNumber" CommandItemDisplay="Top"
          <GroupByExpressions
              <telerik:GridGroupByExpression
                  <GroupByFields
                      <telerik:GridGroupByField FieldName="AccountStatusDesc" FieldAlias="Status" 
                          HeaderText="Status" FormatString="" /> 
                  </GroupByFields
                  <SelectFields
                      <telerik:GridGroupByField FieldName="AccountStatusDesc" FieldAlias="Status" FormatString="" HeaderText="Status" /> 
                  </SelectFields
              </telerik:GridGroupByExpression
          </GroupByExpressions
          <Columns
                <telerik:GridButtonColumn Text="Select" ButtonType="ImageButton" ImageUrl="~/images/select.bmp"  
                    CommandArgument="Select" Resizable="False" UniqueName="PendingApprovalsViewCol" FilterControlAltText="Filter PendingApprovalsViewCol column"
                    <ItemStyle Width="2%" /> 
                </telerik:GridButtonColumn
                <telerik:GridBoundColumn DataField="CompanyName" FilterControlAltText="Filter CompanyName column" ItemStyle-Width="40%"
                    HeaderText="Company Name" HeaderTooltip="Sort by Company Name" UniqueName="CompanyName"
                </telerik:GridBoundColumn
                <telerik:GridBoundColumn DataField="AccountStatusDesc" FilterControlAltText="Filter AccountStatusDesc column" ItemStyle-Width="58%"
                    HeaderText="Status" HeaderTooltip="Sort by Status" UniqueName="AccountStatusDesc"
                </telerik:GridBoundColumn
                <telerik:GridBoundColumn DataField="VendorNumber" FilterControlAltText="Filter VendorNumber column"
                    UniqueName="VendorNumber" Visible="False"
                </telerik:GridBoundColumn
          </Columns
          <EditFormSettings
              <EditColumn FilterControlAltText="Filter EditCommandColumn column"
              </EditColumn
          </EditFormSettings
          <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
          </ExpandCollapseColumn
          <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
          </RowIndicatorColumn
          <CommandItemSettings ShowExportToPdfButton="True" ShowExportToWordButton="True" ShowExportToExcelButton="True" ShowExportToCsvButton="True" ShowAddNewRecordButton="False" />  
      </mastertableview
            <GroupPanel
                <PanelItemsStyle BorderStyle="Solid" BorderWidth="1px" GridLines="Both" /> 
            </GroupPanel
        </telerik:RadGrid
    </telerik:RadPageView>
  
(next 3 tabs ommitted)

 

 

 

 

 

Pavlina
Telerik team
 answered on 31 Jan 2011
1 answer
87 views
I am using the client side delete function on a rad grid that contains rows which include textboxes (contained in a GridTemplateColumn)
The client side function works fine, but when I try to access the current values in the textboxes after deleting a row, I am getting the original value, not the new value that is currently in the text box.
If I don't delete a row first, the correct value is read.

When the save button is clicked, this is run:
For Each itm As GridDataItem In rgIntervalSetup.Items
            If TypeOf itm Is GridDataItem Then
                Dim theID As String = itm("RecordID").Text
                Dim updatedItem As GridDataItem = CType(rgIntervalSetup.MasterTableView.FindItemByKeyValue("RecordID", Integer.Parse(theID)), GridDataItem)
                UpdateValues(updatedItem, False)
            End If
        Next
  
  
Protected Sub UpdateValues(ByVal updatedItem As GridDataItem, ByVal KeepAsTempInterval As Boolean)
        Dim txtBox As TextBox = CType(updatedItem.FindControl("txtGridIntervalName"), TextBox)
        Dim IntervalName As String = txtBox.Text
  
        Dim txtDateBox As RadDateInput = CType(updatedItem.FindControl("txtGridStartDate"), RadDateInput)
        'txtBox = CType(updatedItem.FindControl("txtGridStartDate"), TextBox)
        Dim IntervalStartDate As DateTime = txtDateBox.SelectedDate
  
        Dim theID As Integer = updatedItem.GetDataKeyValue("RecordID").ToString()
  
         
        Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(MyBase.Location.ConnectionString, _
          CommandType.StoredProcedure, _
           "EVAL2_SessionIntervalUpdate", _
           New SqlClient.SqlParameter("@SessionIntervalID", theID), _
           New SqlClient.SqlParameter("@IntervalName", IntervalName), _
           New SqlClient.SqlParameter("@IntervalStartDate", IntervalStartDate.ToUsString), _
                    New SqlClient.SqlParameter("@SessionID", mySession.ID))  
    End Sub


Tsvetoslav
Telerik team
 answered on 31 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?