Telerik Forums
UI for WinForms Forum
1 answer
183 views

I have 2 tables in database. strProductID  is primary key in table tblICInventory and strProductID   is reference key in tblICInventoryStockTotal. I want to show strProductID  but it couldn't show data in the Column tblICInventory.strProductID . Please help me !


void AddItemToMultiColumnCombobox()
        {
            System.Data.OleDb.OleDbConnection con = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.IO.Path.GetFullPath("../../Database//Demo2.mdb"));
            con.Open();
            OleDbCommand com = new OleDbCommand("select [tblICInventory].[strProductID] ,memDescription,dblUnitsInStock,dblUnitsAllocated,curSalesPrice,strWarehouseID from tblICInventory,tblICInventoryStockTotal where  tblICInventory.strProductID = tblICInventoryStockTotal.strProductID ", con);
 
            OleDbDataAdapter oleda = new OleDbDataAdapter();
            oleda.SelectCommand = com;
            DataSet ds = new DataSet();
            oleda.Fill(ds);
            GridViewMultiComboBoxColumn col = new GridViewMultiComboBoxColumn();
            col.DataSource = ds.Tables[0].DefaultView;
            col.DisplayMember = "tblICInventory.strProductID";
            col.ValueMember = "tblICInventory.strProductID";
            col.Width = 100;
            col.HeaderText = "Item No";
            this.radGridViewDetail.Columns.RemoveAt(1);
            this.radGridViewDetail.Columns.Insert(1, col);
            col.AutoCompleteMode = AutoCompleteMode.None;
 
            col.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
            this.radGridViewDetail.CellBeginEdit += new GridViewCellCancelEventHandler(radGridViewDetail_CellBeginEdit);
        }
 
        bool isColumnAdded;
        void radGridViewDetail_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            if (this.radGridViewDetail.CurrentColumn is GridViewMultiComboBoxColumn)
            {
                if (!isColumnAdded)
                {
                    isColumnAdded = true;
                    RadMultiColumnComboBoxElement editor = (RadMultiColumnComboBoxElement)this.radGridViewDetail.ActiveEditor;
                    editor.EditorControl.MasterTemplate.AutoGenerateColumns = false;
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("tblICInventory.strProductID"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("memDescription"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("dblUnitsInStock"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("dblUnitsAllocated"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("curSalesPrice"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("strWarehouseID"));
                    editor.EditorControl.Columns[0].HeaderText = "Item No";
                    editor.EditorControl.Columns[1].HeaderText = "Description";
                    editor.EditorControl.Columns[2].HeaderText = "Stock";
                    editor.EditorControl.Columns[3].HeaderText = "Available";
                    editor.EditorControl.Columns[4].HeaderText = "Price";
                    editor.EditorControl.Columns[5].HeaderText = "Warehouse";
 
                    editor.AutoSizeDropDownToBestFit = true;
                }
            }
        }
Tan
Top achievements
Rank 1
 answered on 26 May 2012
3 answers
234 views
1. TextAlignment = ContentAlignment.MiddleCenter;
2. Bold = true;


        private void gv_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            if (e.CellElement.ColumnInfo is GridViewCommandColumn)
            {
                int index = (int)e.CellElement.RowInfo.Cells[0].Value - 1;
                ((RadButtonElement)e.CellElement.Children[0]).TextAlignment = ContentAlignment.MiddleCenter;
                ((RadButtonElement)e.CellElement.Children[0]).Font.Bold = True;
            }  
        }

Please refer picture from attachment.
Who can help me? :)
Thank You.
Ivan Petrov
Telerik team
 answered on 25 May 2012
1 answer
105 views
Hi guys,

I'm trying to find out how to center headers.

if I create columns number, name, other, then they appear left justified in the designer.

I want them centered.

I can center in code when there are databound items.  I just can't find out how to center the headers in design mode with no items!!!

Colin.
Ivan Todorov
Telerik team
 answered on 25 May 2012
1 answer
138 views
Dear Support,

We use RadGridView with decimal column. If the user position to a cell with the keyboard and try to enter the value -123.456 the value will be 123.456. The '-' sign put the cell in edit mode but don't display in the cell? The demo have the same behavior (GridView - Columns - Column Types) with the decmal column. To be working the correct way, the user have to enter --123.456 by typing 2 times - sign...

Is there a way to trap the '-' sign and display as the current value of the cell?

Regards,
Nadia
Stefan
Telerik team
 answered on 25 May 2012
1 answer
141 views
I have a page where I am using a NestedViewTemplate with a RadTabStrip, RadMultiPage, and two RadPageViews.

I have labels in RadPageView2 that I would like to get the text from in my code behind, so I can convert their values to integers to calculate in a formula that will then update another label's text in the same PageView. My questions are:

1. How can I get the text value of a label in my codebehind where the label resides in my second PageView?
2. How do I update the text value of a label in my second PageView from my codebehind?

A non working example of what I was trying is the following:

protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
    {
        if (e.Tab.Text.Equals("Tab Text"))
        {
           e.Tab.PageView.FindControl("myLabel").Text = "Created from Code Behind";
        }
    } 

Kind regards,

Ben
Voya Developer
Top achievements
Rank 1
 answered on 23 May 2012
1 answer
151 views
Hi,

i was able to add two completion page, i could navigate it through runtime but i wasn't able to do it in designtime?  i have an option page, if option1 was selected, then it will end up in the completionpage1 and the option2 will end in completionpage2.

how can I access completionpage2 at designtime?


Thanks
Boryana
Telerik team
 answered on 23 May 2012
1 answer
155 views
I am exporting a GridView that contains 2 child templates. However, I am not using the ExportToExcelML to perform the export. I am using Interop.Excel.

The two child templates are displayed at the same hierarchical level. Currently, I am using "foreach" to step through each row in the parent template and write its data to the Excel sheet.

I'm having trouble stepping through the related rows in each child template once I have the GridViewRowInfo of the parent row inside the "foreach". I can't seem to find an efficient way to access the rows of each template that directly relate to the current parent row. The ChildRows collection only seems to contain the rows of the first template.

Is there a built-in method or an elogant approach I could use to step through the child rows of each child template?

My current setup is as follows:
foreach (GridViewRowInfo row in gridView.Rows)
{
   //Write parent row data to Excel sheet
 
   //Access each child template either with a loop or explicitly
  
   //Step through child template's rows and write the row data to the Excel sheet
}

Ivan Petrov
Telerik team
 answered on 23 May 2012
1 answer
310 views
Hi There,

I'm working on a grid which has a GridViewComboBoxColumn. the column is often not wide enough the fit the item text. So i wanted to add a tool tip for each item in the list.
I found this article which seemed to be what i was after:
http://www.telerik.com/community/forums/winforms/dropdownlist-and-listcontrol/auto-horizontal-scroll-and-item-tooltip-in-radlistcontrol.aspx

but my code doesn't seem to work:

protected void rgDraft_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    if (e.Column.Name == "Country")
    {
        RadDropDownListEditor editor = (RadDropDownListEditor)this.rgDraft.ActiveEditor;
        RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)editor.EditorElement;
                     
        editorElement.VisualItemFormatting += new VisualListItemFormattingEventHandler(delegate(object formattingsender, VisualItemFormattingEventArgs args)
            {
                args.VisualItem.ToolTipText = args.VisualItem.Text;
            });
    }
}

Any idea why this doesn't work? I can do other things, like set the bgcolor to red and that works as expected

Many thanks,
Matt
Stefan
Telerik team
 answered on 23 May 2012
3 answers
118 views
Hi!

I've encountered a problem with bad performance in RadControls for WinForms ver. 2012.1.321. After upgrading from version 2011.2.831, my application really drags its feet. I've pinned down one line of code that runs slower on the new version, but its not the only one:

private RadTreeNode FindNodeWithTag(object oId)
{
   DateTime start = DateTime.Now;
    try
    {
        return rtvLassListe.Find(delegate(RadTreeNode n) { return ((n.Tag == oId) ? true : false); });
 
    }
    finally
    {
        ErrorLog.LogErrorMessage( (DateTime.Now - start).TotalMilliseconds.ToString() + " ms i FindNodeWithTag()" );
    }
}

This function logs 1-2 milliseconds in the 2011-version, compared to about 85000 in the 2012 version the first time it runs. Later runs on the same code have less differences, but still uses about 5-10 times as much time as the earlier version.

Uninstalling the 2012-version and reverting to the 2011-version fixes the problem. No other changes...

I did get an error message during installation that stated: "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2318." 

Could the installation error be the source of the problem, or are there other known problems?

What kind of error does the error code 2318 represent, and how can I get rid of the error?

Greetings,
Sverre H.
Julian Benkov
Telerik team
 answered on 23 May 2012
3 answers
408 views
Hello,

I have a RadGridView that contains 3 child templates in it. So when you expand each row, there are 3 tabs that you can view the data for each child template by clicking on each tab.

In my export code, i have the exporter.ExportHierarchy = true; for each export function. However, when i go to export the gridview to CSV / Excel / HTML / PDF, it appears that it can only export the first child template hierarchical grid data. It does not export all 3.

My question - Can the data for ALL child templates be exported using the CSV / Excel / HTML and/or PDF exporter commands?

Please let me know if this is possible, as right now it is only exporting the first child template.

If this is not possible to export all 3 child templates, is it possible to remove certain child templates before exporting so that i can provide my user with options on what child template they want to export?

Your help in this matter would be greatly appreciated, thanks!
Ivan Petrov
Telerik team
 answered on 23 May 2012
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?