Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
459 views
Hello,

The scenario:
  • AutoGenerateColumns is set to true
  • I attach a DataTable during NeedDataSource
  • At some point before the page load, I'm trying to hide one of columns if a certain condition is true.

The problem:
No matter which event I try, RadGrid1.MasterTableView.Columns is always empty.

I've tried just about every event: NeedDataSource, OnItemCreated, oncolumncreated, oncolumnsreorder, ondatabound, onprerender, Page.PreRender. At no time is the Columns property populated with columns.

I suppose I could create the columns programmatically from the DataTable but I'd rather let RadGrid do it for me if possible.

Any advice is greatly appreciated.

Thanks,
Jeff
Peter
Top achievements
Rank 1
 answered on 21 Nov 2012
3 answers
581 views
Hi..
i am binding grid through data table through chart serious click event and set autogeneratecolumns="true" in grid at aspx page and also i didn't apply any code 'gridbound colum & gridtemplate column' like that based on datatable column and rows grid will be generated.
when i click first time in chart serious grid will be generated correctly but second time grid style will be changed in column header and overall structure.. what i want to do be grid same every time i execute this.
and my coding are mentioned below kindly guide me to solve this..

aspx code is

<telerik:RadGrid id="radgrid1" ruunat="server" autogeneratecolumn="true">
<headerstyle horizantalalign="left"/>
</telerik:RadGrid>

aspx.cs code is

DataTable table1=getdata();
radgrid1.datasource=table1;
radgrid1.databound();


thanks in advance..!
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Nov 2012
13 answers
472 views
Hi

How do I show gridlines even if cell is empty. I want to make this fix in all places. Is there any general code for this issue?

I have the radgrid structure like below

<

 

netcweb:NCRadGrid runat="server" ID="ActivityGrid"

 

 

OnNeedDataSource="ActivityGrid_NeedDataSource"

 

 

OnItemCreated="ActivityGrid_OnItemCreated"

 

 

PageSize="10" AllowPaging="true" SkinID="ActivityList"

 

 

OnPageSizeChanged="ActivityGrid_PageSizeChanged" OnPreRender="ActivityGrid_PreRender">

 

 

<PagerStyle AlwaysVisible="true" />

 

 

<ClientSettings AllowGroupExpandCollapse="true" />

 

 

<GroupingSettings />

 

 

<MasterTableView AutoGenerateColumns="false" GroupLoadMode="client">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="1" HeaderText="My courses student page">

 

 

<ItemTemplate>

 

 

<netcweb:PlaceHolderControl runat="server" ID="column1PlaceHolder">

 

 

</netcweb:PlaceHolderControl>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="2" HeaderText="StudentCourseListStatusHeader">

 

 

<ItemTemplate>

 

 

<netcweb:PlaceHolderControl runat="server" ID="column2PlaceHolder">

 

 

</netcweb:PlaceHolderControl>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="3" HeaderText="StudentCourseListDateHeader">

 

 

<ItemTemplate>

 

 

<netcweb:PlaceHolderControl runat="server" ID="column3PlaceHolder">

 

 

</netcweb:PlaceHolderControl>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="4" HeaderText="">

 

 

<HeaderTemplate>

 

 

<netcweb:ImageCheckBoxControl runat="server" ID="DetailedListCheckBox"

 

 

OnCheckedChanged="DetailedListCheckBox_OnCheckedChanged" AutoPostBack="true"

 

 

SkinID="DetailedView" />

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<netcweb:PlaceHolderControl runat="server" ID="column4PlaceHolder">

 

 

</netcweb:PlaceHolderControl>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</netcweb:NCRadGrid>

I tried the below code. All the values reside that grid was returns empty.

 

 

protected void ActivityGrid_PreRender(object sender, EventArgs e)

 

{

 

foreach (GridDataItem dataItem in ActivityGrid.MasterTableView.DetailTables[0].Items)

 

{

 

foreach (GridColumn col in ActivityGrid.MasterTableView.DetailTables[0].Columns)

 

{

 

if (dataItem[col.UniqueName].Text == string.Empty)

 

dataItem[col.UniqueName].Text =

"&nbsp;";

 

}

}

 

}

 


 

 

Luke
Top achievements
Rank 2
 answered on 21 Nov 2012
0 answers
87 views
Hi, 
I have a RadTreeView inside a RadAjaxPanel, and I drag&drop items onto another RadTreeView, or a RadPane. What i have done is instead of subscribing to the server side OnNodeDrop, capture the OnClientNodeDropping of the treeView, and then make an ajax call through ajaxPanel.ajaxRequest. 

It seems that the when I am sending the ajax calls from the treeview with my ajaxPanel.ajaxRequest, they travel through a different ajax channel, because, first of all, the loading panel doesn't show, and also only the other treeView on the page refreshes. The server does receive the call, though. If the drop is on the RadPane, or any other html element for that matter, no refresh happens at all. 

Now, here's the interesting part. I have another treeview with a similar functionality which works just fine. I started making the two treeViews look each other by eliminating the differences, and found out that if I set the OnNodeExpand event handler for the treeView, this issue arises, and if I remove that, everything works alright. 

In a nutshell, if the OnNodeExpand event handler is added to the treeview, ajax calls that are initiated from the treeView and go through ajaxPanel or ajaxManager, do reach the server, but do not refresh the intended controls on return. The only exception seems to be other treeViews on the page, which are refreshed correctly, but without showing the LoadingPanel. 

I hope this is not too confusing. 

Thanks
Safa

Safa
Top achievements
Rank 1
 asked on 20 Nov 2012
8 answers
1.0K+ views
In case where RadEditor is initially hidden and displayed using AJAX is causing the editor to render with incorrect width on the first show. This scenario applies for RadGrid edit template, RadEditor inside a RadPageView, etc.
This problem occurs due to the fact that RadEditor CSS files are not fully loaded when the editor calculates its’ toolbar size.
To avoid this problem you need to register the RadEditor’s CSS files manually on the page:

Since Q2 2011 you need to use the Telerik.Web.SkinRegistrar.GetWebResourceUrl() method:
<head id="Head1" runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadEditor), "Telerik.Web.UI.Skins.Editor.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadEditor), "Telerik.Web.UI.Skins.Default.Editor.Default.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadWindow), "Telerik.Web.UI.Skins.Window.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadWindow), "Telerik.Web.UI.Skins.Default.Window.Default.css") %>'
            rel="stylesheet" type="text/css" />
    </telerik:RadCodeBlock>
</head>

If you are using VB you should, of course, replace the this keyword with Me as this is its VB counterpart.


If you are using an older version you can still use ClientScript.GetWebResourceUrl():

<head id="Head1" runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <link href='<%= Page.ClientScript.GetWebResourceUrl(typeof(RadEditor), "Telerik.Web.UI.Skins.Editor.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Page.ClientScript.GetWebResourceUrl(typeof(RadEditor), "Telerik.Web.UI.Skins.Default.Editor.Default.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Page.ClientScript.GetWebResourceUrl(typeof(RadWindow), "Telerik.Web.UI.Skins.Window.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Page.ClientScript.GetWebResourceUrl(typeof(RadWindow), "Telerik.Web.UI.Skins.Default.Window.Default.css") %>'
            rel="stylesheet" type="text/css" />
    </telerik:RadCodeBlock>
</head>
....................
    <telerik:RadEditor runat="server" ID="RadEditor1" Skin="Default" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
    </telerik:RadEditor>
Moon
Top achievements
Rank 2
 answered on 20 Nov 2012
2 answers
93 views
Hello, everyone.

I have a question regarding the timing and functionality of a RadButton inside a GridButtonColumn.

I have a RadGrid that's getting its data from SQL.  In the GridButtonColumn is a PushButton that has its button text set from a field in the database.  Since these buttons will do different things based on their text, I'd like to know if it's possible to dynamically assign the CommandName property.  I've noticed that I can't use things like CommandName='<%# DataBinder.Eval(Container, "DataItem.buttonCmd") %>' like I can with GridBoundColumns.  Is there another way I can do this?
Kevin
Top achievements
Rank 2
 answered on 20 Nov 2012
1 answer
103 views

Hi,
  I have a radbutton with the name "rbtnDelete".Here i am trying to register below code on page OnInit method 

ClientScript.RegisterClientScriptBlock(this.GetType(),
"ConfirmDelete", objUtl.RadConfirmDelete(),true);
this.rbtnDelete.Attributes.Add("OnClientClicking",
"function(sender,args){ConfirmDelete(sender, args, 'dgvContactList',
'hidContactRowCount');}");

.But it is not working. But if i try to use in aspx with this code it is working fine 

 OnClientClicking="function(sender,args){ConfirmDelete(sender,args,'dgvContactList','hidContactRowCount');}"


Please help me

Kevin
Top achievements
Rank 2
 answered on 20 Nov 2012
6 answers
191 views
Some 3 years ago, in this thread, a user pointed out that there was a problem using the RadToolBarClientObject's set_toolTip() function.

I note that using the 2012 Q3 controls that we are still having this problem.

Back then, Veselin recommended using get_linkElement().title as a workaround.

Whilst this works, you end up with 2 different tooltuips if you are decorating the tooltips on the page using a RadToolTipManager.

Can we get this issue addressed in the more immediate future, do you think?

--
Stuart
Ivan Zhekov
Telerik team
 answered on 20 Nov 2012
2 answers
125 views
Hello,

I am looking to customize the Scheduler by adding custom text to a specific time slot.  I have followed this KB article to get the background to change based on the date December 1, 2012.  What I would like to do now is take it a step further and add a description to the time slot as well.  My desired outcome will resemble the screenshot below, where the phrase "Date has been Blacked-out by Admin" would be dynamically created and derived from a data source.



Thanks in advance for the help.

Regards,

Steve
Steve
Top achievements
Rank 1
 answered on 20 Nov 2012
3 answers
92 views
Hi

I want to display the latest message from database server.So is it possible to refresh the rotator every 5 minutes, without reload the page.
Please provide the code for refresh the control.


With Regards

Naga.
Slav
Telerik team
 answered on 20 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?