Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
92 views
Hy,

I want to draw programmatically colors to GridTableRow on RadGrid.ItemDataBound event. Switch my bounded item status, I call this method with different colors :

private void SetItemBackgroundColor(GridDataItem _item, string _sBackgroundColor, string _sGradientColor = null, string _sFontColor = null)
{
  if (string.IsNullOrEmpty(_sGradientColor) || _sBackgroundColor == _sGradientColor)
  {
    _item.Style.Add(HtmlTextWriterStyle.BackgroundColor, _sBackgroundColor);
  }
  else
  {
    _item.Style.Add("filter", " progid:DXImageTransform.Microsoft.gradient(startColorStr=" + _sBackgroundColor + ", endColorStr=" + _sGradientColor + ", GradientType=1)");
    _item.Style.Add("background", "-moz-linear-gradient(left, " + _sBackgroundColor + ", " + _sGradientColor + ")");
    //_item.Style.Add(HtmlTextWriterStyle.Height, "auto");
  }
 
  if (!string.IsNullOrEmpty(_sFontColor))
  {
    _item.Style.Add(HtmlTextWriterStyle.Color, _sFontColor);
  }
}

It works well under Firefox, but doesn't work in IE.

I used this link but it doesn't work for GridTableRow. I can't found properties described in this post !

Thanks for your help !
Andrey
Telerik team
 answered on 24 May 2012
11 answers
200 views
Hi,

I read through a couple of posts regarding this problem, but somehow I can't get the intellisense for Telerik working.

I included a reference to jquery.js which works (so intellisense works generally) but for Telerik it doesn't work:

///<reference name="MicrosoftAjax.js"/>
///<reference name="Telerik.Web.UI.Common.Core.js" assembly="Telerik.Web.UI"/>
///<reference path="~/include/js/jquery.js" />

I'm using the current Telerik version Q3 2011.

This is my aspx page:

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Workplace.aspx.cs" Inherits="MyApp.Workplace" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%; overflow-y: hidden">
<head runat="server">
    <title></title>
</head>
<body style="height: 100%">
    <form id="form1" runat="server" >
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" />
    </form>
</body>
</html>

And these are the parts from the web.config where Telerik is added:

...
<appSettings file="fm.config">
    <add key="AsyncPostBackTimeout" value="600"/>
    <add key="Telerik.Skin" value="Windows7"/>
    <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/>
    <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/>
  </appSettings>
...
 
<system.web>
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
      </controls>
    </pages>
...
<httpHandlers>
      <!-- AJAX: -->
      <remove path="*.asmx" verb="*"/>
      <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <!-- Chart Reporting: -->
      <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
 
      <!-- -->
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
    </httpHandlers>
...
 
<system.webServer>
 <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <!-- Chart Reporting: -->
      <remove name="ChartImageHandler"/>
      <!-- -->
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <!-- Chart Reporting: -->
      <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <!-- -->
      <remove name="ChartImage_axd"/>
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_RadUploadProgressHandler_ashx"/>
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_Web_UI_WebResource_axd"/>
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/>
    </handlers>
....

Maybe there is something wrong in my web.config file? 

Thanks!
Genady Sergeev
Telerik team
 answered on 24 May 2012
1 answer
178 views
how can i creae context menu  in hierarchy grid.

To add,delete and update the item for each grid from code behind.


Thanks Telerik Team
Shinu
Top achievements
Rank 2
 answered on 24 May 2012
3 answers
97 views
I have this issue where once i click on toggle full screen icon while in edit mode of the Rad Editor, the full screen appears , but after this cannot reopen the tool bar again to revert back to normal screen. And hence there is no way to come out of full screen mode.
Rumen
Telerik team
 answered on 24 May 2012
4 answers
206 views
Hello Everyone !

How can I set the non allowable file list in RadUpload. I will like to set up the blacklist file type and  except of these blacklist I will allow to upload file .

How can I do these in radupload control ? I need your help Urgently .

Thanks ,
Tin
Tin
Top achievements
Rank 1
 answered on 24 May 2012
5 answers
121 views
I get Error in JS:

https://localhost/Telerik.Web.UI.WebResource.axd?
_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2012.1.215.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen%3a3d78a983-ceee-4e0e-a7ef-b0fa8a4023a3%3ab7778d6c%3a8e6f0d33%3a6a6d718d%3ae085fe68%3a58366029

 Page is render Somethinng like image added.
Double number 1.After mouse move on one number one is hidden.


Line Of this Code:

this._displayElement.style.borderRightWidth=parseInt($telerik.getComputedStyle(this._displayElement,"borderRightWidth",""))+parseInt($telerik.getComputedStyle(this._textBoxElement,"borderRightWidth",""))+"px";
>>$telerik.getComputedStyle(this._displayElement,"borderRightWidth","")
"medium"
$telerik.getComputedStyle(this._textBoxElement,"borderRightWidth","")
"2px"
IE8
<SPAN style="TEXT-ALIGN: left; LINE-HEIGHT: normal; DISPLAY: inline; FONT-FAMILY: Verdana; COLOR: #000000; FONT-SIZE: 12px; BORDER-LEFT-WIDTH: medium" id=ctl00_CPH_Body_rgMain_ctl00_ctl03_ctl01_ChangePageSizeTextBox_display class=riDisplay>1</SPAN>
Chrome
<span class="riDisplay" id="ctl00_CPH_Body_rgMain_ctl00_ctl03_ctl01_ChangePageSizeTextBox_display" style="color: rgb(0, 0, 0); display: inline; font-family: 'segoe ui', arial, sans-serif; font-size: 12px; line-height: normal; text-align: center; padding-left: 5px; padding-right: 5px; border-left-width: 0px; border-right-width: 3px; ">1</span>



Second Image Is under IE8 with IE7 compatybility.




Antonio Stoilkov
Telerik team
 answered on 24 May 2012
0 answers
92 views
Hi all
I have an issue while using automatic operations and filter template

I have a DropDownColumn on my grid and it has a custom filter
in order to use the filter expression, i have to bind the coloumn's DataField to the item.name
but when I perform auto insert/update - the datasource expects item.id to insert/update in the database

I've tried to change the filter's combo box to filter by value (which bound to the item.id) but it ignores it
I've tried to change all filter's combobox bindings to item.id but with no success either
i've tried using TemplateColumn but the result is the same


here is the code snippet: 

I'm using LinqDataSource to bind the grid and the ComboBoxes

The table Providers has:
name - Provider's name
id - Provider's id

The Table Contracts has
id - Contract's Id
name - Contract's name
ProviderID - foriegn key to Provider's id
ASPX
<telerik:GridDropDownColumn HeaderText="Provider" DataSourceID="ldsProviders" ListTextField="name"
    ListValueField="id" UniqueName="ContractProvider"
    DataField="ProviderID" AllowFiltering="true">
    <FilterTemplate>
     
    <telerik:RadComboBox ID="ddlFilterProviders"
    DataSourceID="ldsProviders"   
    DataTextField="name"
    DataValueField="name"
    AppendDataBoundItems="true"
    SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ContractProvider").CurrentFilterValue %>'
    runat="server"
    OnClientSelectedIndexChanged="SelectedIndexChanged"
    Filter="Contains">
    <Items><telerik:RadComboBoxItem/></Items></telerik:RadComboBox>
     
     
    <script type="text/javascript">
     
        function SelectedIndexChanged(sender, args) {
          var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
          tableView.filter("ContractProvider", args.get_item().get_value(), "EqualTo", true);
        
     
    </script>
    </FilterTemplate>
    </telerik:GridDropDownColumn>

thank you for your up coming answer
Yotam
Top achievements
Rank 1
 asked on 24 May 2012
1 answer
136 views
I have a grid, it is set to TableLayout Fixed. I have an explicit HeaderStyle with a width in px set on every column. Some columns have a display=False, I don't want them showing up initially. All databinding is done via javascript. I also have the following client settings:
<ClientSettings AllowColumnHide="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true" >
			   <ClientEvents 
               OnCommand="ReportSystem.RadGrid1_Command" 
               OnRowDataBound="ReportSystem.RadGrid1_RowDataBound" 
               OnColumnSwapped="ReportSystem.RadGrid1_OnColumnSwapped" 
               OnDataBindingFailed="ReportSystem.OnDataBindingFailed" />
				<Scrolling 
                AllowScroll="True" 
                UseStaticHeaders="True" 
                SaveScrollPosition="True">
				</Scrolling>
			</ClientSettings>

In javascript I call "hideColumn" with the index of the column to hide on the masterTableView. The column does hide correctly (and shows back up when i call the show function) But after each column is hidden every remaining column grows by a small amount exactly the same. As each column is shown, all the column widths shrink by the same amount they originally grew by. If instead I unhide one or more of the default hidden columns the columns stay correct, if I then start hiding columns, the widths stay correct until I hit the original number of columns then after that the columns start growing by that fixed amount.
Another weird part, this only happens in Chrome and IE, it seems to work correctly in firefox.

What could be causing the columns to grow?
Antonio Stoilkov
Telerik team
 answered on 24 May 2012
6 answers
449 views
Hi,

Is there a way to programmatically expand/collapse all rows in the hierarchy? I don't care if it's server-side or client-side at this point.

I had the idea of getting the INPUT element for the ExpandCollapseButton of each row and calling the click() function. However, forcing the exansion of a row causes a postback, hence I could not get the all to expand at once.

Do you have any ideas?
John
Top achievements
Rank 1
 answered on 24 May 2012
1 answer
86 views
Good Day,

I've been busy with Client Side Databinding and have been struggling to find a solution to my problem. I've recently found that there is a property (RadGrid.ClientSettings.DataBinding.ShowEmptyRowsOnLoad) which helps but after doing a postback the emptyrows are showing again. Please see attachment below.

Thank you
Pavlina
Telerik team
 answered on 24 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?