Telerik Forums
UI for WinForms Forum
1 answer
620 views

I use the following code to display a tooltip. My problem is that I cannot set the tooltip maximum width. How can I do this?

GridDataCellElement cell = sender as GridDataCellElement;
if (cell != null && cell.ColumnInfo.Name == "MessageText")
{
    e.ToolTip.OwnerDraw = true;
    e.ToolTip.Draw += ToolTip_Draw;
    e.ToolTip.AutoPopDelay = int.MaxValue; // 24.86 days
                 
    e.ToolTipText = cell.Value.ToString();
}
 
void ToolTip_Draw(object sender, DrawToolTipEventArgs e)
{
    e.Graphics.FillRectangle(SystemBrushes.Info, e.Bounds);
    e.DrawBorder();
    e.DrawText(TextFormatFlags.RightToLeft | TextFormatFlags.Right);
}

GridDataCellElement cell = sender as GridDataCellElement;
if (cell != null && cell.ColumnInfo.Name == "MessageText")
{
    e.ToolTip.OwnerDraw = true;
    e.ToolTip.Draw += ToolTip_Draw;
    e.ToolTip.AutoPopDelay = int.MaxValue; // 24.86 days
                
    e.ToolTipText = cell.Value.ToString();
}
void ToolTip_Draw(object sender, DrawToolTipEventArgs e)
{
    e.Graphics.FillRectangle(SystemBrushes.Info, e.Bounds);
    e.DrawBorder();
    e.DrawText(TextFormatFlags.RightToLeft | TextFormatFlags.Right);
}
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 May 2016
1 answer
130 views
Best Regard


I need to know if a radgridview can be detected when the rows or columns are hidden when user do scroll. Something like a TopLeftChange Event


Thanks
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 May 2016
0 answers
136 views

Hi,

 

Could you allow me how I set the position of CURSOR after beginEdit() event.

I have used this :

radGridView1.MasterView.TableFilteringRow.Cells[1].Value = "ABCD";

radGridView1.MasterView.TableFilteringRow.Cells[1].BeginEdit();

 

After BeginEdit() I want to the cursor being after last character (e.g: After "D" in "ABCD").

 

 

Thanks

 

Hossein
Top achievements
Rank 1
 asked on 23 May 2016
14 answers
353 views
Hi There:

I really liked the antimated 'Home' page of your WinForm Demo.  However, when I open up the solution, I don't see a 'Startup Object' listed. Can you tell me where in the project sample folders I can find that 'Home' form?  I'd like to learn how to do up a home page with animation like that in my winForm application.

Thanks!
Stefan
Telerik team
 answered on 23 May 2016
1 answer
261 views
Can the CardView be forced to list items in a single column vertically, instead of expanding out horizontally into multiple columns?  I can't seem to find a property to set this, but I could just be overlooking it.

 

 

redshift20
Top achievements
Rank 1
 answered on 20 May 2016
3 answers
865 views

Hi!

I want to change the background color of the selected row, i also want some headings to have a different color. So far so good..When I click on the "Add new row" I don't want the selected row to go back to the default color, but stay the way it was. Any suggestions on how to accomplish that? This is my code so far:

private void rgv_RowFormatting(object sender, RowFormattingEventArgs e)
{
    if (e.RowElement is GridDataRowElement)
    {
        if (e.RowElement.RowInfo.IsCurrent) //Selected row
        {   
            e.RowElement.BackColor = Color.PaleVioletRed;
            e.RowElement.GradientStyle = GradientStyles.Solid;
            e.RowElement.DrawFill = true;
        }
        else if ((int)e.RowElement.RowInfo.Cells["Heading"].Value == 1) //Color on heading
        {
            e.RowElement.BackColor = Color.GreenYellow;
            e.RowElement.GradientStyle = GradientStyles.Solid;
            e.RowElement.DrawFill = true;
        }
        else //Reset color
        {
            e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
            e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
            e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
        }
    }
}

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 20 May 2016
1 answer
152 views

Is there a way to preserve a cells HTML like formatting when printing a gridview? Printing and exporting to PDF both show the markup instead of the formatted text.

 

see attached files

 

kind regards,

Andreas

Andreas Haeusler
Top achievements
Rank 2
 answered on 20 May 2016
1 answer
90 views

Hi,

I have a RadRibbonForm which uses RadDock with four split panes. Everything looks great apart from two glitches.

My RadGrid is set to dockstyle = FILL and when the form is resized it (the grid) sizes accordingly. If the form is mazimized it stays the same size then 'fills' when you click the grid.

The second issue is when the RibbonForm is mazimized ti takes up the entire screen - meaning the bottom part of the form (a status strip with sizing grip) goes 'behind' the Windows Task Bar. I am currently running is Windows 7 64-Bit.

Thanks

Martin.

 

Hristo
Telerik team
 answered on 19 May 2016
1 answer
191 views

Hi

Apologies if this thread is in the wrong place, I wasn't sure which sub-category was appropriate.

Basically I have a client moving from another system and they have thousands of RadDocuments in there database stored in Xaml and I need to be able to convert them to DocX format.

I thought this would be a simple process but I have hot a wall.

As a test I created a simple WinForm app with the following code:

1.var xaml = textBox1.Text;
2.var xamlProvider = new XamlFormatProvider();
3.var radDoc = xamlProvider.Import(xaml);

However, this throws an exception on the third line:

Cannot create unknown type '{clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents}RadDocument'.

 

Here is the Xaml I'm trying to import:

<t:RadDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:t="clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents" xmlns:s="clr-namespace:Telerik.Windows.Documents.Model.Styles;assembly=Telerik.Windows.Documents" xmlns:r="clr-namespace:Telerik.Windows.Documents.Model.Revisions;assembly=Telerik.Windows.Documents" xmlns:n="clr-namespace:Telerik.Windows.Documents.Model.Notes;assembly=Telerik.Windows.Documents" xmlns:th="clr-namespace:Telerik.Windows.Documents.Model.Themes;assembly=Telerik.Windows.Documents" version="1.2" LayoutMode="Paged" LineSpacing="1" LineSpacingType="Auto" ParagraphDefaultSpacingAfter="0" ParagraphDefaultSpacingBefore="0" SelectedBibliographicStyleName="\APA.XSL" StyleName="defaultDocumentStyle">
  <t:RadDocument.Captions>
    <t:CaptionDefinition IsDefault="True" IsLinkedToHeading="False" Label="Figure" LinkedHeadingLevel="0" NumberingFormat="Arabic" SeparatorType="Hyphen" />
    <t:CaptionDefinition IsDefault="True" IsLinkedToHeading="False" Label="Table" LinkedHeadingLevel="0" NumberingFormat="Arabic" SeparatorType="Hyphen" />
  </t:RadDocument.Captions>
  <t:RadDocument.ProtectionSettings>
    <t:DocumentProtectionSettings EnableDocumentProtection="False" Enforce="False" HashingAlgorithm="None" HashingSpinCount="0" ProtectionMode="ReadOnly" />
  </t:RadDocument.ProtectionSettings>
  <t:RadDocument.Styles>
    <s:StyleDefinition DisplayName="Document Default Style" IsCustom="False" IsDefault="False" IsPrimary="True" Name="defaultDocumentStyle" Type="Default">
      <s:StyleDefinition.ParagraphStyle>
        <s:ParagraphProperties LineSpacing="1" SpacingAfter="0" />
      </s:StyleDefinition.ParagraphStyle>
      <s:StyleDefinition.SpanStyle>
        <s:SpanProperties FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" />
      </s:StyleDefinition.SpanStyle>
    </s:StyleDefinition>
    <s:StyleDefinition DisplayName="Normal" IsCustom="False" IsDefault="True" IsPrimary="True" Name="Normal" Type="Paragraph" />
    <s:StyleDefinition DisplayName="TableNormal" IsCustom="False" IsDefault="True" IsPrimary="True" Name="TableNormal" Type="Table">
      <s:StyleDefinition.TableStyle>
        <s:TableProperties CellPadding="5,0,5,0">
          <s:TableProperties.TableLook>
            <t:TableLook />
          </s:TableProperties.TableLook>
        </s:TableProperties>
      </s:StyleDefinition.TableStyle>
    </s:StyleDefinition>
  </t:RadDocument.Styles>
  <t:Section>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:FieldRangeStart AnnotationID="1">
        <t:MergeField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" PropertyPath="Provider" />
      </t:FieldRangeStart>
      <t:Span FontFamily="Arial" FontSize="16" Text="Aviva Life" />
      <t:FieldRangeEnd AnnotationID="1" />
      <t:Span FontFamily="Arial" FontSize="16" Text=" & Pensions" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" Text="One Park Place" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" Text="Hatch Street" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" Text="Dublin 2" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0" TextAlignment="Right">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:FieldRangeStart AnnotationID="2">
        <t:MergeField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" PropertyPath="Date" />
      </t:FieldRangeStart>
      <t:Span FontFamily="Arial" FontSize="16" ForeColor="#FF000000" Text="24 April 2014" />
      <t:FieldRangeEnd AnnotationID="2" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Italic" FontWeight="Bold" ForeColor="#FF000000" Text="Re : " />
      <t:FieldRangeStart AnnotationID="3">
        <t:MergeField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" PropertyPath="Provider" />
      </t:FieldRangeStart>
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Italic" FontWeight="Bold" ForeColor="#FF000000" Text="Aviva Life" />
      <t:FieldRangeEnd AnnotationID="3" />
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Italic" FontWeight="Bold" ForeColor="#FF000000" Text=" " />
      <t:FieldRangeStart AnnotationID="4">
        <t:MergeField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" PropertyPath="ProductType" />
      </t:FieldRangeStart>
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Italic" FontWeight="Bold" ForeColor="#FF000000" Text="ARF" />
      <t:FieldRangeEnd AnnotationID="4" />
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Italic" FontWeight="Bold" ForeColor="#FF000000" Text=" " />
      <t:FieldRangeStart AnnotationID="5">
        <t:MergeField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" PropertyPath="PolicyNumber" />
      </t:FieldRangeStart>
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Italic" FontWeight="Bold" ForeColor="#FF000000" Text="91445684" />
      <t:FieldRangeEnd AnnotationID="5" />
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Italic" FontWeight="Bold" ForeColor="#FF000000" Text=" " />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" Text="I wish to take a one off withdrawal of €10,000 NET from the above policy." />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" Text="Please forward payment at your earliest convenience." />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" ForeColor="#FF000000" Text="I trust you will find the above in order but please contact me should you have any queries." />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" ForeColor="#FF000000" Text="Kind regards" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="16">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:Span FontFamily="Arial" FontSize="16" ForeColor="#FF000000" Text="_________________________________" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:FieldRangeStart AnnotationID="6">
        <t:MergeField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" PropertyPath="ClientName" />
      </t:FieldRangeStart>
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" Text="Mr Barry Donnellan" />
      <t:FieldRangeEnd AnnotationID="6" />
      <t:Span FontFamily="Arial" FontSize="16" FontStyle="Normal" FontWeight="Bold" ForeColor="#FF000000" Text=" " />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="2" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
      <t:FieldRangeStart AnnotationID="7">
        <t:MergeField DateTimeFormatting="" DisplayMode="Result" GeneralFormatting="" NumericFormatting="" PropertyPath="ConsultantTitle" />
      </t:FieldRangeStart>
      <t:FieldRangeEnd AnnotationID="7" />
    </t:Paragraph>
    <t:Paragraph FontSize="16" LeftIndent="0" LineSpacing="1" LineSpacingType="Auto" SpacingAfter="0">
      <t:Paragraph.ParagraphSymbolPropertiesStyle>
        <s:SpanProperties FontFamily="Arial" FontSize="16" />
      </t:Paragraph.ParagraphSymbolPropertiesStyle>
    </t:Paragraph>
    <t:Paragraph />
  </t:Section>
</t:RadDocument>

Appreciate any help you can give me to get this working.

Thanks.

 

Dimitar
Telerik team
 answered on 19 May 2016
2 answers
615 views

I have a RadCheckedListBox bound to a list of objects. The RadCheckedListBox's CheckedMember value corresponds to the "IsChecked" property on each object.

Updating that property value on the objects does not update the view on the RadCheckedListBox until the RadCheckedListBox receives focus. Surely this not by design?

Windows 7 Ultimate SP1

.NET 4.5

UI for WinForms Q2 2016

2016.2.503.40

 

C# code example:

 

// This code is a simple WinForms project that has a RadCheckedListBox and a regular WinForms CheckBox.

// When the checkbox is checked/unchecked, the "IsChecked" property of the first item in the list (not the control) is toggled.

// Because of the data binding, the first item in the RadCheckedListBox control should be visually updated to reflect the updated state.

public class SimpleObject
{
    public int Id { get; set; }
    public string Name { get; set; }
    public bool IsChecked { get; set; }
}

private IEnumerable<SimpleObject> CreateSimpleObjects()
{
    List<SimpleObject> data = new List<SimpleObject>()
        {
            new SimpleObject() { Id = 1, Name = "Item1", IsChecked = false },
            new SimpleObject() { Id = 2, Name = "Item2", IsChecked = true },
            new SimpleObject() { Id = 3, Name = "Item3", IsChecked = true },
            new SimpleObject() { Id = 4, Name = "Item4", IsChecked = false },
            new SimpleObject() { Id = 5, Name = "Item5", IsChecked = false },
            new SimpleObject() { Id = 6, Name = "Item6", IsChecked = true }
        };
    return data;
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
    var firstItem = this.radCheckedListBox1.Items[0].DataBoundItem as SimpleObject;
    firstItem.IsChecked = !firstItem.IsChecked;

    // // This makes it work as expected.
    // var activeControl = this.ActiveControl;
    // this.ActiveControl = this.radCheckedListBox1;
    // this.ActiveControl = activeControl;
}

Hristo
Telerik team
 answered on 19 May 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)
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?