Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
244 views

Hi there,

I check the display-property of the columns of a RadGrid on PreRender, but it isn't actual.

If I Hide/Show another Column or sort a column, the PreRender Function gives the correct display-property.

Here my code:

<%

 

@

Page

Language

="VB"

AutoEventWireup

="false"

CodeBehind

="Default.aspx.vb"

Inherits

="TelerikWebAppHideUnhideColBug._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">

 

 

<

 

 

html

xmlns

="http://www.w3.org/1999/xhtml">

 

<

 

 

 

head

id

="Head1"

runat

="server">

 

 

 

 

<

title

></

title

>

 

</

 

 

 

head

>

 

<

 

 

 

body

>

 

 

 

 

<

form

id

="form1"

runat

="server">

 

 

 

 

<

script

type

="text/javascript">

 

 

 

 

function

RadGridCSC_ColumnHidden(sender, args) {

 

$find(

 

 

"<%= RadAjaxManager1.ClientID %>"

).ajaxRequest(

"ColumnHidden"

);

 

}

 

 

 

function

RadGridCSC_ColumnShown(sender, args) {

 

$find(

 

 

"<%= RadAjaxManager1.ClientID %>"

).ajaxRequest(

"ColumnShown"

);

 

}

 

 

 

function

RadGridCSC_ColumnRezised(sender, args) {

 

$find(

 

 

"<%= RadAjaxManager1.ClientID %>"

).ajaxRequest(

"ColumnRezised"

);

 

}

 

 

 

</

script

>

 

 

 

 

<

telerik

:

RadAjaxManager

ID

="RadAjaxManager1"

runat

="server">

 

 

 

 

</

telerik

:

RadAjaxManager

>

 

 

 

 

 

<

telerik

:

RadScriptManager

ID

="RadScriptManager1"

runat

="server"></

telerik

:

RadScriptManager

>

 

 

 

 

 

<

div

>

 

 

 

 

<

telerik

:

RadGrid

ID

="RadGrid1"

runat

="server"

AllowFilteringByColumn

="True"

 

 

 

 

AllowPaging

="True"

PageSize

="50"

Width

="100%"

Height

="650"

AllowSorting

="True"

CellSpacing

="0"

 

 

 

 

EnableHeaderContextMenu

="true"

EnableHeaderContextFilterMenu

="true">

 

 

 

 

 

<

GroupingSettings

CaseSensitive

="false"></

GroupingSettings

>

 

 

 

 

<

MasterTableView

AutoGenerateColumns

="false"

AllowFilteringByColumn

="True"

CommandItemDisplay

="Top"

width

="100%"

ClientDataKeyNames

="ProductID">

 

 

 

 

<

PagerStyle

AlwaysVisible

="true"

Mode

="NextPrevAndNumeric"

/>

 

 

 

 

<

Columns

>

 

 

 

 

<

telerik

:

GridBoundColumn

DataField

="ProductID"

Visible

="true"

FilterControlWidth

="60%"

HeaderStyle-Width

="80"

ItemStyle-Width

="60"

HeaderText

="ProductID"

UniqueName

="Version2"

ColumnGroupName

="SoftwareInformation"

ItemStyle-HorizontalAlign

="Left"

HeaderStyle-HorizontalAlign

="Left"

/>

 

 

 

 

<

telerik

:

GridBoundColumn

DataField

="ProductName"

Visible

="true"

FilterControlWidth

="80%"

HeaderStyle-Width

="200"

ItemStyle-Width

="200"

HeaderText

="Product Name"

UniqueName

="ProductName"

ColumnGroupName

="SoftwareInformation"

ItemStyle-HorizontalAlign

="Left"

HeaderStyle-HorizontalAlign

="Left"

/>

 

 

 

 

<

telerik

:

GridBoundColumn

DataField

="UnitPrice"

 

 

 

 

Visible

="true"

DataType

="System.String"

FilterListOptions

="VaryByDataType"

 

 

 

 

FilterControlWidth

="80%"

HeaderStyle-Width

="270"

ItemStyle-Width

="270"

 

 

 

 

HeaderText

="UnitPrice"

 

 

 

 

UniqueName

="UnitPrice"

ColumnGroupName

="SoftwareInformation"

 

 

 

 

ItemStyle-HorizontalAlign

="Left"

HeaderStyle-HorizontalAlign

="Left"/>

 

 

 

 

<

telerik

:

GridBoundColumn

DataField

="ReorderLevel"

Visible

="true"

FilterControlWidth

="60%"

HeaderStyle-Width

="80"

ItemStyle-Width

="60"

HeaderText

="ReorderLevel"

UniqueName

="ReorderLevel"

ColumnGroupName

="SoftwareInformation"

ItemStyle-HorizontalAlign

="Left"

HeaderStyle-HorizontalAlign

="Left"

/>

 

 

 

 

<

telerik

:

GridBoundColumn

DataField

="Discontinued"

Visible

="true"

FilterControlWidth

="80%"

HeaderStyle-Width

="200"

ItemStyle-Width

="200"

HeaderText

="Discontinued"

UniqueName

="Discontinued"

ColumnGroupName

="SoftwareInformation"

ItemStyle-HorizontalAlign

="Left"

HeaderStyle-HorizontalAlign

="Left"

/>

 

 

 

 

</

Columns

>

 

 

 

 

</

MasterTableView

>

 

 

 

 

 

<

ClientSettings

AllowColumnsReorder

="true"

ReorderColumnsOnClient

="false">

 

 

 

 

<

DataBinding

Location

="http://demos.kendoui.com/service/Northwind.svc"

ResponseType

="JSONP">

 

 

 

 

<

DataService

TableName

="Products"

Type

="OData"

/>

 

 

 

 

</

DataBinding

>

 

 

 

 

<

Scrolling

 

 

 

 

AllowScroll

="true"

 

 

 

 

UseStaticHeaders

="true"

 

 

 

 

ScrollHeight

="300px"

/>

 

 

 

 

<

ClientEvents

OnColumnShowing

="RadGridCSC_ColumnShown"

OnColumnHidden

="RadGridCSC_ColumnHidden"

/>

 

 

 

 

</

ClientSettings

>

 

 

 

 

</

telerik

:

RadGrid

>

 

 

 

 

</

div

>

 

 

 

 

</

form

>

 

</

 

 

 

body

>

 

</​

 

 

 

html

>

 

​



Imports

 

 

Telerik.Web.UI

 

 

Partial

 

 

Class

_Default

 

 

 

 

Inherits

System.Web.UI.

Page

 

 

 

 

Private

Sub

RadGrid1_PreRender(sender

As

Object

, e

As

System.

EventArgs

)

Handles

RadGrid1.PreRender

 

 

 

 

Dim

col

As

Telerik.Web.UI.

GridBoundColumn

 

 

col = RadGrid1.Columns.FindByUniqueName(

 

"Version2"

)

 

 

 

 

Debug

.Print(col.UniqueName +

":"

+ col.di.Display.ToString)

 

 

 

 

End

Sub

 

End

 

 

 

Class​

 

 

 

​​​​​​​
If I toogle the hide/show a column the Output are:

Version2:True

Version2:False

Version2:False

Version2:False

Version2:False

Version2:False


How can I get the actual display of a Column?

Thanks
Thomas
Viktor Tachev
Telerik team
 answered on 15 Apr 2014
5 answers
396 views
Good morning! I am facing a problem when I resize the RadDock I trigger, and then try to change page it appears the following error:

Erro em tempo de execução do JavaScript: Sys.WebForms.PageRequestManagerServerErrorException: The numeric part ('184,28570556640625') of '184,28570556640625' cannot be parsed as a numeric part of a Pixel unit.

Which form to be able to resolve this problem? I'm using the language of the browser in Portuguese, it brings this error when I use English and it does not show any errors.

I await response Thanks!
Slav
Telerik team
 answered on 15 Apr 2014
1 answer
88 views
I installed the .NET Telerik controls (AJAX) and the extensions for VS 2013 and I want to generate a web application targeting .NET 4.

If I target .NET 4.5.1, then the tools appear in the toolbox but if I target .NET 4 then they do not.

It seems the controls can still be used in older .NET versions as I can paste code for the controls into my .apsx files in my .NET 4 project and they seem to work OK.

I need the latest version of the controls and VS as I need to target both touch and mouse devices as well as some older browsers.  Can I safely do this?  What are the implications?
Yana
Telerik team
 answered on 15 Apr 2014
2 answers
63 views
It appears that there may be a date format issue related to the RadScheduler and the ODataDataSource.  While it works with an OData Version 2 date, it fails if the ODataDataSource is pointed to an OData Version 3 web service.  I receive the following javascript error related to date parsing:

     Error: Unable to get property 'length' of undefined or null reference

Our OData Service returns "2014-03-14T23:00:00" with version 3 while the older version returns dates like /Date(1394838000000)/

Can you confirm that this is a bug on your end?  We are using the 2014 Q1 update which allowed us to upgrade our OData service to Version 3.
Hristo Valyavicharski
Telerik team
 answered on 15 Apr 2014
3 answers
137 views
I have 3 dropdowncolumns in this radGrid.
The first one "Pnum" is working well, I can select the value and save it, and the saved value is visible in the grid when not in edit mode. If I open the record in edit mode the dropdown stays on the selected value unless I select a new value.
The other two dropdowncolumns are giving me problems. The selected value is saved to the db but is not visible when the grid is not in edit mode and if I open the record in edit mode after having saved it,  the dropdown value is on the default value.

How can I have the two dropdowncolumns "minutes" and "hours" acting like the "Pnum" column? Why they are acting in a different way?

I mean after selecting the value and update the record have the value shown in the grid. 

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Culture="it-IT" DataSourceID="SqlDataSource1" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" Skin="Outlook" CellSpacing="-1" GridLines="Both">
                       <ExportSettings>
                           <Pdf PageWidth="">
                           </Pdf>
                       </ExportSettings>
                       <ClientSettings>
                           <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                       </ClientSettings>
                       <MasterTableView DataKeyNames="Id" DataSourceID="SqlDataSource1" CommandItemDisplay="Top">
                           <Columns>
                               <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                   <HeaderStyle Width="35px" />
                               </telerik:GridEditCommandColumn>
                               <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" ReadOnly="True" SortExpression="Id" UniqueName="Id">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="60px" />
                               </telerik:GridBoundColumn>
                               <telerik:GridDateTimeColumn DataField="Date" DataType="System.DateTime" FilterControlAltText="Filter Date column" HeaderText="Date" SortExpression="Date" UniqueName="Date" DataFormatString="{0:dd/MM/yyyy}">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDateTimeColumn>
                               <telerik:GridDropDownColumn DataField="Pnum" DataSourceID="SqlDataSource2" ListTextField="Pnum" ListValueField="Pnum"  FilterControlAltText="Filter column column" UniqueName="column" HeaderText="P-Number">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDropDownColumn>
 
                               <telerik:GridBoundColumn DataField="WorkedTime" DataType="System.TimeSpan" FilterControlAltText="Filter WorkedTime column" HeaderText="Worked Time" SortExpression="WorkedTime" UniqueName="WorkedTime">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="90px" />
                               </telerik:GridBoundColumn>
                               <telerik:GridBoundColumn DataField="Week" FilterControlAltText="Filter Week column" HeaderText="Week" SortExpression="Week" UniqueName="Week">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="60px" />
                               </telerik:GridBoundColumn>
 
 
                               <telerik:GridDropDownColumn DataField="minutes" DataSourceID="SqlDataSource3" ListTextField="minutes" ListValueField="minutes"  FilterControlAltText="Filter minutes column" UniqueName="minutes" HeaderText="Minutes" DataType="System.Int16">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDropDownColumn>
                               <telerik:GridDropDownColumn DataField="hours" DataSourceID="SqlDataSource4" ListTextField="hours" ListValueField="hours"  FilterControlAltText="Filter hours column" UniqueName="hours" HeaderText="Hours" DataType="System.Int16">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDropDownColumn>
                               <telerik:GridBoundColumn  DataField="Note" FilterControlAltText="Filter Note column" HeaderText="Note" SortExpression="Note" UniqueName="Note">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                               </telerik:GridBoundColumn>
                               <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="column1">
                                   <HeaderStyle Width="30px" />
                               </telerik:GridButtonColumn>
                           </Columns>
                           <EditFormSettings>
                               <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                           </EditFormSettings>
                       </MasterTableView>
                   </telerik:RadGrid>
Kostadin
Telerik team
 answered on 15 Apr 2014
0 answers
80 views

Hi,
   I am getting telerik versioning exception in IE 10 browser.
   And i had attached the snapshot of that exception.So please help me.
        Telerik version  =  2014.1.225.40
Manish
Top achievements
Rank 2
 asked on 15 Apr 2014
5 answers
144 views
Hello, is there an example of http://demos.telerik.com/aspnet-ajax/editor/examples/comments/defaultcs.aspx somewhere with multiple users? I am not understanding how to integrate multiple users. Specifically, why does the dialog "Comment" appear in editable mode for some comments when I click on them like this:



And then for other user's changes, it shows as a read-only box? The thing that I'm not able to understand is when does it show as an editable box, and when does it show as read-only text?

Our scenario is that, we need a system that will support comments from several different users, all in the same editor instance. Only the comments that the given logged in user had made in our system should be editable. The rest should not be. Is that supported, and if so how, and also is there a demo available that you can share with me?  


























Ianko
Telerik team
 answered on 15 Apr 2014
5 answers
253 views
Hi,

I am using the Q3 1114 2013 version of your AJAX for ASP .NET controls.
I am using the Rad Grid and have added a checkbox to each Group Header in the grid.  I do that in ItemDataBound...

The users can then check the checkbox and click a Save button that I've put in the CommandItemTemplate.

I have code in the ItemCommand event handler that should loop through all of the GroupHeaders, and get the state of that checkbox (along with other information I've put in the GroupHeader).

MY PROBLEM:
When my code loops through the GroupHeaders of the grid (in the ItemCommand event), the DataRowView is Nothing.
My code is as follows (which is basically the same code that works when I create the checkbox in ItemDataBound):

For Each headerItem As GridGroupHeaderItem In theRadGrid.MasterTableView.GetItems(GridItemType.GroupHeader)
  Dim groupDataRow As DataRowView = CType(headerItem.DataItem, DataRowView)
Dim chk As CheckBox = headerItem.FindControl(GetGroupHeaderParentCheckboxName(groupDataRow("ParentAppType").ToString(), groupDataRow("ObjectTypeID").ToString(), groupDataRow("ParentID").ToString()))
  If (chk.Checked) Then
  selectedItemString += String.Concat(groupDataRow("ObjectTypeID").ToString(), KEY_VALUE_DELIMETER, groupDataRow("ParentID").ToString(), SETTING_PAIR_DELIMETER)
  End If
Next

In the code above, the groupDataRow variable is Nothing.  Can you tell me what I'm doing wrong?

I have other code in this same method that loops through all of the data rows in the grid and gets information from the data rows, and it works fine.

Why can I not access the DataRowView of the GroupHeader?

Thanks,
Michael
Kostadin
Telerik team
 answered on 15 Apr 2014
3 answers
195 views
Hello, i need help to export data from a RadGrid to an Excel File template. This file already has format, has freeze rows, formulas in some cells...

I can't find a property or option that allow me to define a template to use in the export action.
Is there any way to do this?

Thank you!
Daniel
Telerik team
 answered on 15 Apr 2014
1 answer
90 views
When I use the client side API to set the title and URL of my page to be shared, my page title gets URL encoded:

1.function OnSocialButtonClicking(sender, args) {
2.var url =  "http://www.telerik.com/"
3.var title = "test test test test test test"
4.args.set_stringsToShare(url, title)
5.}


the tweet message comes out URL encoded: "test%20test%20test%20test%20test%20test"

is there a way around this? It happens on pinterest, facebook too
Danail Vasilev
Telerik team
 answered on 15 Apr 2014
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?