Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
73 views
It seems that as of the Q3 release I am no longer able to add a GridGroupByField in a radgrid when the radgrid's datasource is a list of anonymous type objects.

Here is the group by expressions section in the grid:

<GroupByExpressions>
              <tk:GridGroupByExpression>
                <SelectFields>
                  <tk:GridGroupByField FieldAlias="Sent" FieldName="DateSent" FormatString="{0:D}" HeaderValueSeparator=" on: "></tk:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                  <tk:GridGroupByField FieldName="DateSent" FormatString="{0:D}" SortOrder="Descending" ></tk:GridGroupByField>
                </GroupByFields>
              </tk:GridGroupByExpression>
            </GroupByExpressions>


The following is the anonymous type object declaration from the code behind:
oList.Add(New With {Key .SysID = message.SysID, .From = sender, .Subject = message.EmailSmsLog.Subject, _
                    .MailIcon = emailIcon, .DateSent = dateSent, .TimeSent = timeSent, _
                    .IsRead = message.IsRead})
I then assign the datasource of the radgrid as oList

The exception I get is:
Telerik.Web.UI.ParseException: No property or field 'DateSent' exists in type 'Object'

When I take the group by expressions out of the radgrid, everything works fine.

This code worked in previous versions of the control.

Can anyone confirm that this is a problem in Q3.

Thanks

Mike
MFitzpatrick
Top achievements
Rank 1
 answered on 21 Nov 2011
1 answer
112 views

Hi,

I am using master page and content pages, master page, we have one user control with telerik:RadTabStrip and telerik:RadTab

Each content pages we using above user control to loads the tabs

Problem :- upon clicking on one tab I have to redirect to "http://199.63.yyy.yyy/standard/default.php" url, when I am trying to give url in NavigationUrl of RadTab ( Please check below) , it's redirecting to all new page, I want it to load in the  Right side Content page,

Please help me how can I do that ??

<telerik:RadTab Text="<%$ Resources:Master, TabSettings %>" Value="GraphicSettings"  NavigateUrl="http://199.63.yyy.yyy/standard/default.php" Visible="<%# Model.TabGraphicSettingsVisible  && ProfileHelper.SettingsVisiblity%>" />

Dimitar Terziev
Telerik team
 answered on 21 Nov 2011
5 answers
221 views
Hi,

I am using the rad editor and i need the use the docuement manager in the editor.
I want to path like this one \\Telerik.com\Path\SharedDir\ROOT\Folder_1\

If run my share drive trought run in windows i have acces not problem.

When i use it in the editor and click on the document manager there nothing showing!

What i am missing?

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
       Dim viewPaths As String() = New String() {"C:\PhysicalSource\ROOT", "\\Telerik.com\Path\SharedDir\ROOT\Folder_1\"}
Dim uploadPaths As String() = New String() {"C:\PhysicalSource\ROOT\CanUpload", "\\Telerik.com\Path\SharedDir\ROOT\Folder_1\"}
Dim deletePaths As String() = New String() {"C:\PhysicalSource\ROOT\Folder_1\CanDelete", "\\Telerik.com\Path\SharedDir\ROOT\Folder_1\"}
    End Sub

In asp

<telerik:RadEditor ID="RadEditor1" runat="server">
</telerik:RadEditor>

Dobromir
Telerik team
 answered on 21 Nov 2011
3 answers
94 views
Hello all,

I am able to unrate other stars by clicking on already rated star now what  I need is to unrate the first star by clicking on it again

Thanks,
aRviN
Niko
Telerik team
 answered on 21 Nov 2011
4 answers
150 views
Hi,

i am using this code for update grid row text but it is not working

HTML CODE
/////
 <div id="divListGrid" class="floatLeft" style="width: 30%">
        <cc1:PGrid runat="server" ID="datalist" AllowPaging="true" AllowSorting="true" PageSize="25">
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="SearchHeader, CreatedDateTime"
                TableLayout="Fixed" ClientDataKeyNames="SearchHeader, CreatedDateTime,HeaderID"
                EditMode="EditForms">
                <Columns>
                    <cc1:PGridBoundColumn DataField="SearchHeader" HeaderText="<%$ Resources:demo,LABEL_SEARCH_HEADER  %>"
                        SortExpression="SearchHeader" UniqueName="SearchHeader" ColumnEditorID="GridTextBoxColumnEditor1">
                        <HeaderStyle Width="30%" />
                        <ItemStyle Wrap="true" />
                    </cc1:PGridBoundColumn>
                    <cc1:PGridBoundColumn DataField="CreatedDateTime" HeaderText=""
                        SortExpression="CreatedDateTime" ReadOnly="true" UniqueName="CreatedDateTime"
                        DataFormatString="{0:dd-MMM-yyyy}">
                        <HeaderStyle Width="20%" />
                        <ItemStyle Wrap="true" />
                    </cc1:PGridBoundColumn>
                    <telerik:GridEditCommandColumn EditText="<%$ Resources:demo,LABEL_EDIT %>" ItemStyle-CssClass="demo_Secondary_Button" >
                        <HeaderStyle Width="11%" Wrap="true"/>
                    </telerik:GridEditCommandColumn>
                       <cc1:PGridTemplateColumn>
                        <ItemTemplate>
                          <cc1:PImageButton Text="<%$ Resources:demo,LABEL_DELETE %>" ID="cmdDelete" Visible="true" CommandArgument="Delete"
                                 runat ="server" OnClientClick="javascript:removeHeader(); return false;"  ImageUrl="~/Images/transparent.png"
                                  CssClass="ui-icon ui-icon-trashdemoImage floatLeft" ToolTip="<%$ Resources:demo,LABEL_DELETE %>"  />

                        </ItemTemplate>
                        <HeaderStyle Width="11%" />
                    </cc1:PGridTemplateColumn>
                </Columns>
                <EditFormSettings EditColumn-ItemStyle-CssClass ="demo_Secondary_Button">
                    <EditColumn UpdateText="<%$ Resources:demo,LABEL_UPDATE %>" UniqueName="EditCommandSearchHeader"
                        CancelText="<%$ Resources:demo,LABEL_CANCEL %>">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
                <ClientEvents OnRowSelected="RowSelected" OnRowMouseOver="RowMouseOver" />
            </ClientSettings>
        </cc1:PGrid>
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="100px" />
    </div>
</div>

//javascript

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

        var hasChanges, inputs, editedRow, currentRowIndex, gridSearchResultCurrentRowIndex;
        function loadItems() {
            if (currentRowIndex > -1) {
                var masterTableView = $find("<%= datalist.ClientID %>").get_masterTableView();
                var dataItem = masterTableView.get_dataItems()[currentRowIndex];
                masterTableView.clearSelectedItems();
                dataItem.set_selected(true);
            }
        }
        function RowDblClick(sender, eventArgs) {
            editedRow = eventArgs.get_itemIndexHierarchical();
            $find("<%= datalist.ClientID %>").get_masterTableView().editItem(editedRow);
        }

        function RowMouseOver(sender, eventArgs) {
            currentRowIndex = eventArgs.get_itemIndexHierarchical();
        }

        //        function RowCommand(sender, eventArgs) {
        //            debugger;
        //            if (currentRowIndex > -1) {
        //                if (eventArgs.get_commandName() == "Edit") {
        //                    $find("<%= datalist.ClientID %>").get_masterTableView().editItem(currentRowIndex);
        //                }
        //            }

        //        }

        function RowSelected(sender, eventArgs) {

            var headerID = eventArgs.getDataKeyValue("HeaderID");
            var panel = $find("<%= XmlHttpPanelSaveHistory.ClientID %>");
            panel.set_value(headerID);

        }

        function RowClick(sender, eventArgs) {

            if (hasChanges && editedRow) {
                hasChanges = false;

                if (confirm("Update changes?")) {

                    $find("<%= datalist.ClientID %>").get_masterTableView().updateItem(0);
                }
            }
        }




        function GridCreated(sender, eventArgs) {

            var gridElement = sender.get_element();
            var elementsToUse = [];
            inputs = gridElement.getElementsByTagName("input");
            for (var i = 0; i < inputs.length; i++) {
                var lowerType = inputs[i].type.toLowerCase();
                if (lowerType == "hidden" || lowerType == "button") {
                    continue;
                }

                Array.add(elementsToUse, inputs[i]);
                inputs[i].onchange = TrackChanges;
            }

            setTimeout(function () { if (elementsToUse[0]) elementsToUse[0].focus(); }, 100);
        }

        function TrackChanges(e) {
            hasChanges = true;
        }


        function removeHeader(rowIndex) {
            rowIndex = currentRowIndex;
            if (rowIndex > -1 && jsConfirm('<%= Resources.demo.MSG_DELETE %>')) {
                var item = $find("<%= datalist.ClientID %>").get_masterTableView().get_dataItems()[rowIndex];
                var headerID = item.getDataKeyValue("HeaderID");
                var userID = "<%= Session.User.ID %>"
                patseer.web.webservices.SearchHistoryService.RemoveSearchHeader(userID, headerID, removeSearchHeader_OnSuccessCallback, removeSearchHeader_OnErrorCallback, item);
            }

        }

        function removeSearchHeader_OnSuccessCallback(result, dataItem) {
            if (result == true) {
                ShowMessage('<%= Resources.demo.MSG_SUCCESSFULLY %>');
                var masterTable = $find("<%= datalist.ClientID %>").get_masterTableView().get_element();
                $(dataItem.get_element()).remove();
                currentRowIndex = -1;
            }
            else {
               
            }
        }

        function gridSearchResult_RowMouseOver(sender, eventArgs) {
            gridSearchResultCurrentRowIndex = eventArgs.get_itemIndexHierarchical();
        }

        function removeSearchTermFromHeader() {
            var rowIndex = gridSearchResultCurrentRowIndex;
            if (rowIndex > -1 && jsConfirm('<%=  Resources.demo.MSG_DELETE %>')) {
                var item = $find("<%= gridSearchResult.ClientID %>").get_masterTableView().get_dataItems()[rowIndex];
                var searchTermID = item.getDataKeyValue("SearchTermID");
                patseer.web.webservices.SearchHistoryService.RemoveSearchTermFromHeader(searchTermID,
                        removeSearchTermFromHeader_OnSuccessCallback, removeSearchTermFromHeader_OnErrorCallback, item);
            }

        }

        function removeSearchTermFromHeader_OnSuccessCallback(result, dataItem) {
            if (result == true) {
                ShowMessage('<%= Resources.demo.MSG_SEARCH_SUCCESSFULLY %>');
                var grid = $find("<%= gridSearchResult.ClientID %>");
                var masterTable = grid.get_masterTableView().get_element();
                $(dataItem.get_element()).remove();
                gridSearchResultCurrentRowIndex = -1;
            }
            else {
                ShowErrorMessage('<%= Resources.demo.MSG_SEARCH_FAILED %>');
            }
        }

        function removeSearchTermFromHeader_OnErrorCallback(result) {
            ShowErrorMessage('<%= Resources.demo.MSG_FAILED %>');
        }

    </script>
</telerik:RadCodeBlock>


.cs file code block

page_load
 datalist.NeedDataSource += new GridNeedDataSourceEventHandler(datalist_NeedDataSource);
            datalist.UpdateCommand += new GridCommandEventHandler(datalist_UpdateCommand);

void datalist_UpdateCommand(object source, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            GridEditManager editMan = editedItem.EditManager;
            string editorText = ((e.Item as GridEditableItem)["SearchHeader"].Controls[0] as TextBox).Text;
            string headerID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["HeaderID"].ToString();
            if (!string.IsNullOrWhiteSpace(editorText))
            {
              // insert into database
                if (result != default(int))
                {
                   
                    return;
                }
            }
          
            e.Canceled = true;
        }
Ravi
Top achievements
Rank 1
 answered on 21 Nov 2011
1 answer
50 views
I'm doing a findControl to find a control inside a grid line.  I have multiple controls (Qty_fin and ReservedQty_fin).  If I do a findControl on Qty_fin, I might get the ReservedQty_fin control.  I worked around this by changing the id for Qty_fin, but wanted to pass this along.
Veli
Telerik team
 answered on 21 Nov 2011
6 answers
246 views
Hi there,

I've inherited a project that makes use of various Telerik controls throughout, but none moreso than RadGrids. For the most part the grids are declared and defined in the ASPX files and all their formatting set there, however what I want to do is move away from that and instead set them up in the code behind. I've spent the last hour looking through your site and the various pages, however nothing adequately provides answers to what I'm trying to do.

I call a stored procedure from a database and store the result in the dataset. The dataset therefore contains all the information I need and I can easily dump this out in to an ASP GridView control and manipulate it however I want. The rest of the project however is using the RadGrids, so I'm trying to do the very same thing with a RadGrid. To do this I did the following:

rgdTable.DataSource = myDataSet.Tables("myTable")
rgdTable.DataBind()

The problems I have began when I found the dataset I get back from the database had two columns in it that I didn't want to display. I assumed it would be as simple as setting the .Visible property on the two columns to false so the Grid wouldn't display them, however every attempt I've made to find exactly WHERE these columns are bound has resulted in errors. I've tried rgdTable.Columns and rgdTable.MasterTableView.Columns, along with looking in the DetailTables, and they always return a count of 0. If the columns ARE being bound and ARE being displayed, why is it that I can't access them programmatically?

DisplayInfo.InnerHtml = "<p>Master Table Column Count: " & rgdTable.MasterTableView.Columns.Count & "</p>"
DisplayInfo.InnerHtml = "<p>RadGrid Column Count: " & rgdTable.Columns.Count & "</p>"

Both of these (run individually, not together obviously) return a column count of 0. So where ARE these columns being bound to exactly? I need to be able to access them once they're bound to the grid to be able to change them as I see fit.

Any help you could provide would be appreciated.
Veli
Telerik team
 answered on 21 Nov 2011
5 answers
136 views
Hi Telerik,

I am trying to implemented an 'Edit Mode' for my application. When exiting out of 'Edit Mode' the user has two options -- revert to old state, or save changes.

I noticed that when the option 'revert state' is chosen, even though I clear all my saved information, the RadPanes still retain their old dimensions. I know this is by design, and that's fine, but I would like to clear that memory from within a static method.

Basically, if the user refreshes the page -- everything is good. The ClientState information is lost, old data is loaded from our database, and the dimensions for the controls are set. But, when ClientState information is not lost, the old data is overwritten with the client state data.

If it's not possible to do within a static method, let me know the instructions anyway. I can probably re-implement the lost functionality in a way that would work for my project.

Thanks

Sean
Dobromir
Telerik team
 answered on 21 Nov 2011
6 answers
225 views
Hi

Do we have any component that would help to build a static image from code.
eg. like a computer network diagram with connecting points.

We will have a parent child relationship of nodes in a database,
and from that we would like to buid a diagram and present it on web as a image.

Alternative suggestions are welcome.

Regards
JD
Mick
Top achievements
Rank 1
 answered on 21 Nov 2011
2 answers
226 views
Hi,
I am getting this error when i deployed my application on testing server on IIS 7.0. But it works fine in my dev environment. I have made all the config entries. Here is the complete error message.

Global Handler: System.Web

Page: /Claims/Telerik.RadUploadProgressHandler.ashx

The file '/Claims/Telerik.RadUploadProgressHandler.ashx' does not exist.

at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
at System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously


Thanks
Bozhidar
Telerik team
 answered on 21 Nov 2011
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?