Telerik Forums
UI for WinForms Forum
2 answers
300 views
Dear Telerik Team,


Is it possible to create a custom Drop Down list (validation list) in the Excel worksheet when exporting the RadGridView with ExportToExcelML (VB.net code)?

 

I;m giving herebelow an example of code to create a drop down list using the Excel Interop assemblies but which I'd like to use/convert with the faster ExportToExcelML method:

 

 

 

Private Sub AddCategoryValidationList(ByVal rng As Excel.Range)

With

 

rng.Validation

 

 

.Add(Excel.XlDVType.xlValidateList, _

 

Excel.XlDVAlertStyle.xlValidAlertStop, _

 

1,

"=Beneficiaries!$A$1:$A$1000")

 

 

.InCellDropdown =

True

 

.ErrorTitle =

"Stock release form"

 

.InputMessage =

"Please select a beneficiairy"

 

.ErrorMessage =

"The value you have entered is not a " & _

 

 

 

"valid beneficiary. Please select a beneficiary from " & _

 

 

 

"the list."

 

.ShowInput =

True

 

.ShowError =

True

 

 

End With

 

End Sub

Best regards,
Alain Cavenaile
Martin Vasilev
Telerik team
 answered on 05 May 2011
1 answer
219 views
Hi,
When I change entire app's theme using associated class, My grid's header font doesn't appear with the font I set for prevous theme. this happens for Win7 and Desert themes. How to solve this? please tell me.
How can I get rid of Telerik theme's header display glitch (shows header gray color and after mouse hover backs to original color(green))?
Thank you again, Tooraj Azizi.
Ivan Petrov
Telerik team
 answered on 04 May 2011
3 answers
286 views
Hi,
In my C# WinForms App I have placed a progress bar on statusbar of Main  form. the progress bar must show the progress of any action such as updating of a sql server table, backup operation, or any calculative operation.
Please put a sample here, thank you.
Tooraj azizi.









Ivan Petrov
Telerik team
 answered on 04 May 2011
1 answer
152 views
When I click on a cell, how can I change the color of the highlight.  Also, how can I change the color of the hover?
Stefan
Telerik team
 answered on 04 May 2011
1 answer
127 views
When I add an appointment to the appointments collection manually, say like this:
Appointment apt = new Appointment();
apt.UniqueId = new EventId(1);
apt.ResourceId = new EventId(1);
apt.Start = DateTime.Now.Date.AddHours(9);
apt.End = apt.Start.AddMinutes(30);
apt.Summary = "Apt Test";
radScheduler1.Appointments.Add(apt);
When I drag that appointment to a new location, there is no "feedback" of where I and currently hovering, so it makes it difficult to know if I'm dropping it in the correct spot.
Stefan
Telerik team
 answered on 04 May 2011
5 answers
591 views
Hello,

I would like to access a specific checkbox value in my grid.
After some hours of searching the correct syntax and way to do it, I come to you for more information.

For example, how can I get the myGrid.row[2].cell["checkbox"] value (where the cell is checkbox) outside of any events?
Actually can cast something somewhere in the cell GridViewCellInfo to get the inner checkbox value?

Thanks

regards
Emanuel Varga
Top achievements
Rank 1
 answered on 03 May 2011
3 answers
173 views
Hello,

I'm actually using a databinding, which has a DataTable as Datasource.

DataTable dataTable = new DataTable();
dataTable.Columns.AddRange(new DataColumn[]{
        new DataColumn("NumeroActe", typeof(string)), 
        new DataColumn("DateActe", typeof(string)), 
        new DataColumn("TypeBien", typeof(string)), 
        new DataColumn("Surface", typeof(decimal)), 
        new DataColumn("Prix", typeof(decimal)), 
        new DataColumn("Pieces", typeof(int)), 
        new DataColumn("EpoqueConstruction", typeof(string)),
        new DataColumn("NumeroRue", typeof(string)),
        new DataColumn("NomRue", typeof(string)),
        new DataColumn("LieuDit", typeof(string)),
        new DataColumn("CodePostal", typeof(string)),
        new DataColumn("Localite", typeof(string)),
        new DataColumn("Maison", typeof(bool)), 
        new DataColumn("Appartement", typeof(bool)), 
        new DataColumn("Terrain", typeof(bool)), 
        new DataColumn("Local", typeof(bool)), 
        new DataColumn("Annexe", typeof(bool)), 
        new DataColumn("Cave", typeof(bool)), 
        new DataColumn("Garage", typeof(bool)),
        new DataColumn("Grenier", typeof(bool))
    });
 
dataTable.BeginLoadData();
 
foreach (DataRow row in table.Rows)
{
    // Create a ExportVenteData according to the current Database row
    ExportVenteManager manager = new ExportVenteManager();
    ExportVenteData tmpExportData = manager.BuildExportVenteData(row);
 
    if (tmpExportData != null && tmpExportData.IsValid())
    {
        // Create the new custom line for the datasource
        DataRow ligne = dataTable.NewRow();
 
        ligne["NumeroActe"] = tmpExportData.NumActe;
        ligne["DateActe"] = tmpExportData.DateActe.ToString("dd/MM/yyyy");
        ligne["TypeBien"] = cTypeFiche.GetLibelle(tmpExportData.TypeBien);
        ligne["Prix"] = tmpExportData.PrixVente;
        ligne["Surface"] = tmpExportData.Surface;
        ligne["Pieces"] = tmpExportData.NbPieces;
        ligne["EpoqueConstruction"] = cLibellesEnums.EpoqueConstruction.ToString(tmpExportData.EpoqueConstruction);
 
        ligne["NumeroRue"] = row["NUMERO_RUE"] != null ? row["NUMERO_RUE"].ToString() : "";
        ligne["NomRue"] = row["NOM_RUE"] != null ? row["NOM_RUE"].ToString() : "";
        ligne["LieuDit"] = row["LIEU_DIT"] != null ? row["LIEU_DIT"].ToString() : "";
        ligne["CodePostal"] = row["CODE_POSTAL"] != null ? row["CODE_POSTAL"].ToString() : "";
        ligne["Localite"] = row["LOCALITE"] != null ? row["LOCALITE"].ToString() : "";
 
        foreach (eTypeFiche fiche in tmpExportData.LstAnnexesSupplementaires)
        {
            switch (fiche)
            {
                case eTypeFiche.ANNEXE:
                    ligne["Annexe"] = true;
                    break;
                case eTypeFiche.ANNEXE_CAVE:
                    ligne["Cave"] = true;
                    break;
                case eTypeFiche.ANNEXE_GRENIER:
                    ligne["Grenier"] = true;
                    break;
                case eTypeFiche.APPARTEMENT:
                    ligne["Appartement"] = true;
                    break;
                case eTypeFiche.GARAGE:
                    ligne["Garage"] = true;
                    break;
                case eTypeFiche.LOCAL:
                    ligne["Local"] = true;
                    break;
                case eTypeFiche.MAISON:
                    ligne["Maison"] = true;
                    break;
                case eTypeFiche.TERRAIN:
                    ligne["Terrain"] = true;
                    break;
            }
        }
 
        dataTable.Rows.Add(ligne);
    }
}
 
dataTable.EndLoadData();

This DataTable is a custom version of SQLServer database format, and suit with my grid (every column is link by name with my databinding columns)

dgvData.MasterTemplate.BeginUpdate();
bdsData.DataSource = _dataTable;
dgvData.MasterTemplate.EndUpdate();


My grid has my databinding as datasource.
Actually everything is fine. (see screen1.png attached)
As you can see in screen1.png, there are some checkboxcolumns in my grid, and I would like to move theses columns to a childrow. (screen2.png)

Is there a way to do this programmatically?
I could already add chilrows


Second point:
Since I use the databinding, I can't interfere anymore on the cellformatting event in order to put my datevalue "01/01/0001" to string.empty.
Any solution as wordaround?

Thanks for your lights

Regards

Thanks a lot
Emanuel Varga
Top achievements
Rank 1
 answered on 03 May 2011
2 answers
218 views
Hi,
Because Telerik have not provided a calculator column or comnponent, I'm going to use DevExpress CalcEdit component but don't know how to use it as editor of my calculator column, any guide?
Thank you.
Stefan
Telerik team
 answered on 03 May 2011
4 answers
145 views
I have an application that uses the drag/drop feature of gridview.  When a cell is dragged from one column onto another, I need the cells from the draggedCell column to shift up, filling in the cell that has been dragged to another column.

I also need the column onto which the cell was dropped to shift downward thereby allowing the dropped cell to be inserted at the row position at which it was dropped.

Thanks for any help and code examples you can provide.
Gabriela
Top achievements
Rank 1
 answered on 03 May 2011
2 answers
137 views
I did a search in the forums and in PITS but didn't find any mention of this. However, I have code that worked with Q3 2010, but no longer works with Q1 2011. You can repro this using the code below:

using System.ComponentModel;
using System.Windows.Forms;
using Telerik.WinControls.Data;
using Telerik.WinControls.UI;
  
namespace PropertyGridExample
{
    public class GridViewFactory
    {
        public RadGridView CreateGridView()
        {
            // Setup gridview with default options
            RadGridView gvResults = new RadGridView();
            gvResults.Dock = DockStyle.Fill;
            //gvResults.AllowAutoSizeColumns = true;
            gvResults.ReadOnly = true;
            gvResults.Text = "Test";
            gvResults.Name = "SearchResults";
            gvResults.EnableSorting = true;
            gvResults.MasterTemplate.EnableSorting = true;
  
            // Setup MasterTemplate
            gvResults.MasterTemplate.AllowAddNewRow = false;
            gvResults.MasterTemplate.AutoGenerateColumns = false;
            gvResults.MasterTemplate.Tag = "Test Template";
  
            gvResults.DataSource = null;
  
            gvResults.TableElement.BeginUpdate();
            gvResults.MasterTemplate.Columns.Clear();
  
            // Setup Columns
            GridViewTextBoxColumn column = new GridViewTextBoxColumn();
            column.Name = "Title";
            column.HeaderText = "Title";
            column.FieldName = "Title";
            column.MinWidth = 50;
            column.MaxWidth = 250;
            column.AutoSizeMode = BestFitColumnMode.DisplayedDataCells;
  
            gvResults.MasterTemplate.Columns.Add(column);
  
            GridViewTextBoxColumn column1 = new GridViewTextBoxColumn();
            column1.Name = "Countries";
            column1.HeaderText = "Countries";
            column1.FieldName = "Countries";
            column1.MinWidth = 50;
            column1.MaxWidth = 250;
            column1.AutoSizeMode = BestFitColumnMode.DisplayedDataCells;
  
            gvResults.MasterTemplate.Columns.Add(column1);
  
            GridViewTextBoxColumn column2 = new GridViewTextBoxColumn();
            column2.Name = "Sites";
            column2.HeaderText = "Sites";
            column2.FieldName = "Sites";
            column2.MinWidth = 50;
            column2.MaxWidth = 250;
            column2.AutoSizeMode = BestFitColumnMode.DisplayedDataCells;
  
            gvResults.MasterTemplate.Columns.Add(column2);
  
            gvResults.TableElement.EndUpdate(false);
  
            // Set the Datasource (Can be any object collection)
            gvResults.DataSource = DataFactoryClass.GetData();
  
            SortDescriptor descriptor = new SortDescriptor();
            descriptor.PropertyName = "Title";
            descriptor.Direction = ListSortDirection.Descending;
            gvResults.SortDescriptors.Add(descriptor);
  
            return gvResults;
        }
    }
}

DataSource can be any collection of objects; I was using a three property object collection (evidenced by the column creations) for simplicity. When this RadGridView is attached to a form as a control, it will *not* sort on the title as suggested, using the current assemblies. Reverting to the older Q3 2010 assemblies works however.

Unfortunately I am not able to revert our code back to the old assemblies, as the new assemblies fix several other major bugs present in the Q3 2010 version. Is there a workaround available or a fix planned soon?

EDIT: (I also just put this in as a support issue.)
Alexander
Telerik team
 answered on 03 May 2011
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?