Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
472 views

     I would like to add two levels of grouping in my grid.

This seems to work for 1st level of Grouping well, but now I want to add a sublevel similar to dragging a 2nd column up to grouping panel.  I have tried several iterations of the Select fields / GroupBy Expressions, but nothing seems to be working.  I have not seen a nice example of adding a 2nd level via code.

My 2nd level will be a field called TypeOfDoc.  I would like to show the count of documents in that header as well.

 

GridGroupByExpression expression = new GridGroupByExpression();
            // Select Fields
            GridGroupByField gridGroupByField = new GridGroupByField();
            gridGroupByField.FieldName = "ContentType";
            gridGroupByField.HeaderText = "Content Type ";
            gridGroupByField.HeaderValueSeparator = ";";
            expression.SelectFields.Add(gridGroupByField);

            // Adding Count Picking a field not in Group by
            gridGroupByField = new GridGroupByField();
            gridGroupByField.FieldName = "Title";
            gridGroupByField.HeaderText = " ";
            gridGroupByField.HeaderValueSeparator = " ";
            gridGroupByField.FormatString = "<strong>({0})</strong>";
            gridGroupByField.Aggregate = GridAggregateFunction.Count;
            expression.SelectFields.Add(gridGroupByField);

            // GroupByField

            gridGroupByField = new GridGroupByField();
            gridGroupByField.FieldName = "ContentType";
            gridGroupByField.HeaderText = "ContentType";
            expression.GroupByFields.Add(gridGroupByField);
            RadGrid1.MasterTableView.GroupByExpressions.Add(expression);

            RadGrid1.MasterTableView.GroupsDefaultExpanded = false;

Doncho
Telerik team
 answered on 30 Mar 2021
1 answer
190 views
Hi

I am trying to replace a Datagrid in a project, I have generated a RadGrid programmatically in the Page_Init as it needs to have a few image links in each row to replicate the functionality that is already in place. The first button is working fine, as it works on a post-back, but im having an issue with replicating the other button, which is a link to a page using an id that is available in one of the other columns.

In the current solution, the below example is how it done on the client side:
DataBinder.Eval(Container, 'DataItem.RecordID', 'ViewRecord.aspx?RecordID={0}')

As im now doing this serverside, how can i replicate the above? My Template currently is using a HyperLink, so I can use the NavigateURL, but im unsure how to get the ID per row and update the template in a programatically generated RadGrid

Any help would be appreciated
Regards
David
Doncho
Telerik team
 answered on 30 Mar 2021
3 answers
254 views

Hello Telerik crew,

I have a requirement where the file size needs to be appended to the file name when viewed in Thumbnails explorer mode.

I noticed that the file size is only available when in Default explorer mode (it has it's own column), but have no way of retrieving it when in Thumbnails mode. The online support doesn't mention creating a custom column/container for Thumbnails mode.

I have a couple of ideas but wanted to see if these are possible;

Option 1). when first visiting the page that the RadFileExplorer is on, do I set explorer mode to Default retrieve the current file list (including the file name & size), store in hidden variable then switch to Thumbnails (programmatically), match on filename then append the file-size when a match is found?

Option 2). in the page load (server size), retrieve the complete file list of current folder, store in hidden variable, then when client side load executes, perform a match on filename then append the file-size when a match is found?

Regards,

Chris

Vessy
Telerik team
 answered on 30 Mar 2021
1 answer
294 views

We are using version 2011.3.1305.35

We have a radgrid which was in production for the past 10 years.

Last few days, we have been receiving errors when user tried to edit a row. This happens only in chrome and not on firefox. Even on chrome, it does not happen for everyone. For example , me and my colleague have the same version of Chrome browser. It happens regualrly on his browser. I do not get that error.

This issue started in the last 30 days.

Our Chrome version : 89.0.4389.90 

Any idea why we are having this issue and how we can fix this?

Thanks in Advance

Attila Antal
Telerik team
 answered on 29 Mar 2021
1 answer
144 views

What's the best way of keeping the selected row in the tree view when the timeview is changed.

i.e. keep the row highlighted when the user clicks on the day/week/month/year tab

Peter Milchev
Telerik team
 answered on 29 Mar 2021
5 answers
657 views

I have a web application which needs to create a spreadsheet and save it to disk. Here's what I have so far:

Imports Telerik.Web.Spreadsheet

Dim wb As New Workbook
Dim ws As New Worksheet
Dim r As Row

wb.Sheets = New List(Of Worksheet) From {ws}
ws.Rows = New List(Of Row)

r = New Row With {.Cells = New List(Of Cell)}
r.Cells.Add(New Cell With {.Value = "Spreadsheet Title", .FontSize = Convert.ToInt16(Unit.Point(12).Value)})
ws.Rows.Add(r)

r = New Row With {.Cells = New List(Of Cell)}
r.Cells.Add(New Cell With {.Value = Today.ToShortDateString, .TextAlign = TextAlign.Left})
ws.Rows.Add(r)

r = New Row With {.Cells = New List(Of Cell)}
r.Cells.Add(New Cell With {.Value = "Column Header"})

<more column headers>

ws.Rows.Add(r)

For Each dr As DataRow In ds.Tables(0).Rows
     r = New Row With {.Cells = New List(Of Cell)}
     If Not IsDBNull(dr("Field1")) Then r.Cells.Add(New Cell With {.Value = dr("Field1")})

     <more fields>

Next dr

ws.Rows.Add(r)

Dim strPath As String = My.Settings.DocPath & "ExcelReports\"
Dim strFileName As String = "Filename.xlsx"

wb.Save(New FileStream(strPath + strFileName, FileMode.Create), ".xlsx")

Problem: When the code gets to the Save statement, I get this error: "nullable object must have a value".

I don't know what this means. The strPath, strFileName and wb objects all have values, so I don't know what nullable object is being referenced.

Can anyone point out what I'm doing wrong? Or am I going about this whole thing the wrong way (entirely possible, since this is my first attempt at this)?

Matthew
Top achievements
Rank 1
Veteran
 answered on 28 Mar 2021
1 answer
237 views

<INPUT onclick="javascript:setTimeout('window['Control_RadAjaxManager'].AsyncRequest(\'Control$ShareRadioButton\',\'\')', 0)" 

Code Snippet:
private void AddAjaxResponseScripts()
        {
            this.RadAjaxManager.ResponseScripts.Add("Sample.Controls.init(); if(Sample.QueryAddEdit) { Sample.AddEdit.init(); } ");
        }
Here Escape characters are not getting loaded properly .Missing  Escape characters in window['Control_RadAjaxManager'].
Current Version of Telerik 2015.3.1111.35 with .NetFramework 4.8.

Can anyone please help on this issue?

Rumen
Telerik team
 answered on 26 Mar 2021
2 answers
149 views

Hi, I am trying to provide visual indicators within the date input field of the data picker of possible errors with a date selection. I am trying to do this on keyboard input or the date picker date selection.

If the date selected or entered is before a date on the page, I want to show the error field in an error colour as that date could create program with other data being displayed. It is not a fatal error more a visual error. However, I do not see how this can be done because it appears that the date picker control is caching the initial classes and if you mouse over, that initial class over writes what is there and the visual error indication is lost. Alternately, if I try to set the inline styles with JQuery, they do not stick.

Basically, the concept is simple, put in a date before a displayed date, highlight the background of the input field. If the field is highlighted and you change the date to equal or be after the displayed, it goes back to the normal rendered state.

Am I basically SOL here?

Matt Smith
Top achievements
Rank 1
Iron
 answered on 25 Mar 2021
7 answers
1.2K+ views
I am trying to set certain rows on my grid in edit mode automatically on page load based on the content of one of the columns. I have seen some examples on this forum where either all rows are automatically put into edit mode during PreRender or by manually selecting multiple rows and firing a command event.

Please provide some examples on how certain rows can be automatically be put in edit mode during page load.
Doncho
Telerik team
 answered on 25 Mar 2021
6 answers
578 views

The viewstate or application's pages are already encrypted but looking at the Burp output of the response from a POST to the Telerik.UI.DialogHandler (ImageMananger) it seems the Telerik view state in the response appears not to be.

We've generated and specified the DialogParametersEncryptionKey, ConfigurationEncryptionKey, and ConfigurationHashKey keys in the site level web.config as described in article https://docs.telerik.com/devtools/aspnet-ajax/controls/editor/functionality/dialogs/security. This didn't change the viewstate.
The machine key in IIS is set for auto-generation.
I'm only assuming the Telerik viewstate can be encrypted because what I've read seems to imply that, but I haven't found a clear example so I'm not sure.

Dhaval
Top achievements
Rank 2
 answered on 25 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?