Telerik Forums
UI for WinForms Forum
1 answer
125 views
I am using the example from here http://www.telerik.com/community/forums/winforms/gridview/radgrid-sum-expression-for-child-data.aspx to have a cell in my parent table (unbound) show the sum of the columns in a child grid. The problem I am running into is that ChildRows is off by 1. I.e. when CellValueChanged is called when I enter the amount, looks like the Row has yet to be added. Is there a better event to hook? I really want to update when the Row has been added.

Is CellValueChanged called before the ChildRows collection is updated?
private void gridExpenses_CellValueChanged(object sender, GridViewCellEventArgs e)
{
    if (e.Column.OwnerTemplate != gridExpenses.MasterTemplate && e.Column.Name == "colAmount")
    {
        EvaluateTotal((GridViewRowInfo)e.Row.Parent);
    }
}
 
private void EvaluateTotal(GridViewRowInfo parent)
{
 
    if (parent.ChildRows.Count > 0)
        parent.Cells["colRemaining"].Value = gridExpenses.Evaluate("Sum(colAmount)", parent.ChildRows);
}

 

 

 

George
Telerik team
 answered on 18 Dec 2013
3 answers
372 views
Hello everyone,

Here is my situation:

I have a dataset with a relationship between two tables. These two tables are load in an hierarchical way in the radgridview.

Now, in the child grid, I have a price column for each row.

I am trying to create a calculated field in the master grid view which will reflect the total of the prices in the child grid. The code I am using is like the following:

...
GridViewTemplate child = rdGvView.MasterTemplate.Templates[0];
rdGvView.MasterTemplate.Columns["TotalPrice"].Expression = "Sum(child.prodPrice)";
....

But this gives me an error which says {"Field name: child does not exist in the template."}

I am using the sum expression from this link: http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.80).aspx

where prodPrice is the column name of the table in the dataset which is imported in the radgrid.

Thanks,
Yash
George
Telerik team
 answered on 18 Dec 2013
0 answers
218 views
Hi,
I have a gridview loaded with a datatable.  I have 2 buttons "Up" and "Down" outside the grid.  The "Up" button takes the selected row and moves it up one row.  The "Down" button takes the selected row down a row. 

eg:
1  sample1
2  sample2
if selected row is sample1 and then i click down button, i need to change the grid row to
2 sample2
1  sample1

please give solution for this
Mohan
Top achievements
Rank 1
 asked on 18 Dec 2013
3 answers
259 views
Hi,

When I hit enter in the richtextbox, an empty line appears between the previous and the new line (like a new paragraph).
I would like to insert a 'normal' enter/new line when I hit enter.

Is this possible? Now the only way I can achieve this is when I hit shift + enter.

Best regards.
Frank Beerens
Top achievements
Rank 1
 answered on 18 Dec 2013
1 answer
207 views
Hi,
I have a
RadGridView in which there are 3 image columns. While exporting RadGridView to excel using ExportToExcelML class, all image columns are exported empty. Requirement is to display text instead of images. Is there a way to convert Image columns to text column or any other possible ways to achieve?

 

Also, I should export only visible columns in RadGridView and the text columns should be present only in the exported excel file and not to be displayed in RadGridView.

We are using Telerik Control version : 2013.3.1127.40

Regards,
Vimal

 

 

 

Dimitar
Telerik team
 answered on 18 Dec 2013
5 answers
450 views
I am using RadDropDownListEditorWhen the selection is made and dropdown loses focus, the cell reverts from the display text to the value.
How to keep the display text and not replace the cell with the value once the selection is made? I found an old thread back to 2011 which reported the same issue, however the suggestion does not fit my scenario, as I have to use a GridViewTextBoxColumn.

Here is the simplified sample of my cs codes. The designer is very simple, just GridViewTextBoxColumn in a RadGridView control. A screenshot of the issue is also attached. 
public partial class Form1 : RadForm
{
    public Form1()
    {
        InitializeComponent();
        this.radGridView1.EditorRequired += radGridView1_EditorRequired;
        this.radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;
    }
 
    void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        if (e.ActiveEditor is RadDropDownListEditor)
        {
            RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
            RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement;
            element.DisplayMember = "Description";
            element.ValueMember = "Code";
            element.DataSource = this.CreateDataTable();
            element.SelectedIndex = -1;
        }              
    }
 
    void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
    {
        e.EditorType = typeof(RadDropDownListEditor);
    
     
    private DataTable CreateDataTable()
    {
        DataTable dataTable = new DataTable();
        dataTable.Columns.Add("Code", typeof(decimal));
        dataTable.Columns.Add("Description", typeof(string));
        for (int i = 0; i < 5; i++)
        {
            DataRow dr = dataTable.NewRow();
            dr[0] = i + 1;
            dr[1] = "Description " + (i + 1);
            dataTable.Rows.Add(dr);
        }
        return dataTable;
    }
}

Any suggestion is appreciated.

Regards,
Shuping
George
Telerik team
 answered on 16 Dec 2013
3 answers
1.0K+ views
Hello!
I use RadGridView with grouping (with subtotal summary rows) and with total summary row at the end of the gridview.
I need to change text style only in total summary row. I've tried to use ViewCellFormatting event
private void gvProducts_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
        {
            if (e.CellElement is GridSummaryCellElement)
            {
                e.CellElement.TextAlignment = ContentAlignment.BottomRight;
                e.CellElement.Font = new Font(e.CellElement.Font, FontStyle.Bold);
            }
        }
But this code changes text style in each summary row. Could you help me, how can I understand is it a subtotal summary row or the last total summary row? Thank you in advance.
Ralitsa
Telerik team
 answered on 16 Dec 2013
3 answers
120 views
Hi!
Sorry, the title should be: Reproducing the Office2007blue Group Row Line.

After upgrading from 2009-Q1 to 2013-Q2, we found out that the ControlDefault Theme (Office2007Blue) for the gridview's "Group Rows" look significantly different, and cannot be simply reproduced with any provided theme in the 2013-Q2 release.

We really liked having the Group Row looking like:
1) The Group Expansion icon in the first column
2) The Group Summary Text
3) A light-blue horizontal line, with a thickness of about 5 pixels, with rounded endpoints, vertically centered in the row, and going to the last column.

Thanks for your help in reproducing this look using 2013-Q2 technology!
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Dec 2013
3 answers
164 views
I was curious if it was possible to make a Non-Active tab flash?

For instance, something is added to the grid on a non selected tab. I would like the tab to flash blue and white until the user clicked on it. But i don't want the application to automatically swap tabs. 

Thanks!
Nikolay
Telerik team
 answered on 12 Dec 2013
1 answer
110 views
Hi,

We are using schedule view to display list of appointments in the range of 1 year with 1500 schedules.

We need to show some of the text in the subject as bold. For that, we are using Run control inside appointment template.
This implementation makes scroll navigation very slow.
Pls let me know the solution or any alternate way for implementing this.


- Sugumar P
George
Telerik team
 answered on 12 Dec 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?