Telerik Forums
UI for WinForms Forum
2 answers
780 views

Hi all,

Can I format a cell value with underline in textbox column of a 

According to this link, http://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells, only 4 style properties can be set:

Fill
Border
Font
ForeColor

Best,

Tri Nguyen

 

Cao Trí
Top achievements
Rank 1
 answered on 21 Sep 2016
3 answers
219 views
Is there a way that you can allow people to use this text box to either enter feet and inches or just inches for their height and get the value just in inches?
Hristo
Telerik team
 answered on 20 Sep 2016
1 answer
122 views

I tried to use GridView in Master/Details Mode to get data from MongoDb Server.

And as the pic shows, I get the Id and the name from a Collection of Users, then I Iterate the parent Rows to get the Id and I fetch in the 2nd Colection of Product to get the details of each user.

In the server, the 1st user have only 1 product but in the pic it show it 3 times with 2 tables.

So how to get the right results and how work with Master/Detail GridView

namespace TelerikGridView
{
    public partial class Form2 : Form
    {
        List<WatchTblCls> wts;
        List<UserCls> user;
        List<SymboleCls> symb;
        public Form2()
        {
            InitializeComponent();
            wts = new List<WatchTblCls>();
            user = new List<UserCls>();
            symb = new List<SymboleCls>();
        }
 
        private async void button1_Click(object sender, EventArgs e)
        {
            // add user into datagridview from MongoDB Colelction Watchtbl
            var client = new MongoClient("mongodb://servername:27017");
 
            var database = client.GetDatabase("WatchTblDB");
            var collectionWatchtbl = database.GetCollection<BsonDocument>("Watchtbl");
            var collectionUser = database.GetCollection<BsonDocument>("Users");
 
            //wts = await collectionWatchtbl.Find(x => true).ToListAsync();
 
            //Get User Data
            var filter = new BsonDocument();
            using (var cursor = await collectionUser.FindAsync(filter))
            {
                while (await cursor.MoveNextAsync())
                {
                    var batch = cursor.Current;
                    foreach (var document in batch)
                    {
                        user.Add(new UserCls()
                        {
                            Id = ObjectId.Parse(document["_id"].ToString()),
                            Name = document["Name"].ToString()
                        });
                    }
                }
            }
 
            //Get WatchTbl Data
            using (var cursor = await collectionWatchtbl.FindAsync(filter))
            {
                while (await cursor.MoveNextAsync())
                {
                    var batch = cursor.Current;
                    foreach (var document in batch)
                    {
                        wts.Add(new WatchTblCls()
                        {
                            Id = ObjectId.Parse(document["_id"].ToString()),
                            UserId = document["userId"].ToString(),
                            WID = document["wid"].ToString(),
                            Name = document["name"].ToString()
                            //Symbole
                        });
                    }
                }
            }
 
            this.radGridView1.DataSource = user;
            this.radGridView1.Columns["fbId"].IsVisible = false;
            this.radGridView1.Columns["Pass"].IsVisible = false;
        }
 
        GridViewTemplate childTemplate;
        private GridViewTemplate CreateChildTemplate()
        {
            childTemplate = new GridViewTemplate();
            this.radGridView1.Templates.Add(childTemplate);
            GridViewTextBoxColumn column = new GridViewTextBoxColumn("wid");
            childTemplate.Columns.Add(column);
 
            column = new GridViewTextBoxColumn("name");
            childTemplate.Columns.Add(column);
 
            childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            return childTemplate;
        }
 
        private void Form2_Load(object sender, EventArgs e)
        {
            GridViewTemplate childTemplate = CreateChildTemplate();
            this.radGridView1.Templates.Add(childTemplate);
            childTemplate.HierarchyDataProvider = new GridViewEventDataProvider(childTemplate);
 
        }
 
        private void radGridView1_RowSourceNeeded(object sender, GridViewRowSourceNeededEventArgs e)
        {
            foreach (GridViewRowInfo item in radGridView1.Rows)
            {
                var itll = item.Cells["id"].Value.ToString();
                foreach (var itemWts in wts)
                {
                    if (itll == itemWts.UserId.ToString())
                    {
                        GridViewRowInfo row = e.Template.Rows.NewRow();
                        row.Cells["wid"].Value = itemWts.WID.ToString();
                        row.Cells["name"].Value = itemWts.Name.ToString();
                        //symbole
                        e.SourceCollection.Add(row);
                    }
                }
            }
        }
    }
 
    public class WatchTblCls
    {
        [BsonId]
        public ObjectId Id { get; set; }
        public string UserId { get; set; }
        public string WID { get; set; }
        public string Name { get; set; }
        public List<SymboleCls> Symbols { get; set; }
 
         
    }
 
    public class UserCls
    {
        [BsonId]
        public ObjectId Id { get; set; }
        public string fbId { get; set; }
        public string Name { get; set; }
        public string Pass { get; set; }
 
 
    }
 
    public class SymboleCls
    {
        [BsonId]
        public ObjectId Id { get; set; }
        public string Name { get; set; }
    }
}

Hristo
Telerik team
 answered on 20 Sep 2016
13 answers
3.4K+ views

Hello,

I am stuck at this part for hours and not able to find an answer on how to do this. I am can do this with the normal gridview but not with radGridView.

I have a radGridView with 7 columns. And I want to get the cell value of the 6th column base on the row index of a double click. Because sometimes I click on column 2..but I don't want the cell value of column 2. I want the cell value of column 6.

Please help...Thanks...

Hristo
Telerik team
 answered on 20 Sep 2016
3 answers
426 views

Hi All

We are currently  migrating one of our application from which is built on Third Party software( don't want to name it)  to Telerik . The Application is an Windows Forms application and we need to get rid of the existing Third Party software and move that to Telerik. The existing applications has lot of Grids  with features such as expand , collapse and filtering . Apart from that the application also contains Advanced Grid Grouping controls, Advanced Grid Navigation controls. It also contains Advanced Split Container's , Advanced Tab Page and Advanced Tree . I can see these controls available in Telerik UI for Windforms but not sure which would be best suitable product Telerik UI for Windforms or Telerik UI for WPF. Any Suggestions or Recommendations on the same will be highly helpful .

 

Hristo
Telerik team
 answered on 19 Sep 2016
1 answer
134 views

We have created our own class based on the RadGridView. It has been themed and coded so all of our grids look and operate the same throughout the application. One of our requirements is to have the filtering row available at the top row of each grid.

Through theming I have removed the filter description text and the filter selection button. What we are left with is an empty filter row across the top of the grid that users can type into to filter the grid.

The issue is that the default filtering is set to "Contains" and our requirements are for it to be set to "Starts with". Every thing I see on this board shows how to set the default filtering to the columns after they have been set. I need to set this on the Grid base or master template so all columns will have this setting. Is this possible or do I have to wait until all columns are set and the roll through them each individually?

Here is a snippet of the base class code.

// CoreRadGrid
            this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.UseCompatibleTextRendering = false;
            this.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.None;
            this.MasterTemplate.EnableAlternatingRowColor = true;
            this.ThemeName = CoreTheme.ThemeName();
            this.RootElement.UseDefaultDisabledPaint = false;
            this.MasterTemplate.EnableFiltering = true;
   
            // set Default filter
            this.MasterTemplate.FilterDescriptors.Clear();
            FilterDescriptor filter = new FilterDescriptor();
            filter.Operator = FilterOperator.StartsWith;
            filter.IsFilterEditor = true;
            this.MasterTemplate.FilterDescriptors.Add(filter);

            this.MasterTemplate.MultiSelect = true;
            this.MasterTemplate.ViewDefinition = tableViewDefinition1;
            this.AutoGenerateColumns = true;

Hristo
Telerik team
 answered on 19 Sep 2016
2 answers
235 views

Hi.

The two halves of the screen shot are the same tile in different states.

The first, in "No" state,  has a background image that is an opaque bitmap.

The second, in "Yes" state, shows the same tile, same background image, but its foreground Image is set to an opaque plain black bitmap painted with a solid white circle containing a green tick. This is to give a gray blind effect.

The bottom part of the tile is made up of several docked lightvisualelements to create a slider button.

I notice that the gray blind seems to be painted opaquely over the other elements, which I was pleased about as I actually wanted this effect. Is tile.Image always painted opaque? But I noticed that the bottom section of the tile isn't obscured or affected by by the blind, which again is what I want, but is this because of the presence of all the docking and visual elements?.

The problem is that I wanted the white, ticked circle to appear solid. Is this not possible by painting the circle as part of the image? Or do I need to add it as yet another docked visual tile element and set that one's image to the circle?

Hristo
Telerik team
 answered on 19 Sep 2016
1 answer
577 views

Winforms Q2 2013 SP1

Visual Studio 2013

I recently re-installed Telerik Winforms because I moved to a new PC on Windows 10

Also I now use VS2013 instead of VS2010

On my old PC, in VS2010 I could create a new radForm in my project by clicking "Add New..." and then select radForm from the telerik tab.

In my install on VS2013 I cannot find that anywhere.

Also the Telerik menu seems more empty than on my old pc.

I included pictures of both.

The telerik controls are included in the Toolbox

 

I uninstalled and re-installed again, but to no avail.

Please help,

regards,

Martin

Nikola
Telerik team
 answered on 16 Sep 2016
7 answers
1.2K+ views
Hi,
I have added a RadTreeView Control in run time. I am changing the backcolor of the selected node usnig 

treeView_Selected event. But when I select another node , the colour of previously selected node also remains the same (I want to change the back colour of this previously selected node). 
Does any one have any idea, how to achieve it? 


 

Hristo
Telerik team
 answered on 16 Sep 2016
1 answer
209 views

Hello,

The RadGridView's DataSource is set to a BindingSource. I am using the RadGridView.TableElement.VScrollBar.ValueChanged event to detect once the user has scrolled to a certain point. I then grab more items from the database and load them into the BindingSource and call BindingSource.ResetBindings(false) to refresh the items in the grid. This works fine unless the user is dragging the Thumb on the ScrollBar. After the event is triggered and more items are loaded, the Thumb is still focused and drag-able, but there is a large empty area below the last row in the grid. You can scroll down a lot further than the number of rows in the grid. Calling Refresh on the GridView does not remove the white area.

Is there a way to remove the white area this creates? Or maybe a better way to accomplish Load on Demand?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Sep 2016
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
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
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
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?