Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
168 views
Hello,

I have a problem with the DoubleClick on a RadGrid. When I double click on my grid, my javascript function doesn't want to give me my first column data unless it is visible. Is it possible to do it with my column invisible ?

I use the following javascript function
function OnRowDblClick(sender, eventArgs) 
    
        var dataItem = $get(eventArgs.get_id()); 
        var grid = sender; 
        var MasterTable = grid.get_masterTableView(); 
        var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()]; 
        var cell = MasterTable.getCellByColumnUniqueName(row, "NO_SERVEUR"); 
        var value = cell.innerHTML 
        window.location.href='FEN_INFO_SERVEUR.aspx?No_Serveur='+value; // Redirect the page         
        return;

Thanks

Keven
Keven
Top achievements
Rank 1
 answered on 07 Dec 2010
4 answers
104 views
In my OnClientClose client event of the RadWindowManager, I have codes that opens up another form using
var w = window.open(.....);
w.focus();

the window opens as it should, however, the focus is always returned to the calling form  (i.e.: the window opens, but is immediately minimized).  This only happens if window.open is called from the RadWindowManager's OnClientClose event.  If I use the same code (var w = window.open(....); w.focus();) elsewhere, it works as it should.  Is there something with RadWindowManager that forces focus back to the main form at the end of OnClientClose event?  If so, how can I overcome that?

Thanks!
JustinWong
Top achievements
Rank 1
 answered on 07 Dec 2010
19 answers
876 views
Hi All,

I am bind the RadGrid using client side binding. It works fine but when i tried to implement paging for client side binding, i am not able to acheive this. Not sure whether i missed something in my code (either HTML or Javascript). What actully happens is that, even though I use the set_virtualItemCount method, the page actually fills with all the rows. Meaning, if i set the PageSize="5" and if the record count received is more than 5 then it displays all the rows.

If any body provide me some pointer on the sample code with client side paging and sorting will be apreciated. I would need to look at the HTML code as well as the javascript code.

I have attached my code below
//HTML
<telerik:RadGrid ID="rgrdUsers" runat="server" PageSize="5"
AllowPaging="true" AllowSorting="True" AllowFilteringByColumn="false" GridLines="Horizontal" Width="100%" Height="500px" >
....
<MasterTableView AllowMultiColumnSorting="True" AutoGenerateColumns="False" PageSize="5" AllowPaging="true">
        ....
</MasterTableView>
</telerik:RadGrid>

//Javascript
    function OnSuccess(result, context)
    {
            masterTableView.set_virtualItemCount(5);
            masterTableView.set_dataSource(result)
            masterTableView.dataBind();
    }

Thanks in advance
Sundar
Maria Ilieva
Telerik team
 answered on 07 Dec 2010
8 answers
655 views
I've seen a lot of posts about ItemCommand events not firing, but no solution in any of the topics. My problem is simple and shouldn't require a complete code sample or whatever: I have a RadGrid within a UserControl, dynamicaly being loaded on a page, within a PlaceHolder using LoadControl. I use inline editing for the grid, using my own code to update the underlying database. The UpdateCommand fired after clicking the update button in de editcommand column should be the place to do so. Going into edit mode works fine, but when clicking either the cancel button or the update button, doen's fire any event.

The page structure is like this: Master > Content > RadSplitter > RadPane > RadAjaxPanel > PlaceHolder > UserControl > RadAjaxPanel > RadGrid.

Please give me a solution for this problem. FYI:'the grid has the OnUpdateCommand property set with my event handlers name and the AllowAutomatedUpdates property is set to true. Everything SHOULD work fine.... but it doesn't.
Maria Ilieva
Telerik team
 answered on 07 Dec 2010
0 answers
72 views
I am working on a new project that requires items to be shown in the following manner:
1. The Rooms (resources) are shown on the left side of the page and used as the GroupBy attribute
2. The GroupingDirection attribute is set to Vertical
So far, so good
3. I need to show all 24 hours of the day in as little space as possible since the appointments will all be 8-16 hours in length. Basically, there is an AM appt, and a PM appt for each day.

How can I display this in the RadScheduler? I know I'll need to use a template, just need help setting it up.

UPDATE: Figured it out with MinutesPerRow attribute :)

Thanks,
Kevin
Kevin Price
Top achievements
Rank 1
 asked on 07 Dec 2010
9 answers
530 views

Hi,

I am following this link to implement RadTabStrip:

http://demos.telerik.com/ASPNET/Prometheus/TabStrip/Examples/Appearance/CustomCssClasses/DefaultCS.aspx

My problem is the following:

1. I want to align the text for the tabs in the center. At present, they are getting aligned to the left by default.

2. The enabled tab should have the text in black and the not-selected tab should have text in white.

Please let me know how is that possible.

Thanks.




Yana
Telerik team
 answered on 07 Dec 2010
2 answers
150 views

I currently upgraded to the 2010 Q3 ASP.NET AJAX controls from 2009.3.1314 and have encountered an issue which I did not previoulsy have. Basically, when the grid columns are created dynamically and a calculated column is included, the following exception is encountered in the ItemDataBoundEvent for the grid:

System.InvalidCastException
{"Unable to cast object of type 'DynamicClass1' to type 'DataXY'."}


The exception occurs in the ItemDataBound event when the DataItem is cast back to its original type. In my previous version, I was able to perform the cast. Provided is sample code that will reproduce the error.

 

 

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
  
  
using Telerik.Web.UI;
  
public partial class Default2 : System.Web.UI.Page
{
    RadGrid RadGridData;
  
  
    override protected void OnInit(EventArgs e)
    {
        // Call base init.               
        base.OnInit(e);
  
        InitializeGrid();
    }
  
    protected void Page_Load(object sender, EventArgs e)
    {
  
    }
      
    private void InitializeGrid()
    {        
        GridBoundColumn boundColumn;
          
        RadGridData = new RadGrid();
  
        // Set required event handlers.
        RadGridData.NeedDataSource += new GridNeedDataSourceEventHandler(RadGridData_NeedDataSource);
        RadGridData.ItemDataBound += new GridItemEventHandler(RadGridData_ItemDataBound);
          
  
        // Set grid properties.
        RadGridData.ID = "GridDataId";        
        RadGridData.AutoGenerateColumns = false;
  
        // Required for row highlighting.        
        RadGridData.ClientSettings.Selecting.AllowRowSelect = true;
  
        RadGridData.MasterTableView.AllowPaging = true;
        RadGridData.MasterTableView.PageSize = 8;
        RadGridData.MasterTableView.PagerStyle.Mode = GridPagerMode.NextPrev;
        RadGridData.MasterTableView.PagerStyle.Position = GridPagerPosition.Top;
  
        RadGridData.MasterTableView.Name = "GridData";
        RadGridData.MasterTableView.DataMember = "DataXY";
  
        // *** Grid columns. ***
  
        boundColumn = new GridBoundColumn();
        RadGridData.MasterTableView.Columns.Add(boundColumn);
        boundColumn.UniqueName = "XId";
        boundColumn.DataField = "X";
        boundColumn.HeaderText = "X";
  
        boundColumn = new GridBoundColumn();
        RadGridData.MasterTableView.Columns.Add(boundColumn);
        boundColumn.UniqueName = "YId";
        boundColumn.DataField = "Y";
        boundColumn.HeaderText = "Y";
  
  
        // *** Grid Calculated Column ***
        GridCalculatedColumn calculatedColumn = new GridCalculatedColumn();
        RadGridData.MasterTableView.Columns.Add(calculatedColumn);
        calculatedColumn.UniqueName = "CalculatedColumn1";
        calculatedColumn.DataFields = new string[] { "X", "Y" };
        calculatedColumn.Expression = "{0} + {1}";
        calculatedColumn.Visible = true;
        calculatedColumn.HeaderText = "X + Y";
         
        PlaceHolder1.Controls.Add(RadGridData);
    }
      
    void RadGridData_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGridData.MasterTableView.DataSource = this.GetGridData();
    }
  
    void RadGridData_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (!(e.Item is GridDataItem))
            return;
  
        GridDataItem item = e.Item as GridDataItem;
  
        DataXY dataXY = (DataXY)item.DataItem;
    }
  
    private List<DataXY> GetGridData()
    {
        List<DataXY> list = new List<DataXY>();
  
        list.Add(new DataXY(1, 1));
        list.Add(new DataXY(2, 2));
        list.Add(new DataXY(3, 3));
        list.Add(new DataXY(4, 4));
        list.Add(new DataXY(5, 5));
        list.Add(new DataXY(6, 6));
        list.Add(new DataXY(7, 7));
  
        return list;
    }
  
  
    private class DataXY
    {
        public DataXY()
        {
        }
  
        public DataXY(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
  
  
        public int X
        {
            get;
            set;
        }
  
        public int Y
        {
            get;
            set;
        }        
    }
}


Any help in resolving this issue would be greatly appreciated.


Thanks,

Tony

tlp
Top achievements
Rank 1
 answered on 07 Dec 2010
1 answer
271 views
Hello Everybody. This is my first post in this site. I hope that I get a response as I am under tremendous pressure to finish this task. I am using Telerik Web.UI_2010_3_1109 along with ASP.net & VS 2008. I have attached two files. The page which I am designing has to look like in image homepage_payroll.jpg and it currently looks like the one in image  paroll_current.jpg. I am using

RadTabStrip and RadMultiPage. I am creating the tab pages dynamically. Please find below the css file which I have used to style the tab pages.

 

 


I have also attached an image of my VS solution explorer which shows the list of Tab Strip skins I have. I am totally confused and unable to design the tab strip & pages as per the requirement. It would be great if any one can help me on this.

.CSS File

 

.RadTabStrip_Green .rtsLI,
.RadTabStrip_Green .rtsLink
{
 color: black;
 font: 12px/26px "Segoe UI", Arial, sans-serif;
 
  
}

.RadTabStrip_Green .rtsLI.rtsLast { color:blue; }

.RadTabStripLeft_Green .rtsSeparator,
.RadTabStripRight_Green .rtsSeparator
{
 background: #F7DBEF;
}

/* <disabled tabs> */
.RadTabStrip_Green .rtsDisabled
.RadTabStripLeft_Green .rtsDisabled,
.RadTabStripRight_Green .rtsDisabled,
.RadTabStripBottom_Green .rtsDisabled,
.RadTabStrip_Green_disabled .rtsDisabled
{
color: #bcb;
cursor: default;
}
/* </disabled tabs> */

/* <scrolling arrows> */
.RadTabStrip_Green .rtsNextArrow,
.RadTabStrip_Green .rtsPrevArrow,
.RadTabStrip_Green .rtsPrevArrowDisabled,
.RadTabStrip_Green .rtsNextArrowDisabled
{
 background-image: url('TabStrip/TabStripStates.png');
}
/* </scrolling arrows> */

/* <tab backgrounds> */

.RadTabStripTop_Green .rtsLevel
{
     background-color: #D6D3D6;
     border-bottom-color:#F7DBEF;
     border-bottom-style:solid;
     border-bottom-width:1px;
}

.RadTabStripTop_Green .rtsLevel .rtsLink,
.RadTabStripTop_Green .rtsLevel .rtsOut,
.RadTabStripBottom_Green .rtsLevel .rtsLink,
.RadTabStripBottom_Green .rtsLevel .rtsOut,
.RadTabStripTop_Green_Baseline .rtsLevel,
.RadTabStripBottom_Green_Baseline .rtsLevel { background-image: url('TabStrip/TabStripStates.png'); }

.RadTabStripLeft_Green .rtsLink,
.RadTabStripRight_Green .rtsLink { background-image: url('TabStrip/TabStripStates.png'); }

.RadTabStripLeft_Green .rtsLast .rtsLink,
.RadTabStripRight_Green .rtsLast .rtsLink
{
 border-bottom: 1px solid red;
}

/* </tab backgrounds> */

/* <background positioning: overlapping tabs> */

/* <orientation: top> */

.RadTabStripTop_Green .rtsLink
{
    background: #D6D3D6;
    /*background-position: 0 -52px;*/
}
/*.RadTabStripTop_Green .rtsFirst .rtsLink { background-position: 0 0; }*/
.RadTabStripTop_Green .rtsOut { background-position: 100% -52px; }
/*.RadTabStripTop_Green .rtsLast .rtsOut { background-position: 100% 0; }*/

.RadTabStripTop_Green .rtsLI .rtsSelected { background-position: 0 -26px;}
.RadTabStripTop_Green .rtsSelected { background: #F7DBEF url('TabStrip/TabStripStates.png') no-repeat 0 -272px; }
.RadTabStripTop_Green .rtsSelected .rtsOut { background: #F7DBEF url('TabStrip/TabStripVStates_rtl.jpg') no-repeat 100% -72px; }
.RadTabStripTop_Green .rtsFirst .rtsSelected { background: #F7DBEF url('TabStrip/TabStripVStates.png') no-repeat 0 -180px; }
.RadTabStripTop_Green .rtsLI .rtsAfter { background-position: 0 -78px; }
.RadTabStripTop_Green .rtsLast .rtsSelected { background: #F7DBEF url('TabStrip/TabStripVStates.png') no-repeat 100% -180px; }
.RadTabStripTop_Green .rtsLast .rtsSelected .rtsOut { background: #F7DBEF url('TabStrip/TabStripVStates.png') no-repeat 0 -72px; }
.RadTabStripTop_Green_Baseline .rtsLevel { background-position: 0 100%; background-repeat: repeat-x; }

/* </orientation: top> */

/* <orientation: bottom> */

.RadTabStripBottom_Green .rtsLevel .rtsLink { background-position: 0 -130px;}
.RadTabStripBottom_Green .rtsLevel .rtsFirst .rtsLink { background-position: 0 -182px;}
.RadTabStripBottom_Green .rtsLevel .rtsOut { background-position: 100% -130px;}
.RadTabStripBottom_Green .rtsLevel .rtsLast .rtsOut { background-position: 100% -182px;}

.RadTabStripBottom_Green .rtsLevel .rtsLI .rtsSelected { background-position: 0 -156px;}
.RadTabStripBottom_Green .rtsLevel .rtsSelected .rtsOut { background-position: 100% -104px; }
.RadTabStripBottom_Green .rtsLevel .rtsLI .rtsAfter { background-position: 0 -104px;}

.RadTabStripBottom_Green .rtsLevel .rtsLast .rtsSelected .rtsOut { background-position: 100% -156px;}

.RadTabStripBottom_Green_Baseline .rtsLevel { background-position: 0 -599px; background-repeat: repeat-x;}

/* </orientation: bottom> */

/* <orientation: right> */

.RadTabStripRight_Green .rtsUL .rtsLink,
.RadTabStripRight_Green .rtsUL .rtsLI .rtsDisabled:hover { background-position: 100% 0; text-align: left;}
.RadTabStripRight_Green .rtsUL .rtsLink:hover { background-position: 100% -200px;}
.RadTabStripRight_Green .rtsUL .rtsSelected,
.RadTabStripRight_Green .rtsUL .rtsSelected:hover { background-position: 100% -400px;}

/* </orientation: right> */

/* <orientation: top (RTL)> */

.RadTabStripTop_Green_rtl .rtsLevel .rtsLink
{
 padding-left: 0;
 padding-right: 9px;
 
}

.RadTabStripTop_Green_rtl .rtsLevel .rtsOut
{
 padding-left: 9px;
 padding-right: 0;
 
}

.RadTabStripTop_Green_rtl .rtsLevel .rtsLink,
.RadTabStripTop_Green_rtl .rtsLevel .rtsOut
{
     background-image: url('TabStrip/TabStripStates.png');
       
}

.RadTabStripTop_Green_rtl .rtsLevel .rtsLink { background-position: 100% -52px;}
.RadTabStripTop_Green_rtl .rtsLevel .rtsFirst .rtsLink { background-position: 100% 0;}
.RadTabStripTop_Green_rtl .rtsLevel .rtsOut { background-position: 0 -52px;}
.RadTabStripTop_Green_rtl .rtsLevel .rtsLast .rtsOut { background-position: 0 0;}

.RadTabStripTop_Green_rtl .rtsLevel .rtsLI .rtsSelected { background-position: 100% -26px;}
.RadTabStripTop_Green_rtl .rtsLevel .rtsSelected .rtsOut { background-position: 0 -78px;}
.RadTabStripTop_Green_rtl .rtsLevel .rtsLI .rtsAfter { background-position: 100% -78px;}

 

.RadTabStripTop_Green_rtl .rtsLevel .rtsLast .rtsSelected .rtsOut { background-position: 0 -26px; }

/* </orientation: top (RTL)> */

/* </background positioning: overlapping tabs> */

/* <simplistic sub-item styles> */

.RadTabStrip_Green_SimpleSubItems .rtsLevel2,
.RadTabStrip_Green_SimpleSubItems .rtsLevel3,
.RadTabStrip_Green_SimpleSubItems .rtsLevel4 { background: #fff; }

.RadTabStrip_Green_SimpleSubItems .rtsLevel2 .rtsSelected,
.RadTabStrip_Green_SimpleSubItems .rtsLevel3 .rtsSelected,
.RadTabStrip_Green_SimpleSubItems .rtsLevel4 .rtsSelected
{
 text-decoration: underline;
}

.RadTabStrip_Green_SimpleSubItems .rtsLevel2 .rtsLink,
.RadTabStrip_Green_SimpleSubItems .rtsLevel2 .rtsOut,
.RadTabStrip_Green_SimpleSubItems .rtsLevel2 .rtsIn,
.RadTabStrip_Green_SimpleSubItems .rtsLevel3 .rtsLink,
.RadTabStrip_Green_SimpleSubItems .rtsLevel3 .rtsOut,
.RadTabStrip_Green_SimpleSubItems .rtsLevel3 .rtsIn,
.RadTabStrip_Green_SimpleSubItems .rtsLevel4 .rtsLink,
.RadTabStrip_Green_SimpleSubItems .rtsLevel4 .rtsOut,
.RadTabStrip_Green_SimpleSubItems .rtsLevel4 .rtsIn
{
 background: #F7DBEF;
}
.RadTabStrip_Green .rtsIn
{
font: 12px/20px arial,sans-serif;
padding: 0 5px 5px;
font-weight:bold;
/*background:#F7DBEF;*/
}
/* </simplistic sub-item styles> */


Thanks & Best Regards,
Bharath

 

 

 

 

Kamen Bundev
Telerik team
 answered on 07 Dec 2010
4 answers
74 views
Hello,

I'm on a small intranet website, and on my server I have a shared directory. But apparently I can't access it with every browser. Let me explain you.

So I access my directory without any problem with windows explorer. I just do: \\10.199.137.90\Affaires\ And it's perfect.

In my website, I have:
<a ID="lnkToClick" runat="server" target="_blank"> quality of the case file </ a>
and
protected void Page_Load (object sender, EventArgs e)
{
    lnkToClick.HRef = @ "\\\\10.199.137.90\Affaires\";
}


And it works on IE6, IE7, IE8, IE9. Yes, when I click on the link it launch my windows explorer and target the good directory.

But this doesn't work with Firefox, Google Chrome... etc etc... I have an error.

Do you have any ideas?

Thank you very much :))

Jean-Yves
Jean-Yves
Top achievements
Rank 1
 answered on 07 Dec 2010
1 answer
205 views
Hi,

I am using Master/Content page in my system. The content page is aspx which calls user control.
The user control creates the dynamic template column and binds to the grid. There is a asp link button called "log" in one of the columns in the grid and when I click the button, it inserts record into the db and disables the link button, so that user can not click the button again. I got the log button disabled but the grid is not refreshing the updated data.
I have used AjaxManagerproxy in my ascx. I call the binding of the grid inside gridview_NeedDataSource.

The following code is in Page_PreRender.

if (IsPostBack)
{
if (Session["isLog"] != null && Session["isLog"].ToString() == "true")
{
//gridview.DataSource = new string[] { };
//gridview.DataSource = null;
this.BindGrid();
//gridview.Rebind();
Session["isLog"] = "";
}

The grid binds the data twice when I tried clearing the grid by using "gridview.DataSource = null;", just before binding the grid.

The grid does not display any data if I use "gridview.DataSource = new string[] { };" just before binding the grid.

Can you please help me in fixing the Refresh inside the grid?

Thanks!
Veli
Telerik team
 answered on 07 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?