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

I'm using a custom content provider for the FileExplorer component, and I  want to conditionally change the folder and file icons for the _grid_ depending on the "state" of that particular folder or file.

For example, say I've just selected a folder in the TreeView, and the grid is now displaying the contents of that selected folder. The grid might now have the following content: Folder1, Folder2, fileA, fileB

At server side, I know that e.g. Folder2 and fileB are "special" in some way, and I want to mark the client markup that is generated for these two items with a "special css class". The idea is that this css class will be used to override the standard icons used.

Is there a way of doing this? (Preferrably server side, since there I've already got all information and infrastructure ready).

My first idea was to traverse the fileExplorer.Grid.Items in Page_PreRender looking for GridDataItems that met a special criteria. However, I can't seem to find find any property in the GridDataItems that maps to the corresponding DirectoryItems that backs the FileExplorer. If I could use a value in the GridDataItem to find out which DirectoryItem it represents, i.e. the DirectoryItems path property, I could then set a css class based on that. (This strategy is what I'm currently using for the icon override in the TreeView, since the RadTreeNode.Value is the same as the DirectoryItem.Name)

Another idea was to add a css class directly on the DirectoryItem at the time of Provider.ResolveRootDirectoryAsTree(..) running. But I haven't found a way of doing it in that manner.

Do you have any suggestions on how to accomplish what I'm looking for?

Thank you in advance,
Regards Andreas
Fiko
Telerik team
 answered on 29 Sep 2010
5 answers
281 views
I added a radcombobox to my page and set up a datasource of linqtosql.  When I ran it and clicked on the combobox, the dropdown appeared significantly below the combobox.  See the attached screen print.  Here is the markup excerpt from my aspx page :
<td>
    <telerik:RadComboBox ID="rcbExamLocation" Runat="server"
        DataSourceID="LinqDataSource1" DataTextField="LocCity"
        DataValueField="LocationID" Width="250px" Skin="WebBlue" OffsetY="0" ExpandAnimation-Type="Linear" ExpandAnimation-Duration="150">
    </telerik:RadComboBox>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"
        ContextTypeName="SPPExamRegistrationAlphaDataContext"
        OrderBy="LocCity, LocAddress"
        Select="new (LocCity, LocAddress, LocCounty, LocationID)"
        TableName="viewExamLocations">
    </asp:LinqDataSource>
</td>



I have discovered I can adjust this with the OffsetX and Y properties but what is wrong that caused this in the first place?  Surely this isn't the normal position for the control is it?

I am running VS 2008 SP1 on Windows XP SP3 with the 2009.2.826 version of RadControls for ASP.NET AJAX.  Does anybody have a solution other than modifying the OffsetX and Y properties until the dropdown moves back up vicinity of the combobox?

Thanks,
Alex

Yana
Telerik team
 answered on 29 Sep 2010
4 answers
101 views

First, I'm using the most recent version of the RadAJAX controls.

I've been trying to set, in the codebehind, the filter control tooltip to the text equivalent of the CurrentFilterFunction that's defined in the markup.  I finally came up with a solution but my tooltips were shifted by two columns.  It's like there are two "hidden" GridFilterItem cells in that row in the grid.

Here is the markup:

 

 

 

 


<telerik:RadGrid ID="radgrdMyPrograms" runat="server" Width="100%"  DataSourceID="ldsProgramsAllByUserName" EnableLinqExpressions="false"
    EnableEmbeddedSkins="false" Skin="DMCpro" ShowStatusBar="true"
    AutoGenerateColumns="false" AllowFilteringByColumn="true" AllowPaging="true" AllowSorting="true" PageSize="20" >
    <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" Scrolling-AllowScroll="true" Scrolling-ScrollHeight="600px" Scrolling-UseStaticHeaders="true" />
    <MasterTableView TableLayout="Fixed" DataKeyNames="ProgramID,ProgramName,ClientId,Client" >
        <HeaderStyle Font-Size="Small" Font-Bold="true" />
        <ItemStyle Font-Size="Small" Wrap="false" />
        <AlternatingItemStyle Font-Size="Small" Wrap="false" />
        <Columns>
            <telerik:GridHyperLinkColumn HeaderText="Program #" DataTextField="ProgramID" SortExpression="ProgramID" UniqueName="ProgramID"
                HeaderStyle-Width="80px" HeaderStyle-HorizontalAlign="Left"
                AllowFiltering="false" />
            <telerik:GridBoundColumn HeaderText="Program" DataField="ProgramName" SortExpression="ProgramName"
                HeaderStyle-Width="150px" HeaderStyle-HorizontalAlign="Left"
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="150px" />
            <telerik:GridBoundColumn HeaderText="AE" DataField="AEName" SortExpression="AEName"
                HeaderStyle-Width="35px" HeaderStyle-HorizontalAlign="Left"
                AllowFiltering="false" />
            <telerik:GridBoundColumn HeaderText="Start&nbsp;Date" DataField="StartDate" SortExpression="StartDate" 
                HeaderStyle-Width="65px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime"
                CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="60px" />
            <telerik:GridBoundColumn HeaderText="End Date" DataField="EndDate" SortExpression="EndDate"
                HeaderStyle-Width="65px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime"
                CurrentFilterFunction="LessThanOrEqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="60px" />
            <telerik:GridBoundColumn HeaderText="Status" DataField="Status" SortExpression="Status"
                HeaderStyle-Width="92px" HeaderStyle-HorizontalAlign="Left"
                CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="90px" />
            <telerik:GridBoundColumn HeaderText="Revenue" DataField="Revenue" SortExpression="Revenue"
                HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Right"
                CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
            <telerik:GridHyperLinkColumn HeaderText="Client" DataTextField="Client" SortExpression="Client" UniqueName="Client"
                HeaderStyle-Width="170px"
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="170px" />
            <telerik:GridBoundColumn HeaderText="Market" DataField="Market" SortExpression="Market"
                HeaderStyle-Width="90px" HeaderStyle-HorizontalAlign="Left"
                CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
            <telerik:GridBoundColumn HeaderText="Bus. Source" DataField="BusinessSource" SortExpression="BusinessSource"
                HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Left"
                CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
            <telerik:GridBoundColumn HeaderText="Pax" DataField="Guests" SortExpression="Guests"
                HeaderStyle-Width="45px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Right"
                CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" AllowFiltering="false" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


And here is the codebehind:

 

 

 

 

 

 

    Private Sub radgrdMyPrograms_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles radgrdMyPrograms.ItemDataBound
        If (TypeOf e.Item Is GridDataItem) Then
            Dim gdi As GridDataItem = DirectCast(e.Item, GridDataItem)

            Dim hlc As HyperLink = DirectCast(gdi.Item("ProgramID").Controls(0), HyperLink)
            hlc.NavigateUrl = "~/Programs/Programs.aspx?PNO=" + radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ProgramID").ToString + "&PName=" + Replace(Server.UrlEncode(radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ProgramName")), "'", "")
            hlc.CssClass = "info"

            Dim hlc2 As HyperLink = DirectCast(gdi.Item("Client").Controls(0), HyperLink)
            hlc2.NavigateUrl = "~/Crm/Clients.aspx?ClientId=" + radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ClientId").ToString + "&ClientName=" + Replace(Server.UrlEncode(radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("Client")), "'", "")
            hlc2.CssClass = "info"
        ElseIf (TypeOf e.Item Is GridFilteringItem) Then
            Dim fi As GridFilteringItem = DirectCast(e.Item, GridFilteringItem)

            For i = 0 To radgrdMyPrograms.Columns.Count - 1
                fi.Cells(i + 2).ToolTip = radgrdMyPrograms.Columns(i).CurrentFilterFunction.ToString
            Next
        End If
    End Sub

 

 

 

 



Why do I have to have the (i + 2) in that last statement??

Jerry

 

Jerry T.
Top achievements
Rank 1
 answered on 29 Sep 2010
1 answer
433 views
How do I update a column in radGrid using JavaScript client side?

I can find the row that I am wanting to update the column in but can't figure out how to update the column itself. Changing the text value of the label control does not persist after the rebind.

I am reading the data from a SQL table but the data is never written back to the SQL server.

           
function updateTable() {
           // "txt" here is the args sent to the "onReceive" function
   // set txt value for testing purposes
           var txt = 'HB2573';
           // get the reference to the RAD grid
           var grid = $find("<%=RadGrid1.ClientID %>");
           // get the underlying table view
           var MasterTable = grid.get_masterTableView();
           // get the underlying data source
           var items = MasterTable.get_dataItems();
           // get the # of rows
           var length = MasterTable.get_dataItems().length;
 
           for (var i = 0; i < length; i++) {
               // get the record
               var record = MasterTable.get_dataItems()[i];
                
               var keyValue = record.getDataKeyValue("fa_MeasureValue")
               //alert(keyValue);
               if (keyValue == txt) {
                   var CM = record.findElement("lblCurrentMeasure"); //access the Label control
                   //alert(CM.innerText);
                   CM.innerText = "1"; // assigning value to label control
                   //alert(CM.innerText);
               } else {
                   var CM = record.findElement("lblCurrentMeasure"); //access the Label control
                   CM.innerText = "0"; // assigning value to label control
               }
           }
 
           // and rebind it to the changed data
           MasterTable.rebind();
 
       }

   
Ivaylo
Top achievements
Rank 1
 answered on 29 Sep 2010
2 answers
106 views
In RadGrid Column, How can I set Filter DataField for a column instead of using the default "DataField" attribute.
I can see a GetFilterDataField() method but not SetFilterDataField(). Is there a way I can achieve this.

Thank you.

Raju S
Mira
Telerik team
 answered on 29 Sep 2010
1 answer
107 views
Hi,

   We are experiencing a problem with the RadGrid. This happens when the width of the grid is larger than the browser window. The right border does not appear at the right edge of the grid but rather at the right side of the browser window.

   I have attached images which shows the issue. I have a project that demonstrates this but can't seem to attach a zip file.

   Here is the aspx,

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_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">
<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>
</telerik:RadGrid>
    </div>
    </form>
</body>
</html>

   Here is the code to populate the grid,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
  
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();
        for (int i=1; i<=20; i++)
        {
            dt.Columns.Add("Column" + i);
        }
        for (int i = 1; i <= 10; i++)
        {
            DataRow r = dt.NewRow();
            for (int j = 0; j <= 19; j++)
            {
                r[j] = "Value";
            }
            dt.Rows.Add(r);
        }
        RadGrid1.DataSource = dt;
        RadGrid1.DataBind();
    }
}

   I seem to be able to get around this on our real site by using a custom skin and any font other than vedana but this is obviously not ideal as it is inconsistant with our website's theme.

Regards
ADe
Dimo
Telerik team
 answered on 29 Sep 2010
1 answer
102 views
Hello Sir,

I have a aspx page with RadDockLayout and RadDocZone controls on it. Inside RadDoczone i have used a ascx Control. There is a dropdownControl on Aspx page. When i am trying to access that dropdowncontrol in Ascx page through
this.Parent.FindControl("ddlProviders") as DropDownList, its getting null but when i places this ascx file outside RadDocZone its working fine.

Please provide a solution to this problem.

Thanks & Regards,
Chandan Kumar
Rumen
Telerik team
 answered on 29 Sep 2010
4 answers
185 views
Hi..
I have grid bound to a dataview... All they columns sort fine.. But when I click on my Email column I get the following error.
Any ideas?   Thanks!!

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Email is neither a DataColumn nor a DataRelation for table Communications.
Pavlina
Telerik team
 answered on 29 Sep 2010
1 answer
157 views
I am using a GridTemplateColumn with EditTemplate as RadCombo.  There are other fields in teh grids after this and while in edit mode, SOMETIMES, I find the DropDown is TRANSPARENT and all the controls beneath it are visible.  But I dont see this issue if I refresh the page.  I this a Bug in the Grid or do I need to specify any additional properties when using this RadCombo in Grid.

This is a random issue and unfortunately has come up a few times while by boss is around!

regards,
Ram Prasad.
Pavlina
Telerik team
 answered on 29 Sep 2010
1 answer
228 views
Im currently upgrading the RadGrid from the RadGridNet2.dll to the newer found in Telerik.Web.UI. The problem is that i dont want to updragde the RadChart so i dont remove the RadChart.Net2.dll from my project, instead i set the alias to something else than global in order to avoid namespace conflicts. However when i debug my site im still getting this error:


c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\hauliermanagement\79af6066\1eaca894\App_Web_graphtable.ascx.b3eb3a1f.aw_nms1w.0.cs(183): error CS0433: The type 'Telerik.Charting.ChartSeries' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\hauliermanagement\79af6066\1eaca894\assembly\dl3\e42fd8ce\00b73c75_97b6c901\Telerik.Web.UI.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\hauliermanagement\79af6066\1eaca894\assembly\dl3\692c3a46\65f87e34_c35bcb01\RadChart.Net2.DLL'


This is very very urgent, please help!
Ves
Telerik team
 answered on 29 Sep 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?