Telerik Forums
UI for WPF Forum
6 answers
229 views
hello,

we have a RadGridView with some CheckBox columns defines as follows:

<telerik:RadGridView EditTriggers="CellClick" ItemsSource="{Binding Tickets">
    <telerik:RadGridView.Columns>
        <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsBooked}"/>
 <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsTaken}"/>
 <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsBusy}"/>
 <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsReady}"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>


I want to enable edit of all those columns in a single click.
I have managed to do so by setting each column with 

AutoSelectOnEdit="True" EditTriggers="CellClick"


However, when I try to apply them by style it doesnt work!

my style is defined as follows:
<Style TargetType="{x:Type telerik:GridViewCheckBoxColumn}">
    <Setter Property="AutoSelectOnEdit" Value="True"/>
    <Setter Property="EditTriggers" Value="CellClick"/>
</Style>


Please help!
Thanks, 
Omri.
Omri
Top achievements
Rank 1
 answered on 07 Feb 2013
5 answers
695 views
Let me start by saying I am new to DevTools and I have searched for several hours trying to find the answers to these questions. So here I am asking questions that probably have been answered elsewhere. If so just point me in the right direction.

I have an application that presents potentially large tables of read-only data to a user from a SQL Server 2012 database. The problem is that new rows are continually being added to the table and occasionally arbitrary rows in the table change due to external updates to the underlying database. I have external notification via a SQL Query Notification system when specific rows change or when new data is added to the table but I don't know how to best get these changes to the user interface.

I have a nice demo program running using a VirtualQueryableCollectionView linked to a wizard generated ADO.NET Entity Data Model object that becomes the DataContext for a RadGridView control. This code is almost directly copied from the Data Virtualization help. It seems to do a good job of paging through the table without excessive queries and without holding everything in memory. See the following code snips:

EntityConnectionStringBuilder ecb = new EntityConnectionStringBuilder();
ecb.Metadata = "res://*/SurveyModel.csdl|res://*/SurveyModel.ssdl|res://*/SurveyModel.msl";
ecb.Provider = "System.Data.SqlClient";
ecb.ProviderConnectionString = Database.MakeDataSource("DR1Search-bab33c3e-7117-4405-ad58-7b5f6fbfa4cd");
var entity = new MeasurementsEntities(ecb.ConnectionString);
var query = entity.MeasurementPoints.OrderBy(o => o.MeasurementID);
var view = new VirtualQueryableCollectionView(query) { LoadSize = 50 };
DataContext = view;

<telerik:RadGridView Name="radGridView1" ColumnWidth="*" DataLoadMode="Asynchronous" ItemsSource="{Binding}" Margin="0,45,0,0" />

Question 1: How do I trigger an update to the VirtualQueryableCollectionView and the RadGridView when new rows are added to the associated table without resetting the RadGridView and without re-querying rows that are already in the collection? One problem I want to avoid is that when a user is scrolling through the items in the RadGirdView using the up and down arrows I don't want the scroll position to reset every time a new row is added to the table. This system adds 1 row to the table every second.

Question 2: How can I update an item in the collection when the item changes in the table without re-querying a page of data or reseting the RadGridView? I already have the updated item data so all I really need to do is determine if the changed item is cached in the collection and update it. Also if the updated item is visible it needs to be updated in the RadGridView.

Question 3: This should be easy but I just haven't found the answer yet. Given the system described above, how do I scroll the RadGridView to make an arbitrary row in the underlying table visible? In this case I don't care about resetting the control or re-querying data. This only happens in response to a user action and it can take more time and resources to accomplish.

I don't require any automatic monitoring of database changes since I already have a change notification system built into my programs. All I need is to update the controls to be aware of the changes.

Thanks in advance,

Jesse
Vlad
Telerik team
 answered on 07 Feb 2013
1 answer
147 views
Simple problem, I am setting the RadListBox IsEnabled property to false. The selection in the list box no longer appears. This is not the same functionality as the default .net ListBox. Is there any way to achieve this?

**EDIT**

I apologize, this is not the default behavior of the ListBox but it can be styled to still show the selection through the generateditemscontainer template. RadListBox does not have this, is there a way to achieve this using the RadListBox?
George
Telerik team
 answered on 07 Feb 2013
1 answer
355 views
I use ReSharper 6.0 (6.0.2202.688) and I am having problems with getting resharper to resolve symbols at GridViewDataColumns:

As you can see, that ends up in pretty many warnings - which drowns out the real important stuff.

Any way to get around this?
Inger Marie
Top achievements
Rank 1
 answered on 07 Feb 2013
5 answers
160 views
Hi,

I defined reflection setting for RadCarousel  as follows:

'

 

 

 

<telerik:RadCarousel.ReflectionSettings>

 

 

 

 

<telerik:ReflectionSettings Angle="10"

 

 

 

HeightOffset="6"

 

 

 

HiddenPercentage="0.2"

 

 

 

Opacity="1"

 

 

 

Visibility="Visible" />

 

 

 

 

</telerik:RadCarousel.ReflectionSettings>

 

'
It has no effect on the display. Is it supposed to work only in certain cases? my ItemTemplate is an image. that should work?

thanks;

Harri.
Dimitrina
Telerik team
 answered on 07 Feb 2013
3 answers
861 views
Hi,

Can you let us know how to implement drag & drop functionality of a file into RadGridView.
The grid should display the link to the file.

NOTE: Multiple files can be dropped.

Best Regards,
Varun R
Nick
Telerik team
 answered on 07 Feb 2013
1 answer
175 views
I am preparing to deploy a desktop application and when I looked at the WPF documentation, there is documentation on Protecting Telerik RadControls assembly that outlines the steps for modifying the AssemblyProtection.cs and recompiling the assemblies.  However, with the download of the Telerik RadControls for WPF, I did not see the source code.  Please let me know what I should do...

Regards,

John DeVight

Dimitrina
Telerik team
 answered on 07 Feb 2013
17 answers
657 views
Hi,

I'm using Telerik V2012.1.325.35 and I have a strange problem RowDetailsTemplate. In my project, I have a main RadGridView and all object in his ItemsSource a "IsDeleted" member of type bool. On the "RowLoaded" of my main RadGridview, I do the following to hide all object with the "IsDeleted" == true and everything working fine:

private void gvExams_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
{
     ExamForBilling theExam = e.DataElement as ExamForBilling;

            if (theExam != null && e.Row != null)
            {
                e.Row.Visibility = theExam.IsDeleted ? Visibility.Collapsed : Visibility.Visible;
            }
}

In my main grid, I have a RowDetailsTemplate that contain another RadGridView with RowLoaded event where I do the samething to hide deleted object. The problem is for every deleted object, the grid display a blank row. Here is the RowLoaded code of my RowDetailsTemplate RadGridView (screenshot attached):

        private void RadGridView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            BilledExamsForBilling theExam = e.DataElement as BilledExamsForBilling;

            if (theExam != null && e.Row != null)
            {
                e.Row.Visibility = theExam.IsDeleted ? Visibility.Collapsed : Visibility.Visible;
            }
        }

Trevor
Top achievements
Rank 1
 answered on 07 Feb 2013
1 answer
172 views
Hi, guys!
I got unhandled exception: 

System.NullReferenceException was unhandled
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Documents
  StackTrace:
       at Telerik.Windows.Documents.DocumentStructure.DocumentStructureCollection.GetNextSiblingForDocumentElementOnSameLevel(LayoutBox box, DocumentElement owner) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\DocumentStructure\DocumentStructureCollection.cs:line 896
       at Telerik.Windows.Documents.Model.DocumentElementCollection.<GetEnumerator>d__0.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\DocumentElementCollection.cs:line 254
       at Telerik.Windows.Documents.Model.DocumentElement.<EnumerateChildrenOfType>d__0`1.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\DocumentElement.cs:line 377
       at Telerik.Windows.Documents.Model.DocumentElement.<EnumerateChildrenOfType>d__0`1.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\DocumentElement.cs:line 379
       at Telerik.Windows.Documents.Model.DocumentElement.<EnumerateChildrenOfType>d__0`1.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\DocumentElement.cs:line 379
       at Telerik.Windows.Documents.Model.DocumentElement.<EnumerateChildrenOfType>d__0`1.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\DocumentElement.cs:line 379
       at Telerik.Windows.Documents.Model.DocumentElement.<EnumerateChildrenOfType>d__0`1.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\DocumentElement.cs:line 379
       at Telerik.Windows.Documents.Model.DocumentElement.<EnumerateChildrenOfType>d__0`1.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\DocumentElement.cs:line 379
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at Telerik.Windows.Documents.Layout.SectionLayoutBox.GetEndnotesForSection(RadDocument doc, Section section) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\SectionLayoutBox.cs:line 358
       at Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverride(SizeF availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\SectionLayoutBox.cs:line 300
       at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\LayoutElement.cs:line 929
       at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\LayoutElement.cs:line 832
       at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverrideInternal(SizeF availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\DocumentLayoutBox.cs:line 190
       at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverride(SizeF availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\DocumentLayoutBox.cs:line 144
       at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\LayoutElement.cs:line 929
       at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Layout\LayoutElement.cs:line 832
       at Telerik.Windows.Documents.Model.RadDocument.Measure(SizeF measureSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\RadDocument.cs:line 1066
       at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.MeasureOverride(Size availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPrintLayoutPresenter.cs:line 670
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Window.MeasureOverrideHelper(Size constraint)
       at System.Windows.Window.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at WpfApplication6.App.Main() in c:\users\yuliak\documents\visual studio 2010\Projects\WpfApplication6\WpfApplication6\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()


My XAML:
<Window x:Class="WpfApplication6.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <telerik:RadRichTextBox x:Name="viewer" Grid.Row="0" IsReadOnly="true" LayoutMode="Paged"/>
        <Button Grid.Row="1" Click="Button_Click">Load File</Button>
    </Grid>
</Window>

 

My Code:

private void LoadDocument(string path)
       {
           try
           {
 
               using (var stream = new FileStream(path, FileMode.Open))
               {
                   IDocumentFormatProvider provider = new HtmlFormatProvider();
 
                   RadDocument document = provider.Import(stream);
                   viewer.CommandError += OnCommandError;
                   viewer.Document = document;
               }
 
           }
           catch (Exception)
           {
 
               string str = "";
           }
       }

File HTML (code) - please save as file HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="outer" style="position: relative;">
    <tbody>
      <tr>
        <td>
            <table align="center" cellpadding="0" cellspacing="0" border="0" width="670" style="border: 0px; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; background-color: #ffffff;position: relative;">   
          <tbody>
                 <td rowspan="3"></td>
              </tbody>
 
            </table>
        </td>
       <td rowspan="3"></td>
     </tr>
     </tbody>
    </table>
 </body>
</html>
Mihail
Telerik team
 answered on 07 Feb 2013
3 answers
259 views
I have set the AutoComplete feature for the RadCombobox and this feature while typing a single letter also triggers the selectionchanged.  In my scenario, I want to decide after I finished searching for the element I need and then trigger the selectionchanged event.  Is it possible?
George
Telerik team
 answered on 07 Feb 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? 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?