Telerik Forums
UI for WinForms Forum
2 answers
1.8K+ views
I am going mad with this. I can do it in gridview but I am battling to get it done in radGridView.

These lines are from a grid view in a winform that I should replace with a radGrid:

private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
       {
           var location = Convert.ToString(dataGridView1[e.ColumnIndex, e.RowIndex].Value);
 
           if (dataGridView1.Columns[e.ColumnIndex] is DataGridViewLinkColumn)
 
               if (e.ColumnIndex == 4)
                   Process.Start(location);
 
               else if (e.ColumnIndex == 5)
               {
                   int i = dataGridView1.CurrentCell.RowIndex;
Basically I simply ned to get the content of the cell where I perform the mouse click. How you do the equivalent of the above using a radGrid?
Dimitar
Telerik team
 answered on 19 Dec 2013
15 answers
466 views
Hi,
I am a telerik user and I used many controls from telerik.
But I don't know how to create Bubble Bar, and need to add Reference (Telerik.Examples dll file)
So how can I get this.

Thank You
Dumpling
:)
Ivan Petrov
Telerik team
 answered on 19 Dec 2013
1 answer
90 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
329 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
132 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
212 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
177 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
414 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
998 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
90 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
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)
Chart (obsolete as of Q1 2013)
Form
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
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? 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?